diff --git a/.editorconfig b/.editorconfig index 8b8642d3..c9158d10 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,11 +3,9 @@ root = true [*] charset = utf-8 indent_style = space -indent_size = 2 end_of_line = lf trim_trailing_whitespace = true insert_final_newline = true -max_line_length = 120 [*.py] -indent_size = 4 \ No newline at end of file +indent_size = 4 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d77fa0d4..4ab201a0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.10', '3.11', '3.12', '3.13' ] + python-version: [ '3.13' ] fail-fast: false steps: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index c2c56092..e53b3222 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -39,7 +39,7 @@ jobs: - name: Setup uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: uv sync --group dev --frozen diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf404a4d..a2d05e19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: - name: Setup uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: uv sync --group dev --frozen diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index faa4c37f..118cd653 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,34 +30,43 @@ jobs: - name: Setup uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: uv sync --group dev --frozen - name: Run Tests - run: uv run pytest --junitxml=build/reports/junit.xml + run: uv run pytest - name: Generate coverage report uses: mridang/action-test-reporter@v1 if: always() with: github-token: ${{ secrets.GITHUB_TOKEN }} - coverage-file: 'build/coverage/clover.xml' + coverage-file: '.out/coverage.xml' - name: Upload Results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: always() with: name: test-results - path: build/reports/junit.xml + path: .out/reports/junit.xml + overwrite: true + + - name: Upload Coverage + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + if: always() + with: + name: test-coverage + path: .out/coverage.xml + overwrite: true - name: Generate Report if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} uses: dorny/test-reporter@6e6a65b7a0bd2c9197df7d0ae36ac5cee784230c # v2.0.0 with: name: Tests - path: build/reports/junit.xml + path: .out/reports/junit.xml reporter: java-junit fail-on-error: 'false' token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index a1bb2baf..b3d55e02 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -15,7 +15,7 @@ permissions: contents: read jobs: - ty-check: + mypy-check: runs-on: ubuntu-latest name: Inspect Code @@ -33,10 +33,10 @@ jobs: - name: Setup uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: uv sync --group dev --frozen - - name: Run Ty - run: uv run ty check + - name: Run Mypy + run: uv run mypy zitadel_client test spec diff --git a/.github/workflows/unused.yml b/.github/workflows/unused.yml index c4426b5e..cd56b1bf 100644 --- a/.github/workflows/unused.yml +++ b/.github/workflows/unused.yml @@ -32,7 +32,7 @@ jobs: - name: Setup uv uses: astral-sh/setup-uv@v4 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: uv sync --group dev --frozen diff --git a/.gitignore b/.gitignore index 14107b7f..0fa09210 100644 --- a/.gitignore +++ b/.gitignore @@ -1,78 +1,29 @@ -# Byte-compiled / optimized / DLL files +# Python cache __pycache__/ *.py[cod] *$py.class -# C extensions -*.so +# Tool caches +devbox.d/ +.pytest/ +.mypy/ +.mypy_cache/ +.ruff/ +.ruff_cache/ -# 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 -.uv/ -nosetests.xml -coverage.xml -*,cover -.hypothesis/ +# Virtual environment venv/ .venv/ -.python-version -.pytest - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ +# Build output +dist/ +build/ +*.egg-info/ -#Ipython Notebook -.ipynb_checkpoints +# Coverage output +.out/ +.coverage +# integration-test stack output (PAT, service-account key) — never commit +etc/zitadel_output/ .env - -devbox.json -devbox.lock -.devbox - -.uv - -.ruff -.ty diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..e19bdf69 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,71 @@ +# Keep-list: files the generator must NOT overwrite, and the Makefile's +# `prune` step must NOT delete. Everything else is generator-owned. + +# --- bespoke authenticators (ported onto the generated auth interfaces) --- +# +# NOTE: the generator now owns authenticator.py (interface), base_authenticator.py, +# bearer_authenticator.py, http_aware_authenticator.py and +# zitadel_access_token_authenticator.py; only the token-minting strategies below +# are kept. +zitadel_client/auth/client_credentials_authenticator.py +zitadel_client/auth/no_auth_authenticator.py +zitadel_client/auth/oauth_authenticator.py +zitadel_client/auth/open_id.py +zitadel_client/auth/personal_access_token_authenticator.py +zitadel_client/auth/web_token_authenticator.py + +# --- bespoke tests + fixtures the generator does not emit --- +# +# NOTE: the spec-independent unit tests (value_serializer, header_selector, +# configuration, transport_options, trace_context_util, default_api_client_unit) +# are now generator-owned and are NOT kept here. Only the Zitadel authenticator +# unit tests, the facade test, the integration specs, the Zitadel server +# fixtures, and the wiremock/squid/cert fixtures are kept. +etc/ +spec/ +test/auth/__init__.py +test/auth/test_client_credentials_authenticator.py +test/auth/test_no_auth_authenticator.py +test/auth/test_oauth_authenticator.py +test/auth/test_personal_access_authenticator.py +test/auth/test_web_token_authenticator.py +test/fixtures/ +test/test_zitadel.py + +# --- repo identity + docs (team-owned, not generated) --- +LICENSE +README.md +SECURITY.md +VERSIONING.md + +# --- house tooling (team-owned, not generated) --- +.commitlintrc.json +.dockerignore +.editorconfig +.github/ +.gitignore +.pre-commit-config.yaml +.releaserc.json +devbox.json +devbox.lock +Dockerfile +lefthook.yml +qodana.yaml + +# --- build / package config (team-owned: repo identity + bespoke deps) --- +pyproject.toml +uv.lock + +# --- generation tooling we added --- +.openapi-generator-ignore +Makefile +proc.yml + +# --- generator bookkeeping (FILES manifest + VERSION; rewritten by the +# generator but keep-listed so prune does not orphan them — the FILES +# manifest does not list itself, so it would otherwise be deleted) --- +# Only the two bookkeeping files, named individually: excluding the whole +# directory also excluded DEV-DEPENDENCIES, which the generator must write +# so this repo's package manifest can stay in step with what its tests import. +.openapi-generator/FILES +.openapi-generator/VERSION diff --git a/.openapi-generator/DEV-DEPENDENCIES b/.openapi-generator/DEV-DEPENDENCIES new file mode 100644 index 00000000..7cd3b284 --- /dev/null +++ b/.openapi-generator/DEV-DEPENDENCIES @@ -0,0 +1,13 @@ +# Every dev dependency an emitted test imports, one per line as +# ` # `. This file is +# generator-owned and rewritten on every generation. It is the contract between +# the generator and a client that keep-lists its own pyproject.toml: a +# dependency added to a generated test but missing from the client's manifest +# kills the whole suite at collection, so the test bootstrap (conftest.py) +# probes this set up front and names this file when one is missing. +pytest >=7.0.0 # every module under test/ +pytest-asyncio >=0.21.0 # asyncio_mode = "auto"; the async transport tests +pytest-cov >=4.0.0 # the --cov flags in [tool.pytest.ini_options] addopts +testcontainers >=4.0.0 # conftest.py starts the mock server and the proxy +docker >=7.0.0 # conftest.py joins both containers to a Docker network +opentelemetry-sdk >=1.20.0 # test/test_trace_context_util.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..1e587af8 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,1434 @@ +.openapi-generator/DEV-DEPENDENCIES +SKILLS.md +conftest.py +test/__init__.py +test/test_api_result.py +test/test_configuration.py +test/test_default_api_client_unit.py +test/test_header_selector.py +test/test_server_configuration.py +test/test_server_variable.py +test/test_trace_context_util.py +test/test_transport_options.py +test/test_value_serializer.py +zitadel_client/__init__.py +zitadel_client/_duration.py +zitadel_client/_types.py +zitadel_client/api/__init__.py +zitadel_client/api/action_service_api.py +zitadel_client/api/application_service_api.py +zitadel_client/api/authorization_service_api.py +zitadel_client/api/base_api.py +zitadel_client/api/beta_action_service_api.py +zitadel_client/api/beta_app_service_api.py +zitadel_client/api/beta_authorization_service_api.py +zitadel_client/api/beta_feature_service_api.py +zitadel_client/api/beta_instance_service_api.py +zitadel_client/api/beta_internal_permission_service_api.py +zitadel_client/api/beta_oidc_service_api.py +zitadel_client/api/beta_organization_service_api.py +zitadel_client/api/beta_project_service_api.py +zitadel_client/api/beta_session_service_api.py +zitadel_client/api/beta_settings_service_api.py +zitadel_client/api/beta_telemetry_service_api.py +zitadel_client/api/beta_user_service_api.py +zitadel_client/api/beta_web_key_service_api.py +zitadel_client/api/feature_service_api.py +zitadel_client/api/identity_provider_service_api.py +zitadel_client/api/instance_service_api.py +zitadel_client/api/internal_permission_service_api.py +zitadel_client/api/oidc_service_api.py +zitadel_client/api/organization_service_api.py +zitadel_client/api/project_service_api.py +zitadel_client/api/saml_service_api.py +zitadel_client/api/session_service_api.py +zitadel_client/api/settings_service_api.py +zitadel_client/api/user_service_api.py +zitadel_client/api/web_key_service_api.py +zitadel_client/api_client.py +zitadel_client/api_http_response.py +zitadel_client/api_result.py +zitadel_client/auth/__init__.py +zitadel_client/auth/authenticator.py +zitadel_client/auth/base_authenticator.py +zitadel_client/auth/bearer_authenticator.py +zitadel_client/auth/http_aware_authenticator.py +zitadel_client/auth/zitadel_access_token_authenticator.py +zitadel_client/configuration.py +zitadel_client/default_api_client.py +zitadel_client/errors/__init__.py +zitadel_client/errors/bad_request_exception.py +zitadel_client/errors/client_exception.py +zitadel_client/errors/conflict_exception.py +zitadel_client/errors/forbidden_exception.py +zitadel_client/errors/internal_server_error_exception.py +zitadel_client/errors/network_exception.py +zitadel_client/errors/network_timeout_exception.py +zitadel_client/errors/not_found_exception.py +zitadel_client/errors/oauth2_server_exception.py +zitadel_client/errors/oauth2_token_exception.py +zitadel_client/errors/serialization_exception.py +zitadel_client/errors/server_exception.py +zitadel_client/errors/unauthorized_exception.py +zitadel_client/errors/unprocessable_entity_exception.py +zitadel_client/header_selector.py +zitadel_client/models/__init__.py +zitadel_client/models/action_service_activate_public_key_request.py +zitadel_client/models/action_service_activate_public_key_response.py +zitadel_client/models/action_service_add_public_key_request.py +zitadel_client/models/action_service_add_public_key_response.py +zitadel_client/models/action_service_any.py +zitadel_client/models/action_service_condition.py +zitadel_client/models/action_service_connect_error.py +zitadel_client/models/action_service_create_target_request.py +zitadel_client/models/action_service_create_target_response.py +zitadel_client/models/action_service_deactivate_public_key_request.py +zitadel_client/models/action_service_deactivate_public_key_response.py +zitadel_client/models/action_service_delete_target_request.py +zitadel_client/models/action_service_delete_target_response.py +zitadel_client/models/action_service_event_execution.py +zitadel_client/models/action_service_execution.py +zitadel_client/models/action_service_execution_field_name.py +zitadel_client/models/action_service_execution_search_filter.py +zitadel_client/models/action_service_execution_type.py +zitadel_client/models/action_service_execution_type_filter.py +zitadel_client/models/action_service_function_execution.py +zitadel_client/models/action_service_get_target_request.py +zitadel_client/models/action_service_get_target_response.py +zitadel_client/models/action_service_in_conditions_filter.py +zitadel_client/models/action_service_in_ids_filter.py +zitadel_client/models/action_service_in_target_ids_filter.py +zitadel_client/models/action_service_list_execution_functions_response.py +zitadel_client/models/action_service_list_execution_methods_response.py +zitadel_client/models/action_service_list_execution_services_response.py +zitadel_client/models/action_service_list_executions_request.py +zitadel_client/models/action_service_list_executions_response.py +zitadel_client/models/action_service_list_public_keys_request.py +zitadel_client/models/action_service_list_public_keys_response.py +zitadel_client/models/action_service_list_targets_request.py +zitadel_client/models/action_service_list_targets_response.py +zitadel_client/models/action_service_pagination_request.py +zitadel_client/models/action_service_pagination_response.py +zitadel_client/models/action_service_payload_type.py +zitadel_client/models/action_service_public_key.py +zitadel_client/models/action_service_public_key_field_name.py +zitadel_client/models/action_service_public_key_search_filter.py +zitadel_client/models/action_service_remove_public_key_request.py +zitadel_client/models/action_service_remove_public_key_response.py +zitadel_client/models/action_service_request_execution.py +zitadel_client/models/action_service_response_execution.py +zitadel_client/models/action_service_rest_call.py +zitadel_client/models/action_service_rest_webhook.py +zitadel_client/models/action_service_set_execution_request.py +zitadel_client/models/action_service_set_execution_response.py +zitadel_client/models/action_service_target.py +zitadel_client/models/action_service_target_field_name.py +zitadel_client/models/action_service_target_filter.py +zitadel_client/models/action_service_target_name_filter.py +zitadel_client/models/action_service_target_search_filter.py +zitadel_client/models/action_service_text_filter_method.py +zitadel_client/models/action_service_timestamp_filter.py +zitadel_client/models/action_service_timestamp_filter_method.py +zitadel_client/models/action_service_update_target_request.py +zitadel_client/models/action_service_update_target_response.py +zitadel_client/models/application_service_any.py +zitadel_client/models/application_service_api_auth_method_type.py +zitadel_client/models/application_service_api_configuration.py +zitadel_client/models/application_service_application.py +zitadel_client/models/application_service_application_key.py +zitadel_client/models/application_service_application_key_application_id_filter.py +zitadel_client/models/application_service_application_key_organization_id_filter.py +zitadel_client/models/application_service_application_key_project_id_filter.py +zitadel_client/models/application_service_application_key_search_filter.py +zitadel_client/models/application_service_application_keys_sorting.py +zitadel_client/models/application_service_application_name_filter.py +zitadel_client/models/application_service_application_search_filter.py +zitadel_client/models/application_service_application_sorting.py +zitadel_client/models/application_service_application_state.py +zitadel_client/models/application_service_application_type.py +zitadel_client/models/application_service_client_id_filter.py +zitadel_client/models/application_service_connect_error.py +zitadel_client/models/application_service_create_api_application_request.py +zitadel_client/models/application_service_create_api_application_response.py +zitadel_client/models/application_service_create_application_key_request.py +zitadel_client/models/application_service_create_application_key_response.py +zitadel_client/models/application_service_create_application_request.py +zitadel_client/models/application_service_create_application_response.py +zitadel_client/models/application_service_create_oidc_application_request.py +zitadel_client/models/application_service_create_oidc_application_response.py +zitadel_client/models/application_service_create_saml_application_request.py +zitadel_client/models/application_service_deactivate_application_request.py +zitadel_client/models/application_service_deactivate_application_response.py +zitadel_client/models/application_service_delete_application_key_request.py +zitadel_client/models/application_service_delete_application_key_response.py +zitadel_client/models/application_service_delete_application_request.py +zitadel_client/models/application_service_delete_application_response.py +zitadel_client/models/application_service_entity_id_filter.py +zitadel_client/models/application_service_generate_client_secret_request.py +zitadel_client/models/application_service_generate_client_secret_response.py +zitadel_client/models/application_service_get_application_key_request.py +zitadel_client/models/application_service_get_application_key_response.py +zitadel_client/models/application_service_get_application_request.py +zitadel_client/models/application_service_get_application_response.py +zitadel_client/models/application_service_list_application_keys_request.py +zitadel_client/models/application_service_list_application_keys_response.py +zitadel_client/models/application_service_list_applications_request.py +zitadel_client/models/application_service_list_applications_response.py +zitadel_client/models/application_service_login_v2.py +zitadel_client/models/application_service_login_version.py +zitadel_client/models/application_service_oidc_application_type.py +zitadel_client/models/application_service_oidc_auth_method_type.py +zitadel_client/models/application_service_oidc_configuration.py +zitadel_client/models/application_service_oidc_grant_type.py +zitadel_client/models/application_service_oidc_localized_message.py +zitadel_client/models/application_service_oidc_response_type.py +zitadel_client/models/application_service_oidc_token_type.py +zitadel_client/models/application_service_oidc_version.py +zitadel_client/models/application_service_pagination_request.py +zitadel_client/models/application_service_pagination_response.py +zitadel_client/models/application_service_project_id_filter.py +zitadel_client/models/application_service_reactivate_application_request.py +zitadel_client/models/application_service_reactivate_application_response.py +zitadel_client/models/application_service_saml_configuration.py +zitadel_client/models/application_service_text_filter_method.py +zitadel_client/models/application_service_update_api_application_configuration_request.py +zitadel_client/models/application_service_update_application_request.py +zitadel_client/models/application_service_update_application_response.py +zitadel_client/models/application_service_update_oidc_application_configuration_request.py +zitadel_client/models/application_service_update_saml_application_configuration_request.py +zitadel_client/models/authorization_service_activate_authorization_request.py +zitadel_client/models/authorization_service_activate_authorization_response.py +zitadel_client/models/authorization_service_any.py +zitadel_client/models/authorization_service_authorization.py +zitadel_client/models/authorization_service_authorization_field_name.py +zitadel_client/models/authorization_service_authorizations_search_filter.py +zitadel_client/models/authorization_service_connect_error.py +zitadel_client/models/authorization_service_create_authorization_request.py +zitadel_client/models/authorization_service_create_authorization_response.py +zitadel_client/models/authorization_service_deactivate_authorization_request.py +zitadel_client/models/authorization_service_deactivate_authorization_response.py +zitadel_client/models/authorization_service_delete_authorization_request.py +zitadel_client/models/authorization_service_delete_authorization_response.py +zitadel_client/models/authorization_service_id_filter.py +zitadel_client/models/authorization_service_in_ids_filter.py +zitadel_client/models/authorization_service_list_authorizations_request.py +zitadel_client/models/authorization_service_list_authorizations_response.py +zitadel_client/models/authorization_service_organization.py +zitadel_client/models/authorization_service_pagination_request.py +zitadel_client/models/authorization_service_pagination_response.py +zitadel_client/models/authorization_service_project.py +zitadel_client/models/authorization_service_project_name_query.py +zitadel_client/models/authorization_service_role.py +zitadel_client/models/authorization_service_role_key_query.py +zitadel_client/models/authorization_service_state.py +zitadel_client/models/authorization_service_state_query.py +zitadel_client/models/authorization_service_text_filter_method.py +zitadel_client/models/authorization_service_update_authorization_request.py +zitadel_client/models/authorization_service_update_authorization_response.py +zitadel_client/models/authorization_service_user.py +zitadel_client/models/authorization_service_user_display_name_query.py +zitadel_client/models/authorization_service_user_preferred_login_name_query.py +zitadel_client/models/beta_action_service_any.py +zitadel_client/models/beta_action_service_condition.py +zitadel_client/models/beta_action_service_connect_error.py +zitadel_client/models/beta_action_service_create_target_request.py +zitadel_client/models/beta_action_service_create_target_response.py +zitadel_client/models/beta_action_service_delete_target_request.py +zitadel_client/models/beta_action_service_delete_target_response.py +zitadel_client/models/beta_action_service_event_execution.py +zitadel_client/models/beta_action_service_execution.py +zitadel_client/models/beta_action_service_execution_field_name.py +zitadel_client/models/beta_action_service_execution_search_filter.py +zitadel_client/models/beta_action_service_execution_type.py +zitadel_client/models/beta_action_service_execution_type_filter.py +zitadel_client/models/beta_action_service_function_execution.py +zitadel_client/models/beta_action_service_get_target_request.py +zitadel_client/models/beta_action_service_get_target_response.py +zitadel_client/models/beta_action_service_in_conditions_filter.py +zitadel_client/models/beta_action_service_in_target_ids_filter.py +zitadel_client/models/beta_action_service_list_execution_functions_response.py +zitadel_client/models/beta_action_service_list_execution_methods_response.py +zitadel_client/models/beta_action_service_list_execution_services_response.py +zitadel_client/models/beta_action_service_list_executions_request.py +zitadel_client/models/beta_action_service_list_executions_response.py +zitadel_client/models/beta_action_service_list_targets_request.py +zitadel_client/models/beta_action_service_list_targets_response.py +zitadel_client/models/beta_action_service_pagination_request.py +zitadel_client/models/beta_action_service_pagination_response.py +zitadel_client/models/beta_action_service_request_execution.py +zitadel_client/models/beta_action_service_response_execution.py +zitadel_client/models/beta_action_service_rest_call.py +zitadel_client/models/beta_action_service_rest_webhook.py +zitadel_client/models/beta_action_service_set_execution_request.py +zitadel_client/models/beta_action_service_set_execution_response.py +zitadel_client/models/beta_action_service_target.py +zitadel_client/models/beta_action_service_target_field_name.py +zitadel_client/models/beta_action_service_target_filter.py +zitadel_client/models/beta_action_service_target_name_filter.py +zitadel_client/models/beta_action_service_target_search_filter.py +zitadel_client/models/beta_action_service_text_filter_method.py +zitadel_client/models/beta_action_service_update_target_request.py +zitadel_client/models/beta_action_service_update_target_response.py +zitadel_client/models/beta_app_service_any.py +zitadel_client/models/beta_app_service_api_auth_method_type.py +zitadel_client/models/beta_app_service_api_config.py +zitadel_client/models/beta_app_service_app_sorting.py +zitadel_client/models/beta_app_service_app_state.py +zitadel_client/models/beta_app_service_application.py +zitadel_client/models/beta_app_service_application_key.py +zitadel_client/models/beta_app_service_application_keys_sorting.py +zitadel_client/models/beta_app_service_application_name_query.py +zitadel_client/models/beta_app_service_application_search_filter.py +zitadel_client/models/beta_app_service_connect_error.py +zitadel_client/models/beta_app_service_create_api_application_request.py +zitadel_client/models/beta_app_service_create_api_application_response.py +zitadel_client/models/beta_app_service_create_application_key_request.py +zitadel_client/models/beta_app_service_create_application_key_response.py +zitadel_client/models/beta_app_service_create_application_request.py +zitadel_client/models/beta_app_service_create_application_response.py +zitadel_client/models/beta_app_service_create_oidc_application_request.py +zitadel_client/models/beta_app_service_create_oidc_application_response.py +zitadel_client/models/beta_app_service_create_saml_application_request.py +zitadel_client/models/beta_app_service_deactivate_application_request.py +zitadel_client/models/beta_app_service_deactivate_application_response.py +zitadel_client/models/beta_app_service_delete_application_key_request.py +zitadel_client/models/beta_app_service_delete_application_key_response.py +zitadel_client/models/beta_app_service_delete_application_request.py +zitadel_client/models/beta_app_service_delete_application_response.py +zitadel_client/models/beta_app_service_get_application_key_request.py +zitadel_client/models/beta_app_service_get_application_key_response.py +zitadel_client/models/beta_app_service_get_application_request.py +zitadel_client/models/beta_app_service_get_application_response.py +zitadel_client/models/beta_app_service_list_application_keys_request.py +zitadel_client/models/beta_app_service_list_application_keys_response.py +zitadel_client/models/beta_app_service_list_applications_request.py +zitadel_client/models/beta_app_service_list_applications_response.py +zitadel_client/models/beta_app_service_login_v2.py +zitadel_client/models/beta_app_service_login_version.py +zitadel_client/models/beta_app_service_oidc_app_type.py +zitadel_client/models/beta_app_service_oidc_auth_method_type.py +zitadel_client/models/beta_app_service_oidc_config.py +zitadel_client/models/beta_app_service_oidc_grant_type.py +zitadel_client/models/beta_app_service_oidc_localized_message.py +zitadel_client/models/beta_app_service_oidc_response_type.py +zitadel_client/models/beta_app_service_oidc_token_type.py +zitadel_client/models/beta_app_service_oidc_version.py +zitadel_client/models/beta_app_service_pagination_request.py +zitadel_client/models/beta_app_service_pagination_response.py +zitadel_client/models/beta_app_service_reactivate_application_request.py +zitadel_client/models/beta_app_service_reactivate_application_response.py +zitadel_client/models/beta_app_service_regenerate_client_secret_request.py +zitadel_client/models/beta_app_service_regenerate_client_secret_response.py +zitadel_client/models/beta_app_service_saml_config.py +zitadel_client/models/beta_app_service_text_filter_method.py +zitadel_client/models/beta_app_service_update_api_application_configuration_request.py +zitadel_client/models/beta_app_service_update_application_request.py +zitadel_client/models/beta_app_service_update_application_response.py +zitadel_client/models/beta_app_service_update_oidc_application_configuration_request.py +zitadel_client/models/beta_app_service_update_saml_application_configuration_request.py +zitadel_client/models/beta_authorization_service_activate_authorization_request.py +zitadel_client/models/beta_authorization_service_activate_authorization_response.py +zitadel_client/models/beta_authorization_service_any.py +zitadel_client/models/beta_authorization_service_authorization.py +zitadel_client/models/beta_authorization_service_authorization_field_name.py +zitadel_client/models/beta_authorization_service_authorizations_search_filter.py +zitadel_client/models/beta_authorization_service_connect_error.py +zitadel_client/models/beta_authorization_service_create_authorization_request.py +zitadel_client/models/beta_authorization_service_create_authorization_response.py +zitadel_client/models/beta_authorization_service_deactivate_authorization_request.py +zitadel_client/models/beta_authorization_service_deactivate_authorization_response.py +zitadel_client/models/beta_authorization_service_delete_authorization_request.py +zitadel_client/models/beta_authorization_service_delete_authorization_response.py +zitadel_client/models/beta_authorization_service_id_filter.py +zitadel_client/models/beta_authorization_service_in_ids_filter.py +zitadel_client/models/beta_authorization_service_list_authorizations_request.py +zitadel_client/models/beta_authorization_service_list_authorizations_response.py +zitadel_client/models/beta_authorization_service_pagination_request.py +zitadel_client/models/beta_authorization_service_pagination_response.py +zitadel_client/models/beta_authorization_service_project_name_query.py +zitadel_client/models/beta_authorization_service_role_key_query.py +zitadel_client/models/beta_authorization_service_state.py +zitadel_client/models/beta_authorization_service_state_query.py +zitadel_client/models/beta_authorization_service_text_filter_method.py +zitadel_client/models/beta_authorization_service_update_authorization_request.py +zitadel_client/models/beta_authorization_service_update_authorization_response.py +zitadel_client/models/beta_authorization_service_user.py +zitadel_client/models/beta_authorization_service_user_display_name_query.py +zitadel_client/models/beta_authorization_service_user_preferred_login_name_query.py +zitadel_client/models/beta_feature_service_any.py +zitadel_client/models/beta_feature_service_connect_error.py +zitadel_client/models/beta_feature_service_details.py +zitadel_client/models/beta_feature_service_feature_flag.py +zitadel_client/models/beta_feature_service_get_instance_features_request.py +zitadel_client/models/beta_feature_service_get_instance_features_response.py +zitadel_client/models/beta_feature_service_get_organization_features_request.py +zitadel_client/models/beta_feature_service_get_organization_features_response.py +zitadel_client/models/beta_feature_service_get_system_features_response.py +zitadel_client/models/beta_feature_service_get_user_features_request.py +zitadel_client/models/beta_feature_service_get_user_features_response.py +zitadel_client/models/beta_feature_service_improved_performance.py +zitadel_client/models/beta_feature_service_improved_performance_feature_flag.py +zitadel_client/models/beta_feature_service_reset_instance_features_response.py +zitadel_client/models/beta_feature_service_reset_organization_features_request.py +zitadel_client/models/beta_feature_service_reset_organization_features_response.py +zitadel_client/models/beta_feature_service_reset_system_features_response.py +zitadel_client/models/beta_feature_service_reset_user_features_request.py +zitadel_client/models/beta_feature_service_reset_user_features_response.py +zitadel_client/models/beta_feature_service_set_instance_features_request.py +zitadel_client/models/beta_feature_service_set_instance_features_response.py +zitadel_client/models/beta_feature_service_set_organization_features_request.py +zitadel_client/models/beta_feature_service_set_organization_features_response.py +zitadel_client/models/beta_feature_service_set_system_features_request.py +zitadel_client/models/beta_feature_service_set_system_features_response.py +zitadel_client/models/beta_feature_service_set_user_feature_request.py +zitadel_client/models/beta_feature_service_set_user_features_response.py +zitadel_client/models/beta_feature_service_source.py +zitadel_client/models/beta_instance_service_add_custom_domain_request.py +zitadel_client/models/beta_instance_service_add_custom_domain_response.py +zitadel_client/models/beta_instance_service_add_trusted_domain_request.py +zitadel_client/models/beta_instance_service_add_trusted_domain_response.py +zitadel_client/models/beta_instance_service_any.py +zitadel_client/models/beta_instance_service_connect_error.py +zitadel_client/models/beta_instance_service_delete_instance_request.py +zitadel_client/models/beta_instance_service_delete_instance_response.py +zitadel_client/models/beta_instance_service_domain.py +zitadel_client/models/beta_instance_service_domain_field_name.py +zitadel_client/models/beta_instance_service_domain_generated_query.py +zitadel_client/models/beta_instance_service_domain_primary_query.py +zitadel_client/models/beta_instance_service_domain_query.py +zitadel_client/models/beta_instance_service_domain_search_query.py +zitadel_client/models/beta_instance_service_domains_query.py +zitadel_client/models/beta_instance_service_field_name.py +zitadel_client/models/beta_instance_service_get_instance_request.py +zitadel_client/models/beta_instance_service_get_instance_response.py +zitadel_client/models/beta_instance_service_ids_query.py +zitadel_client/models/beta_instance_service_instance.py +zitadel_client/models/beta_instance_service_list_custom_domains_request.py +zitadel_client/models/beta_instance_service_list_custom_domains_response.py +zitadel_client/models/beta_instance_service_list_instances_request.py +zitadel_client/models/beta_instance_service_list_instances_response.py +zitadel_client/models/beta_instance_service_list_trusted_domains_request.py +zitadel_client/models/beta_instance_service_list_trusted_domains_response.py +zitadel_client/models/beta_instance_service_pagination_request.py +zitadel_client/models/beta_instance_service_pagination_response.py +zitadel_client/models/beta_instance_service_query.py +zitadel_client/models/beta_instance_service_remove_custom_domain_request.py +zitadel_client/models/beta_instance_service_remove_custom_domain_response.py +zitadel_client/models/beta_instance_service_remove_trusted_domain_request.py +zitadel_client/models/beta_instance_service_remove_trusted_domain_response.py +zitadel_client/models/beta_instance_service_state.py +zitadel_client/models/beta_instance_service_text_query_method.py +zitadel_client/models/beta_instance_service_trusted_domain.py +zitadel_client/models/beta_instance_service_trusted_domain_field_name.py +zitadel_client/models/beta_instance_service_trusted_domain_search_query.py +zitadel_client/models/beta_instance_service_update_instance_request.py +zitadel_client/models/beta_instance_service_update_instance_response.py +zitadel_client/models/beta_internal_permission_service_administrator.py +zitadel_client/models/beta_internal_permission_service_administrator_field_name.py +zitadel_client/models/beta_internal_permission_service_administrator_search_filter.py +zitadel_client/models/beta_internal_permission_service_and_filter.py +zitadel_client/models/beta_internal_permission_service_any.py +zitadel_client/models/beta_internal_permission_service_connect_error.py +zitadel_client/models/beta_internal_permission_service_create_administrator_request.py +zitadel_client/models/beta_internal_permission_service_create_administrator_response.py +zitadel_client/models/beta_internal_permission_service_delete_administrator_request.py +zitadel_client/models/beta_internal_permission_service_delete_administrator_response.py +zitadel_client/models/beta_internal_permission_service_id_filter.py +zitadel_client/models/beta_internal_permission_service_in_ids_filter.py +zitadel_client/models/beta_internal_permission_service_list_administrators_request.py +zitadel_client/models/beta_internal_permission_service_list_administrators_response.py +zitadel_client/models/beta_internal_permission_service_not_filter.py +zitadel_client/models/beta_internal_permission_service_or_filter.py +zitadel_client/models/beta_internal_permission_service_organization.py +zitadel_client/models/beta_internal_permission_service_pagination_request.py +zitadel_client/models/beta_internal_permission_service_pagination_response.py +zitadel_client/models/beta_internal_permission_service_project.py +zitadel_client/models/beta_internal_permission_service_project_grant.py +zitadel_client/models/beta_internal_permission_service_resource_filter.py +zitadel_client/models/beta_internal_permission_service_resource_type.py +zitadel_client/models/beta_internal_permission_service_role_filter.py +zitadel_client/models/beta_internal_permission_service_text_filter_method.py +zitadel_client/models/beta_internal_permission_service_timestamp_filter.py +zitadel_client/models/beta_internal_permission_service_timestamp_filter_method.py +zitadel_client/models/beta_internal_permission_service_update_administrator_request.py +zitadel_client/models/beta_internal_permission_service_update_administrator_response.py +zitadel_client/models/beta_internal_permission_service_user.py +zitadel_client/models/beta_internal_permission_service_user_display_name_filter.py +zitadel_client/models/beta_internal_permission_service_user_preferred_login_name_filter.py +zitadel_client/models/beta_oidc_service_any.py +zitadel_client/models/beta_oidc_service_auth_request.py +zitadel_client/models/beta_oidc_service_authorization_error.py +zitadel_client/models/beta_oidc_service_connect_error.py +zitadel_client/models/beta_oidc_service_create_callback_request.py +zitadel_client/models/beta_oidc_service_create_callback_response.py +zitadel_client/models/beta_oidc_service_details.py +zitadel_client/models/beta_oidc_service_error_reason.py +zitadel_client/models/beta_oidc_service_get_auth_request_request.py +zitadel_client/models/beta_oidc_service_get_auth_request_response.py +zitadel_client/models/beta_oidc_service_prompt.py +zitadel_client/models/beta_oidc_service_session.py +zitadel_client/models/beta_organization_service_activate_organization_request.py +zitadel_client/models/beta_organization_service_activate_organization_response.py +zitadel_client/models/beta_organization_service_add_human_user_request.py +zitadel_client/models/beta_organization_service_add_organization_domain_request.py +zitadel_client/models/beta_organization_service_add_organization_domain_response.py +zitadel_client/models/beta_organization_service_admin.py +zitadel_client/models/beta_organization_service_any.py +zitadel_client/models/beta_organization_service_assigned_admin.py +zitadel_client/models/beta_organization_service_connect_error.py +zitadel_client/models/beta_organization_service_create_organization_request.py +zitadel_client/models/beta_organization_service_create_organization_response.py +zitadel_client/models/beta_organization_service_created_admin.py +zitadel_client/models/beta_organization_service_deactivate_organization_request.py +zitadel_client/models/beta_organization_service_deactivate_organization_response.py +zitadel_client/models/beta_organization_service_delete_organization_domain_request.py +zitadel_client/models/beta_organization_service_delete_organization_domain_response.py +zitadel_client/models/beta_organization_service_delete_organization_metadata_request.py +zitadel_client/models/beta_organization_service_delete_organization_metadata_response.py +zitadel_client/models/beta_organization_service_delete_organization_request.py +zitadel_client/models/beta_organization_service_delete_organization_response.py +zitadel_client/models/beta_organization_service_domain.py +zitadel_client/models/beta_organization_service_domain_name_filter.py +zitadel_client/models/beta_organization_service_domain_search_filter.py +zitadel_client/models/beta_organization_service_domain_validation_type.py +zitadel_client/models/beta_organization_service_gender.py +zitadel_client/models/beta_organization_service_generate_organization_domain_validation_request.py +zitadel_client/models/beta_organization_service_generate_organization_domain_validation_response.py +zitadel_client/models/beta_organization_service_hashed_password.py +zitadel_client/models/beta_organization_service_idp_link.py +zitadel_client/models/beta_organization_service_list_organization_domains_request.py +zitadel_client/models/beta_organization_service_list_organization_domains_response.py +zitadel_client/models/beta_organization_service_list_organization_metadata_request.py +zitadel_client/models/beta_organization_service_list_organization_metadata_response.py +zitadel_client/models/beta_organization_service_list_organizations_request.py +zitadel_client/models/beta_organization_service_list_organizations_response.py +zitadel_client/models/beta_organization_service_metadata.py +zitadel_client/models/beta_organization_service_metadata_key_query.py +zitadel_client/models/beta_organization_service_metadata_query.py +zitadel_client/models/beta_organization_service_org_domain_filter.py +zitadel_client/models/beta_organization_service_org_field_name.py +zitadel_client/models/beta_organization_service_org_id_filter.py +zitadel_client/models/beta_organization_service_org_name_filter.py +zitadel_client/models/beta_organization_service_org_state.py +zitadel_client/models/beta_organization_service_org_state_filter.py +zitadel_client/models/beta_organization_service_organization.py +zitadel_client/models/beta_organization_service_organization_admin.py +zitadel_client/models/beta_organization_service_organization_search_filter.py +zitadel_client/models/beta_organization_service_pagination_request.py +zitadel_client/models/beta_organization_service_pagination_response.py +zitadel_client/models/beta_organization_service_password.py +zitadel_client/models/beta_organization_service_send_email_verification_code.py +zitadel_client/models/beta_organization_service_set_human_email.py +zitadel_client/models/beta_organization_service_set_human_phone.py +zitadel_client/models/beta_organization_service_set_human_profile.py +zitadel_client/models/beta_organization_service_set_metadata_entry.py +zitadel_client/models/beta_organization_service_set_organization_metadata_request.py +zitadel_client/models/beta_organization_service_set_organization_metadata_response.py +zitadel_client/models/beta_organization_service_text_query_method.py +zitadel_client/models/beta_organization_service_update_organization_request.py +zitadel_client/models/beta_organization_service_update_organization_response.py +zitadel_client/models/beta_organization_service_verify_organization_domain_request.py +zitadel_client/models/beta_organization_service_verify_organization_domain_response.py +zitadel_client/models/beta_project_service_activate_project_grant_request.py +zitadel_client/models/beta_project_service_activate_project_grant_response.py +zitadel_client/models/beta_project_service_activate_project_request.py +zitadel_client/models/beta_project_service_activate_project_response.py +zitadel_client/models/beta_project_service_add_project_role_request.py +zitadel_client/models/beta_project_service_add_project_role_response.py +zitadel_client/models/beta_project_service_admin.py +zitadel_client/models/beta_project_service_any.py +zitadel_client/models/beta_project_service_connect_error.py +zitadel_client/models/beta_project_service_create_project_grant_request.py +zitadel_client/models/beta_project_service_create_project_grant_response.py +zitadel_client/models/beta_project_service_create_project_request.py +zitadel_client/models/beta_project_service_create_project_response.py +zitadel_client/models/beta_project_service_deactivate_project_grant_request.py +zitadel_client/models/beta_project_service_deactivate_project_grant_response.py +zitadel_client/models/beta_project_service_deactivate_project_request.py +zitadel_client/models/beta_project_service_deactivate_project_response.py +zitadel_client/models/beta_project_service_delete_project_grant_request.py +zitadel_client/models/beta_project_service_delete_project_grant_response.py +zitadel_client/models/beta_project_service_delete_project_request.py +zitadel_client/models/beta_project_service_delete_project_response.py +zitadel_client/models/beta_project_service_get_project_request.py +zitadel_client/models/beta_project_service_get_project_response.py +zitadel_client/models/beta_project_service_granted_project_state.py +zitadel_client/models/beta_project_service_id_filter.py +zitadel_client/models/beta_project_service_in_ids_filter.py +zitadel_client/models/beta_project_service_list_project_grants_request.py +zitadel_client/models/beta_project_service_list_project_grants_response.py +zitadel_client/models/beta_project_service_list_project_roles_request.py +zitadel_client/models/beta_project_service_list_project_roles_response.py +zitadel_client/models/beta_project_service_list_projects_request.py +zitadel_client/models/beta_project_service_list_projects_response.py +zitadel_client/models/beta_project_service_pagination_request.py +zitadel_client/models/beta_project_service_pagination_response.py +zitadel_client/models/beta_project_service_private_labeling_setting.py +zitadel_client/models/beta_project_service_project.py +zitadel_client/models/beta_project_service_project_field_name.py +zitadel_client/models/beta_project_service_project_grant.py +zitadel_client/models/beta_project_service_project_grant_field_name.py +zitadel_client/models/beta_project_service_project_grant_search_filter.py +zitadel_client/models/beta_project_service_project_grant_state.py +zitadel_client/models/beta_project_service_project_name_filter.py +zitadel_client/models/beta_project_service_project_role.py +zitadel_client/models/beta_project_service_project_role_display_name_filter.py +zitadel_client/models/beta_project_service_project_role_field_name.py +zitadel_client/models/beta_project_service_project_role_key_filter.py +zitadel_client/models/beta_project_service_project_role_search_filter.py +zitadel_client/models/beta_project_service_project_search_filter.py +zitadel_client/models/beta_project_service_project_state.py +zitadel_client/models/beta_project_service_remove_project_role_request.py +zitadel_client/models/beta_project_service_remove_project_role_response.py +zitadel_client/models/beta_project_service_text_filter_method.py +zitadel_client/models/beta_project_service_update_project_grant_request.py +zitadel_client/models/beta_project_service_update_project_grant_response.py +zitadel_client/models/beta_project_service_update_project_request.py +zitadel_client/models/beta_project_service_update_project_response.py +zitadel_client/models/beta_project_service_update_project_role_request.py +zitadel_client/models/beta_project_service_update_project_role_response.py +zitadel_client/models/beta_session_service_any.py +zitadel_client/models/beta_session_service_challenges.py +zitadel_client/models/beta_session_service_check_idp_intent.py +zitadel_client/models/beta_session_service_check_otp.py +zitadel_client/models/beta_session_service_check_password.py +zitadel_client/models/beta_session_service_check_totp.py +zitadel_client/models/beta_session_service_check_user.py +zitadel_client/models/beta_session_service_check_web_auth_n.py +zitadel_client/models/beta_session_service_checks.py +zitadel_client/models/beta_session_service_connect_error.py +zitadel_client/models/beta_session_service_create_session_request.py +zitadel_client/models/beta_session_service_create_session_response.py +zitadel_client/models/beta_session_service_creation_date_query.py +zitadel_client/models/beta_session_service_delete_session_request.py +zitadel_client/models/beta_session_service_delete_session_response.py +zitadel_client/models/beta_session_service_details.py +zitadel_client/models/beta_session_service_factors.py +zitadel_client/models/beta_session_service_get_session_request.py +zitadel_client/models/beta_session_service_get_session_response.py +zitadel_client/models/beta_session_service_header_values.py +zitadel_client/models/beta_session_service_ids_query.py +zitadel_client/models/beta_session_service_intent_factor.py +zitadel_client/models/beta_session_service_list_details.py +zitadel_client/models/beta_session_service_list_query.py +zitadel_client/models/beta_session_service_list_sessions_request.py +zitadel_client/models/beta_session_service_list_sessions_response.py +zitadel_client/models/beta_session_service_otp_email.py +zitadel_client/models/beta_session_service_otp_factor.py +zitadel_client/models/beta_session_service_otpsms.py +zitadel_client/models/beta_session_service_password_factor.py +zitadel_client/models/beta_session_service_request_challenges.py +zitadel_client/models/beta_session_service_search_query.py +zitadel_client/models/beta_session_service_send_code.py +zitadel_client/models/beta_session_service_session.py +zitadel_client/models/beta_session_service_session_field_name.py +zitadel_client/models/beta_session_service_set_session_request.py +zitadel_client/models/beta_session_service_set_session_response.py +zitadel_client/models/beta_session_service_timestamp_query_method.py +zitadel_client/models/beta_session_service_totp_factor.py +zitadel_client/models/beta_session_service_user_agent.py +zitadel_client/models/beta_session_service_user_factor.py +zitadel_client/models/beta_session_service_user_id_query.py +zitadel_client/models/beta_session_service_user_verification_requirement.py +zitadel_client/models/beta_session_service_web_auth_n.py +zitadel_client/models/beta_session_service_web_auth_n_factor.py +zitadel_client/models/beta_settings_service_any.py +zitadel_client/models/beta_settings_service_branding_settings.py +zitadel_client/models/beta_settings_service_connect_error.py +zitadel_client/models/beta_settings_service_details.py +zitadel_client/models/beta_settings_service_domain_settings.py +zitadel_client/models/beta_settings_service_embedded_iframe_settings.py +zitadel_client/models/beta_settings_service_get_active_identity_providers_request.py +zitadel_client/models/beta_settings_service_get_active_identity_providers_response.py +zitadel_client/models/beta_settings_service_get_branding_settings_request.py +zitadel_client/models/beta_settings_service_get_branding_settings_response.py +zitadel_client/models/beta_settings_service_get_domain_settings_request.py +zitadel_client/models/beta_settings_service_get_domain_settings_response.py +zitadel_client/models/beta_settings_service_get_general_settings_response.py +zitadel_client/models/beta_settings_service_get_legal_and_support_settings_request.py +zitadel_client/models/beta_settings_service_get_legal_and_support_settings_response.py +zitadel_client/models/beta_settings_service_get_lockout_settings_request.py +zitadel_client/models/beta_settings_service_get_lockout_settings_response.py +zitadel_client/models/beta_settings_service_get_login_settings_request.py +zitadel_client/models/beta_settings_service_get_login_settings_response.py +zitadel_client/models/beta_settings_service_get_password_complexity_settings_request.py +zitadel_client/models/beta_settings_service_get_password_complexity_settings_response.py +zitadel_client/models/beta_settings_service_get_password_expiry_settings_request.py +zitadel_client/models/beta_settings_service_get_password_expiry_settings_response.py +zitadel_client/models/beta_settings_service_get_security_settings_response.py +zitadel_client/models/beta_settings_service_identity_provider.py +zitadel_client/models/beta_settings_service_identity_provider_type.py +zitadel_client/models/beta_settings_service_legal_and_support_settings.py +zitadel_client/models/beta_settings_service_list_details.py +zitadel_client/models/beta_settings_service_lockout_settings.py +zitadel_client/models/beta_settings_service_login_settings.py +zitadel_client/models/beta_settings_service_multi_factor_type.py +zitadel_client/models/beta_settings_service_passkeys_type.py +zitadel_client/models/beta_settings_service_password_complexity_settings.py +zitadel_client/models/beta_settings_service_password_expiry_settings.py +zitadel_client/models/beta_settings_service_request_context.py +zitadel_client/models/beta_settings_service_resource_owner_type.py +zitadel_client/models/beta_settings_service_second_factor_type.py +zitadel_client/models/beta_settings_service_security_settings.py +zitadel_client/models/beta_settings_service_set_security_settings_request.py +zitadel_client/models/beta_settings_service_set_security_settings_response.py +zitadel_client/models/beta_settings_service_theme.py +zitadel_client/models/beta_settings_service_theme_mode.py +zitadel_client/models/beta_telemetry_service_any.py +zitadel_client/models/beta_telemetry_service_connect_error.py +zitadel_client/models/beta_telemetry_service_count_parent_type.py +zitadel_client/models/beta_telemetry_service_instance_information.py +zitadel_client/models/beta_telemetry_service_report_base_information_request.py +zitadel_client/models/beta_telemetry_service_report_base_information_response.py +zitadel_client/models/beta_telemetry_service_report_resource_counts_request.py +zitadel_client/models/beta_telemetry_service_report_resource_counts_response.py +zitadel_client/models/beta_telemetry_service_resource_count.py +zitadel_client/models/beta_user_service_access_token_type.py +zitadel_client/models/beta_user_service_add_human_user_request.py +zitadel_client/models/beta_user_service_add_human_user_response.py +zitadel_client/models/beta_user_service_add_idp_link_request.py +zitadel_client/models/beta_user_service_add_idp_link_response.py +zitadel_client/models/beta_user_service_add_otp_email_request.py +zitadel_client/models/beta_user_service_add_otp_email_response.py +zitadel_client/models/beta_user_service_add_otpsms_request.py +zitadel_client/models/beta_user_service_add_otpsms_response.py +zitadel_client/models/beta_user_service_and_query.py +zitadel_client/models/beta_user_service_any.py +zitadel_client/models/beta_user_service_authentication_method_type.py +zitadel_client/models/beta_user_service_connect_error.py +zitadel_client/models/beta_user_service_create_passkey_registration_link_request.py +zitadel_client/models/beta_user_service_create_passkey_registration_link_response.py +zitadel_client/models/beta_user_service_deactivate_user_request.py +zitadel_client/models/beta_user_service_deactivate_user_response.py +zitadel_client/models/beta_user_service_delete_user_request.py +zitadel_client/models/beta_user_service_delete_user_response.py +zitadel_client/models/beta_user_service_details.py +zitadel_client/models/beta_user_service_display_name_query.py +zitadel_client/models/beta_user_service_email_query.py +zitadel_client/models/beta_user_service_first_name_query.py +zitadel_client/models/beta_user_service_form_data.py +zitadel_client/models/beta_user_service_gender.py +zitadel_client/models/beta_user_service_get_user_by_id_request.py +zitadel_client/models/beta_user_service_get_user_by_id_response.py +zitadel_client/models/beta_user_service_hashed_password.py +zitadel_client/models/beta_user_service_human_email.py +zitadel_client/models/beta_user_service_human_phone.py +zitadel_client/models/beta_user_service_human_profile.py +zitadel_client/models/beta_user_service_human_user.py +zitadel_client/models/beta_user_service_idp_information.py +zitadel_client/models/beta_user_service_idp_intent.py +zitadel_client/models/beta_user_service_idp_link.py +zitadel_client/models/beta_user_service_idpldap_access_information.py +zitadel_client/models/beta_user_service_idpo_auth_access_information.py +zitadel_client/models/beta_user_service_idpsaml_access_information.py +zitadel_client/models/beta_user_service_in_user_emails_query.py +zitadel_client/models/beta_user_service_in_user_id_query.py +zitadel_client/models/beta_user_service_last_name_query.py +zitadel_client/models/beta_user_service_ldap_credentials.py +zitadel_client/models/beta_user_service_list_authentication_method_types_request.py +zitadel_client/models/beta_user_service_list_authentication_method_types_response.py +zitadel_client/models/beta_user_service_list_details.py +zitadel_client/models/beta_user_service_list_query.py +zitadel_client/models/beta_user_service_list_users_request.py +zitadel_client/models/beta_user_service_list_users_response.py +zitadel_client/models/beta_user_service_lock_user_request.py +zitadel_client/models/beta_user_service_lock_user_response.py +zitadel_client/models/beta_user_service_login_name_query.py +zitadel_client/models/beta_user_service_machine_user.py +zitadel_client/models/beta_user_service_nick_name_query.py +zitadel_client/models/beta_user_service_not_query.py +zitadel_client/models/beta_user_service_notification_type.py +zitadel_client/models/beta_user_service_or_query.py +zitadel_client/models/beta_user_service_organization.py +zitadel_client/models/beta_user_service_organization_id_query.py +zitadel_client/models/beta_user_service_passkey_authenticator.py +zitadel_client/models/beta_user_service_passkey_registration_code.py +zitadel_client/models/beta_user_service_password.py +zitadel_client/models/beta_user_service_password_reset_request.py +zitadel_client/models/beta_user_service_password_reset_response.py +zitadel_client/models/beta_user_service_phone_query.py +zitadel_client/models/beta_user_service_reactivate_user_request.py +zitadel_client/models/beta_user_service_reactivate_user_response.py +zitadel_client/models/beta_user_service_redirect_urls.py +zitadel_client/models/beta_user_service_register_passkey_request.py +zitadel_client/models/beta_user_service_register_passkey_response.py +zitadel_client/models/beta_user_service_register_totp_request.py +zitadel_client/models/beta_user_service_register_totp_response.py +zitadel_client/models/beta_user_service_register_u2_f_request.py +zitadel_client/models/beta_user_service_register_u2_f_response.py +zitadel_client/models/beta_user_service_remove_otp_email_request.py +zitadel_client/models/beta_user_service_remove_otp_email_response.py +zitadel_client/models/beta_user_service_remove_otpsms_request.py +zitadel_client/models/beta_user_service_remove_otpsms_response.py +zitadel_client/models/beta_user_service_remove_phone_request.py +zitadel_client/models/beta_user_service_remove_phone_response.py +zitadel_client/models/beta_user_service_remove_totp_request.py +zitadel_client/models/beta_user_service_remove_totp_response.py +zitadel_client/models/beta_user_service_resend_email_code_request.py +zitadel_client/models/beta_user_service_resend_email_code_response.py +zitadel_client/models/beta_user_service_resend_phone_code_request.py +zitadel_client/models/beta_user_service_resend_phone_code_response.py +zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_request.py +zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_response.py +zitadel_client/models/beta_user_service_search_query.py +zitadel_client/models/beta_user_service_send_email_verification_code.py +zitadel_client/models/beta_user_service_send_passkey_registration_link.py +zitadel_client/models/beta_user_service_send_password_reset_link.py +zitadel_client/models/beta_user_service_set_email_request.py +zitadel_client/models/beta_user_service_set_email_response.py +zitadel_client/models/beta_user_service_set_human_email.py +zitadel_client/models/beta_user_service_set_human_phone.py +zitadel_client/models/beta_user_service_set_human_profile.py +zitadel_client/models/beta_user_service_set_metadata_entry.py +zitadel_client/models/beta_user_service_set_password.py +zitadel_client/models/beta_user_service_set_password_request.py +zitadel_client/models/beta_user_service_set_password_response.py +zitadel_client/models/beta_user_service_set_phone_request.py +zitadel_client/models/beta_user_service_set_phone_response.py +zitadel_client/models/beta_user_service_start_identity_provider_intent_request.py +zitadel_client/models/beta_user_service_start_identity_provider_intent_response.py +zitadel_client/models/beta_user_service_state_query.py +zitadel_client/models/beta_user_service_text_query_method.py +zitadel_client/models/beta_user_service_type.py +zitadel_client/models/beta_user_service_type_query.py +zitadel_client/models/beta_user_service_unlock_user_request.py +zitadel_client/models/beta_user_service_unlock_user_response.py +zitadel_client/models/beta_user_service_update_human_user_request.py +zitadel_client/models/beta_user_service_update_human_user_response.py +zitadel_client/models/beta_user_service_user.py +zitadel_client/models/beta_user_service_user_field_name.py +zitadel_client/models/beta_user_service_user_name_query.py +zitadel_client/models/beta_user_service_user_state.py +zitadel_client/models/beta_user_service_verify_email_request.py +zitadel_client/models/beta_user_service_verify_email_response.py +zitadel_client/models/beta_user_service_verify_passkey_registration_request.py +zitadel_client/models/beta_user_service_verify_passkey_registration_response.py +zitadel_client/models/beta_user_service_verify_phone_request.py +zitadel_client/models/beta_user_service_verify_phone_response.py +zitadel_client/models/beta_user_service_verify_totp_registration_request.py +zitadel_client/models/beta_user_service_verify_totp_registration_response.py +zitadel_client/models/beta_user_service_verify_u2_f_registration_request.py +zitadel_client/models/beta_user_service_verify_u2_f_registration_response.py +zitadel_client/models/beta_web_key_service_activate_web_key_request.py +zitadel_client/models/beta_web_key_service_activate_web_key_response.py +zitadel_client/models/beta_web_key_service_any.py +zitadel_client/models/beta_web_key_service_connect_error.py +zitadel_client/models/beta_web_key_service_create_web_key_request.py +zitadel_client/models/beta_web_key_service_create_web_key_response.py +zitadel_client/models/beta_web_key_service_delete_web_key_request.py +zitadel_client/models/beta_web_key_service_delete_web_key_response.py +zitadel_client/models/beta_web_key_service_ecdsa.py +zitadel_client/models/beta_web_key_service_ecdsa_curve.py +zitadel_client/models/beta_web_key_service_list_web_keys_response.py +zitadel_client/models/beta_web_key_service_rsa.py +zitadel_client/models/beta_web_key_service_rsa_bits.py +zitadel_client/models/beta_web_key_service_rsa_hasher.py +zitadel_client/models/beta_web_key_service_state.py +zitadel_client/models/beta_web_key_service_web_key.py +zitadel_client/models/feature_service_any.py +zitadel_client/models/feature_service_connect_error.py +zitadel_client/models/feature_service_details.py +zitadel_client/models/feature_service_feature_flag.py +zitadel_client/models/feature_service_get_instance_features_request.py +zitadel_client/models/feature_service_get_instance_features_response.py +zitadel_client/models/feature_service_get_organization_features_request.py +zitadel_client/models/feature_service_get_organization_features_response.py +zitadel_client/models/feature_service_get_system_features_response.py +zitadel_client/models/feature_service_get_user_features_request.py +zitadel_client/models/feature_service_get_user_features_response.py +zitadel_client/models/feature_service_improved_performance.py +zitadel_client/models/feature_service_improved_performance_feature_flag.py +zitadel_client/models/feature_service_login_v2.py +zitadel_client/models/feature_service_login_v2_feature_flag.py +zitadel_client/models/feature_service_reset_instance_features_response.py +zitadel_client/models/feature_service_reset_organization_features_request.py +zitadel_client/models/feature_service_reset_organization_features_response.py +zitadel_client/models/feature_service_reset_system_features_response.py +zitadel_client/models/feature_service_reset_user_features_request.py +zitadel_client/models/feature_service_reset_user_features_response.py +zitadel_client/models/feature_service_set_instance_features_request.py +zitadel_client/models/feature_service_set_instance_features_response.py +zitadel_client/models/feature_service_set_organization_features_request.py +zitadel_client/models/feature_service_set_organization_features_response.py +zitadel_client/models/feature_service_set_system_features_request.py +zitadel_client/models/feature_service_set_system_features_response.py +zitadel_client/models/feature_service_set_user_feature_request.py +zitadel_client/models/feature_service_set_user_features_response.py +zitadel_client/models/feature_service_source.py +zitadel_client/models/identity_provider_service_any.py +zitadel_client/models/identity_provider_service_apple_config.py +zitadel_client/models/identity_provider_service_auto_linking_option.py +zitadel_client/models/identity_provider_service_azure_ad_config.py +zitadel_client/models/identity_provider_service_azure_ad_tenant.py +zitadel_client/models/identity_provider_service_azure_ad_tenant_type.py +zitadel_client/models/identity_provider_service_connect_error.py +zitadel_client/models/identity_provider_service_details.py +zitadel_client/models/identity_provider_service_generic_oidc_config.py +zitadel_client/models/identity_provider_service_get_idpby_id_request.py +zitadel_client/models/identity_provider_service_get_idpby_id_response.py +zitadel_client/models/identity_provider_service_git_hub_config.py +zitadel_client/models/identity_provider_service_git_hub_enterprise_server_config.py +zitadel_client/models/identity_provider_service_git_lab_config.py +zitadel_client/models/identity_provider_service_git_lab_self_hosted_config.py +zitadel_client/models/identity_provider_service_google_config.py +zitadel_client/models/identity_provider_service_idp.py +zitadel_client/models/identity_provider_service_idp_config.py +zitadel_client/models/identity_provider_service_idp_state.py +zitadel_client/models/identity_provider_service_idp_type.py +zitadel_client/models/identity_provider_service_jwt_config.py +zitadel_client/models/identity_provider_service_ldap_attributes.py +zitadel_client/models/identity_provider_service_ldap_config.py +zitadel_client/models/identity_provider_service_o_auth_config.py +zitadel_client/models/identity_provider_service_options.py +zitadel_client/models/identity_provider_service_saml_binding.py +zitadel_client/models/identity_provider_service_saml_config.py +zitadel_client/models/identity_provider_service_saml_name_id_format.py +zitadel_client/models/identity_provider_service_saml_signature_algorithm.py +zitadel_client/models/instance_service_add_custom_domain_request.py +zitadel_client/models/instance_service_add_custom_domain_response.py +zitadel_client/models/instance_service_add_trusted_domain_request.py +zitadel_client/models/instance_service_add_trusted_domain_response.py +zitadel_client/models/instance_service_any.py +zitadel_client/models/instance_service_connect_error.py +zitadel_client/models/instance_service_custom_domain.py +zitadel_client/models/instance_service_custom_domain_filter.py +zitadel_client/models/instance_service_custom_domains_filter.py +zitadel_client/models/instance_service_delete_instance_request.py +zitadel_client/models/instance_service_delete_instance_response.py +zitadel_client/models/instance_service_domain_field_name.py +zitadel_client/models/instance_service_domain_filter.py +zitadel_client/models/instance_service_field_name.py +zitadel_client/models/instance_service_filter.py +zitadel_client/models/instance_service_get_instance_request.py +zitadel_client/models/instance_service_get_instance_response.py +zitadel_client/models/instance_service_in_ids_filter.py +zitadel_client/models/instance_service_instance.py +zitadel_client/models/instance_service_list_custom_domains_request.py +zitadel_client/models/instance_service_list_custom_domains_response.py +zitadel_client/models/instance_service_list_instances_request.py +zitadel_client/models/instance_service_list_instances_response.py +zitadel_client/models/instance_service_list_trusted_domains_request.py +zitadel_client/models/instance_service_list_trusted_domains_response.py +zitadel_client/models/instance_service_pagination_request.py +zitadel_client/models/instance_service_pagination_response.py +zitadel_client/models/instance_service_remove_custom_domain_request.py +zitadel_client/models/instance_service_remove_custom_domain_response.py +zitadel_client/models/instance_service_remove_trusted_domain_request.py +zitadel_client/models/instance_service_remove_trusted_domain_response.py +zitadel_client/models/instance_service_state.py +zitadel_client/models/instance_service_text_query_method.py +zitadel_client/models/instance_service_trusted_domain.py +zitadel_client/models/instance_service_trusted_domain_field_name.py +zitadel_client/models/instance_service_trusted_domain_filter.py +zitadel_client/models/instance_service_update_instance_request.py +zitadel_client/models/instance_service_update_instance_response.py +zitadel_client/models/internal_permission_service_administrator.py +zitadel_client/models/internal_permission_service_administrator_field_name.py +zitadel_client/models/internal_permission_service_administrator_search_filter.py +zitadel_client/models/internal_permission_service_and_filter.py +zitadel_client/models/internal_permission_service_any.py +zitadel_client/models/internal_permission_service_connect_error.py +zitadel_client/models/internal_permission_service_create_administrator_request.py +zitadel_client/models/internal_permission_service_create_administrator_response.py +zitadel_client/models/internal_permission_service_delete_administrator_request.py +zitadel_client/models/internal_permission_service_delete_administrator_response.py +zitadel_client/models/internal_permission_service_id_filter.py +zitadel_client/models/internal_permission_service_in_ids_filter.py +zitadel_client/models/internal_permission_service_list_administrators_request.py +zitadel_client/models/internal_permission_service_list_administrators_response.py +zitadel_client/models/internal_permission_service_not_filter.py +zitadel_client/models/internal_permission_service_or_filter.py +zitadel_client/models/internal_permission_service_organization.py +zitadel_client/models/internal_permission_service_pagination_request.py +zitadel_client/models/internal_permission_service_pagination_response.py +zitadel_client/models/internal_permission_service_project.py +zitadel_client/models/internal_permission_service_project_grant.py +zitadel_client/models/internal_permission_service_resource_filter.py +zitadel_client/models/internal_permission_service_resource_type.py +zitadel_client/models/internal_permission_service_role_filter.py +zitadel_client/models/internal_permission_service_text_filter_method.py +zitadel_client/models/internal_permission_service_timestamp_filter.py +zitadel_client/models/internal_permission_service_timestamp_filter_method.py +zitadel_client/models/internal_permission_service_update_administrator_request.py +zitadel_client/models/internal_permission_service_update_administrator_response.py +zitadel_client/models/internal_permission_service_user.py +zitadel_client/models/internal_permission_service_user_display_name_filter.py +zitadel_client/models/internal_permission_service_user_preferred_login_name_filter.py +zitadel_client/models/oidc_service_any.py +zitadel_client/models/oidc_service_auth_request.py +zitadel_client/models/oidc_service_authorization_error.py +zitadel_client/models/oidc_service_authorize_or_deny_device_authorization_request.py +zitadel_client/models/oidc_service_connect_error.py +zitadel_client/models/oidc_service_create_callback_request.py +zitadel_client/models/oidc_service_create_callback_response.py +zitadel_client/models/oidc_service_details.py +zitadel_client/models/oidc_service_device_authorization_request.py +zitadel_client/models/oidc_service_error_reason.py +zitadel_client/models/oidc_service_get_auth_request_request.py +zitadel_client/models/oidc_service_get_auth_request_response.py +zitadel_client/models/oidc_service_get_device_authorization_request_request.py +zitadel_client/models/oidc_service_get_device_authorization_request_response.py +zitadel_client/models/oidc_service_prompt.py +zitadel_client/models/oidc_service_session.py +zitadel_client/models/organization_service_activate_organization_request.py +zitadel_client/models/organization_service_activate_organization_response.py +zitadel_client/models/organization_service_add_human_user_request.py +zitadel_client/models/organization_service_add_organization_domain_request.py +zitadel_client/models/organization_service_add_organization_domain_response.py +zitadel_client/models/organization_service_add_organization_request.py +zitadel_client/models/organization_service_add_organization_response.py +zitadel_client/models/organization_service_admin.py +zitadel_client/models/organization_service_any.py +zitadel_client/models/organization_service_connect_error.py +zitadel_client/models/organization_service_created_admin.py +zitadel_client/models/organization_service_deactivate_organization_request.py +zitadel_client/models/organization_service_deactivate_organization_response.py +zitadel_client/models/organization_service_delete_organization_domain_request.py +zitadel_client/models/organization_service_delete_organization_domain_response.py +zitadel_client/models/organization_service_delete_organization_metadata_request.py +zitadel_client/models/organization_service_delete_organization_metadata_response.py +zitadel_client/models/organization_service_delete_organization_request.py +zitadel_client/models/organization_service_delete_organization_response.py +zitadel_client/models/organization_service_details.py +zitadel_client/models/organization_service_domain.py +zitadel_client/models/organization_service_domain_field_name.py +zitadel_client/models/organization_service_domain_search_filter.py +zitadel_client/models/organization_service_domain_validation_type.py +zitadel_client/models/organization_service_gender.py +zitadel_client/models/organization_service_generate_organization_domain_validation_request.py +zitadel_client/models/organization_service_generate_organization_domain_validation_response.py +zitadel_client/models/organization_service_hashed_password.py +zitadel_client/models/organization_service_idp_link.py +zitadel_client/models/organization_service_list_details.py +zitadel_client/models/organization_service_list_organization_domains_request.py +zitadel_client/models/organization_service_list_organization_domains_response.py +zitadel_client/models/organization_service_list_organization_metadata_request.py +zitadel_client/models/organization_service_list_organization_metadata_response.py +zitadel_client/models/organization_service_list_organizations_request.py +zitadel_client/models/organization_service_list_organizations_response.py +zitadel_client/models/organization_service_list_query.py +zitadel_client/models/organization_service_metadata.py +zitadel_client/models/organization_service_metadata_key_filter.py +zitadel_client/models/organization_service_metadata_search_filter.py +zitadel_client/models/organization_service_organization.py +zitadel_client/models/organization_service_organization_domain_query.py +zitadel_client/models/organization_service_organization_field_name.py +zitadel_client/models/organization_service_organization_id_query.py +zitadel_client/models/organization_service_organization_name_query.py +zitadel_client/models/organization_service_organization_state.py +zitadel_client/models/organization_service_organization_state_query.py +zitadel_client/models/organization_service_pagination_request.py +zitadel_client/models/organization_service_pagination_response.py +zitadel_client/models/organization_service_password.py +zitadel_client/models/organization_service_search_query.py +zitadel_client/models/organization_service_send_email_verification_code.py +zitadel_client/models/organization_service_set_human_email.py +zitadel_client/models/organization_service_set_human_phone.py +zitadel_client/models/organization_service_set_human_profile.py +zitadel_client/models/organization_service_set_metadata_entry.py +zitadel_client/models/organization_service_set_organization_metadata_request.py +zitadel_client/models/organization_service_set_organization_metadata_response.py +zitadel_client/models/organization_service_text_filter_method.py +zitadel_client/models/organization_service_text_query_method.py +zitadel_client/models/organization_service_update_organization_request.py +zitadel_client/models/organization_service_update_organization_response.py +zitadel_client/models/organization_service_verify_organization_domain_request.py +zitadel_client/models/organization_service_verify_organization_domain_response.py +zitadel_client/models/project_service_activate_project_grant_request.py +zitadel_client/models/project_service_activate_project_grant_response.py +zitadel_client/models/project_service_activate_project_request.py +zitadel_client/models/project_service_activate_project_response.py +zitadel_client/models/project_service_add_project_role_request.py +zitadel_client/models/project_service_add_project_role_response.py +zitadel_client/models/project_service_any.py +zitadel_client/models/project_service_connect_error.py +zitadel_client/models/project_service_create_project_grant_request.py +zitadel_client/models/project_service_create_project_grant_response.py +zitadel_client/models/project_service_create_project_request.py +zitadel_client/models/project_service_create_project_response.py +zitadel_client/models/project_service_deactivate_project_grant_request.py +zitadel_client/models/project_service_deactivate_project_grant_response.py +zitadel_client/models/project_service_deactivate_project_request.py +zitadel_client/models/project_service_deactivate_project_response.py +zitadel_client/models/project_service_delete_project_grant_request.py +zitadel_client/models/project_service_delete_project_grant_response.py +zitadel_client/models/project_service_delete_project_request.py +zitadel_client/models/project_service_delete_project_response.py +zitadel_client/models/project_service_get_project_request.py +zitadel_client/models/project_service_get_project_response.py +zitadel_client/models/project_service_granted_project_state.py +zitadel_client/models/project_service_id_filter.py +zitadel_client/models/project_service_in_ids_filter.py +zitadel_client/models/project_service_list_project_grants_request.py +zitadel_client/models/project_service_list_project_grants_response.py +zitadel_client/models/project_service_list_project_roles_request.py +zitadel_client/models/project_service_list_project_roles_response.py +zitadel_client/models/project_service_list_projects_request.py +zitadel_client/models/project_service_list_projects_response.py +zitadel_client/models/project_service_pagination_request.py +zitadel_client/models/project_service_pagination_response.py +zitadel_client/models/project_service_private_labeling_setting.py +zitadel_client/models/project_service_project.py +zitadel_client/models/project_service_project_field_name.py +zitadel_client/models/project_service_project_grant.py +zitadel_client/models/project_service_project_grant_field_name.py +zitadel_client/models/project_service_project_grant_search_filter.py +zitadel_client/models/project_service_project_grant_state.py +zitadel_client/models/project_service_project_name_filter.py +zitadel_client/models/project_service_project_organization_id_filter.py +zitadel_client/models/project_service_project_role.py +zitadel_client/models/project_service_project_role_display_name_filter.py +zitadel_client/models/project_service_project_role_field_name.py +zitadel_client/models/project_service_project_role_key_filter.py +zitadel_client/models/project_service_project_role_search_filter.py +zitadel_client/models/project_service_project_search_filter.py +zitadel_client/models/project_service_project_state.py +zitadel_client/models/project_service_remove_project_role_request.py +zitadel_client/models/project_service_remove_project_role_response.py +zitadel_client/models/project_service_text_filter_method.py +zitadel_client/models/project_service_type.py +zitadel_client/models/project_service_update_project_grant_request.py +zitadel_client/models/project_service_update_project_grant_response.py +zitadel_client/models/project_service_update_project_request.py +zitadel_client/models/project_service_update_project_response.py +zitadel_client/models/project_service_update_project_role_request.py +zitadel_client/models/project_service_update_project_role_response.py +zitadel_client/models/saml_service_any.py +zitadel_client/models/saml_service_authorization_error.py +zitadel_client/models/saml_service_connect_error.py +zitadel_client/models/saml_service_create_response_request.py +zitadel_client/models/saml_service_create_response_response.py +zitadel_client/models/saml_service_details.py +zitadel_client/models/saml_service_error_reason.py +zitadel_client/models/saml_service_get_saml_request_request.py +zitadel_client/models/saml_service_get_saml_request_response.py +zitadel_client/models/saml_service_post_response.py +zitadel_client/models/saml_service_saml_request.py +zitadel_client/models/saml_service_session.py +zitadel_client/models/session_service_any.py +zitadel_client/models/session_service_challenges.py +zitadel_client/models/session_service_check_idp_intent.py +zitadel_client/models/session_service_check_otp.py +zitadel_client/models/session_service_check_password.py +zitadel_client/models/session_service_check_recovery_code.py +zitadel_client/models/session_service_check_totp.py +zitadel_client/models/session_service_check_user.py +zitadel_client/models/session_service_check_web_auth_n.py +zitadel_client/models/session_service_checks.py +zitadel_client/models/session_service_connect_error.py +zitadel_client/models/session_service_create_session_request.py +zitadel_client/models/session_service_create_session_response.py +zitadel_client/models/session_service_creation_date_query.py +zitadel_client/models/session_service_creator_query.py +zitadel_client/models/session_service_delete_session_request.py +zitadel_client/models/session_service_delete_session_response.py +zitadel_client/models/session_service_details.py +zitadel_client/models/session_service_expiration_date_query.py +zitadel_client/models/session_service_factors.py +zitadel_client/models/session_service_get_session_request.py +zitadel_client/models/session_service_get_session_response.py +zitadel_client/models/session_service_header_values.py +zitadel_client/models/session_service_ids_query.py +zitadel_client/models/session_service_intent_factor.py +zitadel_client/models/session_service_list_details.py +zitadel_client/models/session_service_list_query.py +zitadel_client/models/session_service_list_sessions_request.py +zitadel_client/models/session_service_list_sessions_response.py +zitadel_client/models/session_service_otp_email.py +zitadel_client/models/session_service_otp_factor.py +zitadel_client/models/session_service_otpsms.py +zitadel_client/models/session_service_password_factor.py +zitadel_client/models/session_service_recovery_code_factor.py +zitadel_client/models/session_service_request_challenges.py +zitadel_client/models/session_service_search_query.py +zitadel_client/models/session_service_send_code.py +zitadel_client/models/session_service_session.py +zitadel_client/models/session_service_session_field_name.py +zitadel_client/models/session_service_set_session_request.py +zitadel_client/models/session_service_set_session_response.py +zitadel_client/models/session_service_timestamp_query_method.py +zitadel_client/models/session_service_totp_factor.py +zitadel_client/models/session_service_user_agent.py +zitadel_client/models/session_service_user_agent_query.py +zitadel_client/models/session_service_user_factor.py +zitadel_client/models/session_service_user_id_query.py +zitadel_client/models/session_service_user_verification_requirement.py +zitadel_client/models/session_service_web_auth_n.py +zitadel_client/models/session_service_web_auth_n_factor.py +zitadel_client/models/settings_service_any.py +zitadel_client/models/settings_service_auto_linking_option.py +zitadel_client/models/settings_service_branding_settings.py +zitadel_client/models/settings_service_connect_error.py +zitadel_client/models/settings_service_details.py +zitadel_client/models/settings_service_domain_settings.py +zitadel_client/models/settings_service_embedded_iframe_settings.py +zitadel_client/models/settings_service_get_active_identity_providers_request.py +zitadel_client/models/settings_service_get_active_identity_providers_response.py +zitadel_client/models/settings_service_get_branding_settings_request.py +zitadel_client/models/settings_service_get_branding_settings_response.py +zitadel_client/models/settings_service_get_domain_settings_request.py +zitadel_client/models/settings_service_get_domain_settings_response.py +zitadel_client/models/settings_service_get_general_settings_response.py +zitadel_client/models/settings_service_get_hosted_login_translation_request.py +zitadel_client/models/settings_service_get_hosted_login_translation_response.py +zitadel_client/models/settings_service_get_legal_and_support_settings_request.py +zitadel_client/models/settings_service_get_legal_and_support_settings_response.py +zitadel_client/models/settings_service_get_lockout_settings_request.py +zitadel_client/models/settings_service_get_lockout_settings_response.py +zitadel_client/models/settings_service_get_login_settings_request.py +zitadel_client/models/settings_service_get_login_settings_response.py +zitadel_client/models/settings_service_get_password_complexity_settings_request.py +zitadel_client/models/settings_service_get_password_complexity_settings_response.py +zitadel_client/models/settings_service_get_password_expiry_settings_request.py +zitadel_client/models/settings_service_get_password_expiry_settings_response.py +zitadel_client/models/settings_service_get_security_settings_response.py +zitadel_client/models/settings_service_identity_provider.py +zitadel_client/models/settings_service_identity_provider_type.py +zitadel_client/models/settings_service_legal_and_support_settings.py +zitadel_client/models/settings_service_list_details.py +zitadel_client/models/settings_service_lockout_settings.py +zitadel_client/models/settings_service_login_settings.py +zitadel_client/models/settings_service_multi_factor_type.py +zitadel_client/models/settings_service_options.py +zitadel_client/models/settings_service_passkeys_type.py +zitadel_client/models/settings_service_password_complexity_settings.py +zitadel_client/models/settings_service_password_expiry_settings.py +zitadel_client/models/settings_service_request_context.py +zitadel_client/models/settings_service_resource_owner_type.py +zitadel_client/models/settings_service_second_factor_type.py +zitadel_client/models/settings_service_security_settings.py +zitadel_client/models/settings_service_set_hosted_login_translation_request.py +zitadel_client/models/settings_service_set_hosted_login_translation_response.py +zitadel_client/models/settings_service_set_security_settings_request.py +zitadel_client/models/settings_service_set_security_settings_response.py +zitadel_client/models/settings_service_theme.py +zitadel_client/models/settings_service_theme_mode.py +zitadel_client/models/user_service_access_token_type.py +zitadel_client/models/user_service_add_human_user_request.py +zitadel_client/models/user_service_add_human_user_response.py +zitadel_client/models/user_service_add_idp_link_request.py +zitadel_client/models/user_service_add_idp_link_response.py +zitadel_client/models/user_service_add_key_request.py +zitadel_client/models/user_service_add_key_response.py +zitadel_client/models/user_service_add_otp_email_request.py +zitadel_client/models/user_service_add_otp_email_response.py +zitadel_client/models/user_service_add_otpsms_request.py +zitadel_client/models/user_service_add_otpsms_response.py +zitadel_client/models/user_service_add_personal_access_token_request.py +zitadel_client/models/user_service_add_personal_access_token_response.py +zitadel_client/models/user_service_add_secret_request.py +zitadel_client/models/user_service_add_secret_response.py +zitadel_client/models/user_service_and_query.py +zitadel_client/models/user_service_any.py +zitadel_client/models/user_service_auth_factor.py +zitadel_client/models/user_service_auth_factor_state.py +zitadel_client/models/user_service_auth_factor_u2_f.py +zitadel_client/models/user_service_auth_factors.py +zitadel_client/models/user_service_authentication_method_type.py +zitadel_client/models/user_service_byte_filter_method.py +zitadel_client/models/user_service_connect_error.py +zitadel_client/models/user_service_create_invite_code_request.py +zitadel_client/models/user_service_create_invite_code_response.py +zitadel_client/models/user_service_create_passkey_registration_link_request.py +zitadel_client/models/user_service_create_passkey_registration_link_response.py +zitadel_client/models/user_service_create_user_request.py +zitadel_client/models/user_service_create_user_response.py +zitadel_client/models/user_service_deactivate_user_request.py +zitadel_client/models/user_service_deactivate_user_response.py +zitadel_client/models/user_service_delete_user_metadata_request.py +zitadel_client/models/user_service_delete_user_metadata_response.py +zitadel_client/models/user_service_delete_user_request.py +zitadel_client/models/user_service_delete_user_response.py +zitadel_client/models/user_service_details.py +zitadel_client/models/user_service_display_name_query.py +zitadel_client/models/user_service_domain_query.py +zitadel_client/models/user_service_email_query.py +zitadel_client/models/user_service_first_name_query.py +zitadel_client/models/user_service_form_data.py +zitadel_client/models/user_service_gender.py +zitadel_client/models/user_service_generate_recovery_codes_request.py +zitadel_client/models/user_service_generate_recovery_codes_response.py +zitadel_client/models/user_service_get_user_by_id_request.py +zitadel_client/models/user_service_get_user_by_id_response.py +zitadel_client/models/user_service_hashed_password.py +zitadel_client/models/user_service_human.py +zitadel_client/models/user_service_human_email.py +zitadel_client/models/user_service_human_mfa_init_skipped_request.py +zitadel_client/models/user_service_human_mfa_init_skipped_response.py +zitadel_client/models/user_service_human_phone.py +zitadel_client/models/user_service_human_profile.py +zitadel_client/models/user_service_human_user.py +zitadel_client/models/user_service_id_filter.py +zitadel_client/models/user_service_idp_information.py +zitadel_client/models/user_service_idp_intent.py +zitadel_client/models/user_service_idp_link.py +zitadel_client/models/user_service_idpldap_access_information.py +zitadel_client/models/user_service_idpo_auth_access_information.py +zitadel_client/models/user_service_idpsaml_access_information.py +zitadel_client/models/user_service_in_user_emails_query.py +zitadel_client/models/user_service_in_user_id_query.py +zitadel_client/models/user_service_key.py +zitadel_client/models/user_service_key_field_name.py +zitadel_client/models/user_service_keys_search_filter.py +zitadel_client/models/user_service_last_name_query.py +zitadel_client/models/user_service_ldap_credentials.py +zitadel_client/models/user_service_list_authentication_factors_request.py +zitadel_client/models/user_service_list_authentication_factors_response.py +zitadel_client/models/user_service_list_authentication_method_types_request.py +zitadel_client/models/user_service_list_authentication_method_types_response.py +zitadel_client/models/user_service_list_details.py +zitadel_client/models/user_service_list_idp_links_request.py +zitadel_client/models/user_service_list_idp_links_response.py +zitadel_client/models/user_service_list_keys_request.py +zitadel_client/models/user_service_list_keys_response.py +zitadel_client/models/user_service_list_passkeys_request.py +zitadel_client/models/user_service_list_passkeys_response.py +zitadel_client/models/user_service_list_personal_access_tokens_request.py +zitadel_client/models/user_service_list_personal_access_tokens_response.py +zitadel_client/models/user_service_list_query.py +zitadel_client/models/user_service_list_user_metadata_request.py +zitadel_client/models/user_service_list_user_metadata_response.py +zitadel_client/models/user_service_list_users_request.py +zitadel_client/models/user_service_list_users_response.py +zitadel_client/models/user_service_lock_user_request.py +zitadel_client/models/user_service_lock_user_response.py +zitadel_client/models/user_service_login_name_query.py +zitadel_client/models/user_service_machine.py +zitadel_client/models/user_service_machine_user.py +zitadel_client/models/user_service_metadata.py +zitadel_client/models/user_service_metadata_key_filter.py +zitadel_client/models/user_service_metadata_search_filter.py +zitadel_client/models/user_service_metadata_value_filter.py +zitadel_client/models/user_service_nick_name_query.py +zitadel_client/models/user_service_not_query.py +zitadel_client/models/user_service_notification_type.py +zitadel_client/models/user_service_or_query.py +zitadel_client/models/user_service_organization.py +zitadel_client/models/user_service_organization_id_query.py +zitadel_client/models/user_service_pagination_request.py +zitadel_client/models/user_service_pagination_response.py +zitadel_client/models/user_service_passkey.py +zitadel_client/models/user_service_passkey_authenticator.py +zitadel_client/models/user_service_passkey_registration_code.py +zitadel_client/models/user_service_password.py +zitadel_client/models/user_service_password_reset_request.py +zitadel_client/models/user_service_password_reset_response.py +zitadel_client/models/user_service_personal_access_token.py +zitadel_client/models/user_service_personal_access_token_field_name.py +zitadel_client/models/user_service_personal_access_tokens_search_filter.py +zitadel_client/models/user_service_phone_query.py +zitadel_client/models/user_service_profile.py +zitadel_client/models/user_service_reactivate_user_request.py +zitadel_client/models/user_service_reactivate_user_response.py +zitadel_client/models/user_service_redirect_urls.py +zitadel_client/models/user_service_register_passkey_request.py +zitadel_client/models/user_service_register_passkey_response.py +zitadel_client/models/user_service_register_totp_request.py +zitadel_client/models/user_service_register_totp_response.py +zitadel_client/models/user_service_register_u2_f_request.py +zitadel_client/models/user_service_register_u2_f_response.py +zitadel_client/models/user_service_remove_idp_link_request.py +zitadel_client/models/user_service_remove_idp_link_response.py +zitadel_client/models/user_service_remove_key_request.py +zitadel_client/models/user_service_remove_key_response.py +zitadel_client/models/user_service_remove_otp_email_request.py +zitadel_client/models/user_service_remove_otp_email_response.py +zitadel_client/models/user_service_remove_otpsms_request.py +zitadel_client/models/user_service_remove_otpsms_response.py +zitadel_client/models/user_service_remove_passkey_request.py +zitadel_client/models/user_service_remove_passkey_response.py +zitadel_client/models/user_service_remove_personal_access_token_request.py +zitadel_client/models/user_service_remove_personal_access_token_response.py +zitadel_client/models/user_service_remove_phone_request.py +zitadel_client/models/user_service_remove_phone_response.py +zitadel_client/models/user_service_remove_recovery_codes_request.py +zitadel_client/models/user_service_remove_recovery_codes_response.py +zitadel_client/models/user_service_remove_secret_request.py +zitadel_client/models/user_service_remove_secret_response.py +zitadel_client/models/user_service_remove_totp_request.py +zitadel_client/models/user_service_remove_totp_response.py +zitadel_client/models/user_service_remove_u2_f_request.py +zitadel_client/models/user_service_remove_u2_f_response.py +zitadel_client/models/user_service_resend_email_code_request.py +zitadel_client/models/user_service_resend_email_code_response.py +zitadel_client/models/user_service_resend_invite_code_request.py +zitadel_client/models/user_service_resend_invite_code_response.py +zitadel_client/models/user_service_resend_phone_code_request.py +zitadel_client/models/user_service_resend_phone_code_response.py +zitadel_client/models/user_service_retrieve_identity_provider_intent_request.py +zitadel_client/models/user_service_retrieve_identity_provider_intent_response.py +zitadel_client/models/user_service_search_query.py +zitadel_client/models/user_service_send_email_code_request.py +zitadel_client/models/user_service_send_email_code_response.py +zitadel_client/models/user_service_send_email_verification_code.py +zitadel_client/models/user_service_send_invite_code.py +zitadel_client/models/user_service_send_passkey_registration_link.py +zitadel_client/models/user_service_send_password_reset_link.py +zitadel_client/models/user_service_set_email_request.py +zitadel_client/models/user_service_set_email_response.py +zitadel_client/models/user_service_set_human_email.py +zitadel_client/models/user_service_set_human_phone.py +zitadel_client/models/user_service_set_human_profile.py +zitadel_client/models/user_service_set_metadata_entry.py +zitadel_client/models/user_service_set_password.py +zitadel_client/models/user_service_set_password_request.py +zitadel_client/models/user_service_set_password_response.py +zitadel_client/models/user_service_set_phone_request.py +zitadel_client/models/user_service_set_phone_response.py +zitadel_client/models/user_service_set_user_metadata_request.py +zitadel_client/models/user_service_set_user_metadata_response.py +zitadel_client/models/user_service_start_identity_provider_intent_request.py +zitadel_client/models/user_service_start_identity_provider_intent_response.py +zitadel_client/models/user_service_state_query.py +zitadel_client/models/user_service_text_filter_method.py +zitadel_client/models/user_service_text_query_method.py +zitadel_client/models/user_service_timestamp_filter.py +zitadel_client/models/user_service_timestamp_filter_method.py +zitadel_client/models/user_service_type.py +zitadel_client/models/user_service_type_query.py +zitadel_client/models/user_service_unlock_user_request.py +zitadel_client/models/user_service_unlock_user_response.py +zitadel_client/models/user_service_update_human_user_request.py +zitadel_client/models/user_service_update_human_user_response.py +zitadel_client/models/user_service_update_user_request.py +zitadel_client/models/user_service_update_user_response.py +zitadel_client/models/user_service_user.py +zitadel_client/models/user_service_user_field_name.py +zitadel_client/models/user_service_user_name_query.py +zitadel_client/models/user_service_user_state.py +zitadel_client/models/user_service_verify_email_request.py +zitadel_client/models/user_service_verify_email_response.py +zitadel_client/models/user_service_verify_invite_code_request.py +zitadel_client/models/user_service_verify_invite_code_response.py +zitadel_client/models/user_service_verify_passkey_registration_request.py +zitadel_client/models/user_service_verify_passkey_registration_response.py +zitadel_client/models/user_service_verify_phone_request.py +zitadel_client/models/user_service_verify_phone_response.py +zitadel_client/models/user_service_verify_totp_registration_request.py +zitadel_client/models/user_service_verify_totp_registration_response.py +zitadel_client/models/user_service_verify_u2_f_registration_request.py +zitadel_client/models/user_service_verify_u2_f_registration_response.py +zitadel_client/models/web_key_service_activate_web_key_request.py +zitadel_client/models/web_key_service_activate_web_key_response.py +zitadel_client/models/web_key_service_any.py +zitadel_client/models/web_key_service_connect_error.py +zitadel_client/models/web_key_service_create_web_key_request.py +zitadel_client/models/web_key_service_create_web_key_response.py +zitadel_client/models/web_key_service_delete_web_key_request.py +zitadel_client/models/web_key_service_delete_web_key_response.py +zitadel_client/models/web_key_service_ecdsa.py +zitadel_client/models/web_key_service_ecdsa_curve.py +zitadel_client/models/web_key_service_list_web_keys_response.py +zitadel_client/models/web_key_service_rsa.py +zitadel_client/models/web_key_service_rsa_bits.py +zitadel_client/models/web_key_service_rsa_hasher.py +zitadel_client/models/web_key_service_state.py +zitadel_client/models/web_key_service_web_key.py +zitadel_client/object_serializer.py +zitadel_client/py.typed +zitadel_client/server_configuration.py +zitadel_client/servers.py +zitadel_client/trace_context_util.py +zitadel_client/transport_options.py +zitadel_client/value_serializer.py +zitadel_client/zitadel.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..e465da43 --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/.qodana/qodana.sarif.json b/.qodana/qodana.sarif.json deleted file mode 100644 index 0d0aa9ce..00000000 --- a/.qodana/qodana.sarif.json +++ /dev/null @@ -1,21779 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/schemastore/schemastore/master/src/schemas/json/sarif-2.1.0-rtm.5.json", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": "QDPY", - "fullName": "Qodana for Python", - "version": "251.25776", - "rules": [], - "taxa": [ - { - "id": "EditorConfig", - "name": "EditorConfig" - }, - { - "id": "JavaScript and TypeScript", - "name": "JavaScript and TypeScript" - }, - { - "id": "JavaScript and TypeScript/Control flow issues", - "name": "Control flow issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Python", - "name": "Python" - }, - { - "id": "HTTP Client", - "name": "HTTP Client" - }, - { - "id": "PostCSS", - "name": "PostCSS" - }, - { - "id": "Sass_SCSS", - "name": "Sass/SCSS" - }, - { - "id": "Shell script", - "name": "Shell script" - }, - { - "id": "JavaScript and TypeScript/Unit testing", - "name": "Unit testing", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSON and JSON5", - "name": "JSON and JSON5" - }, - { - "id": "MongoJS", - "name": "MongoJS" - }, - { - "id": "JavaScript and TypeScript/General", - "name": "General", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Code style issues", - "name": "Code style issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MySQL", - "name": "MySQL" - }, - { - "id": "Properties files", - "name": "Properties files" - }, - { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "name": "Potentially undesirable code constructs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Flow type checker", - "name": "Flow type checker", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Probable bugs", - "name": "Probable bugs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HTML", - "name": "HTML" - }, - { - "id": "JavaScript and TypeScript/Unused symbols", - "name": "Unused symbols", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Data flow", - "name": "Data flow", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "name": "Bitwise operation issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "name": "ES2015 migration aids", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "General", - "name": "General" - }, - { - "id": "HTML/Accessibility", - "name": "Accessibility", - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/React", - "name": "React", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/TypeScript", - "name": "TypeScript", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Validity issues", - "name": "Validity issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "name": "Potentially confusing code constructs", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SQL", - "name": "SQL" - }, - { - "id": "CSS", - "name": "CSS" - }, - { - "id": "CSS/Invalid elements", - "name": "Invalid elements", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Try statement issues", - "name": "Try statement issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Function metrics", - "name": "Function metrics", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Structural search", - "name": "Structural search" - }, - { - "id": "Dependency analysis", - "name": "Dependency analysis" - }, - { - "id": "YAML", - "name": "YAML" - }, - { - "id": "Requirements", - "name": "Requirements" - }, - { - "id": "Code Coverage", - "name": "Code Coverage" - }, - { - "id": "XML", - "name": "XML" - }, - { - "id": "JavaScript and TypeScript/Assignment issues", - "name": "Assignment issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CSS/Code style issues", - "name": "Code style issues", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Less", - "name": "Less" - }, - { - "id": "RegExp", - "name": "RegExp" - }, - { - "id": "Vue", - "name": "Vue" - }, - { - "id": "JavaScript and TypeScript/Node.js", - "name": "Node.js", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Imports and dependencies", - "name": "Imports and dependencies", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RELAX NG", - "name": "RELAX NG" - }, - { - "id": "CSS/Probable bugs", - "name": "Probable bugs", - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Naming conventions", - "name": "Naming conventions", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Switch statement issues", - "name": "Switch statement issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/DOM issues", - "name": "DOM issues", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Async code and promises", - "name": "Async code and promises", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Code quality tools", - "name": "Code quality tools", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Proofreading", - "name": "Proofreading" - }, - { - "id": "Security", - "name": "Security" - }, - { - "id": "Qodana", - "name": "Qodana" - }, - { - "id": "PostgreSQL", - "name": "PostgreSQL" - }, - { - "id": "SQL server", - "name": "SQL server" - }, - { - "id": "JSONPath", - "name": "JSONPath" - }, - { - "id": "Python/Security", - "name": "Security", - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JavaScript and TypeScript/Security", - "name": "Security", - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript", - "index": 1, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Pyramid", - "name": "Pyramid" - }, - { - "id": "Oracle", - "name": "Oracle" - }, - { - "id": "Internationalization", - "name": "Internationalization" - }, - { - "id": "TOML", - "name": "TOML" - }, - { - "id": "Version control", - "name": "Version control" - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - "extensions": [ - { - "name": "org.editorconfig.editorconfigjetbrains", - "version": "251.25776", - "rules": [ - { - "id": "EditorConfigCharClassRedundancy", - "shortDescription": { - "text": "Unnecessary character class" - }, - "fullDescription": { - "text": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example '[a]'→'a'.", - "markdown": "Reports character classes that consist of a single character. Such classes can be simplified to a character, for example `[a]`→`a`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigCharClassRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigRootDeclarationUniqueness", - "shortDescription": { - "text": "Extra top-level declaration" - }, - "fullDescription": { - "text": "Reports multiple top-level declarations. There can be only one optional “root=true” top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed.", - "markdown": "Reports multiple top-level declarations. There can be only one optional \"root=true\" top-level declaration in the EditorConfig file. Using multiple top-level declarations is not allowed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigRootDeclarationUniqueness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigNumerousWildcards", - "shortDescription": { - "text": "Too many wildcards" - }, - "fullDescription": { - "text": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues.", - "markdown": "Reports sections that contain too many wildcards. Using a lot of wildcards may lead to performance issues." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigNumerousWildcards", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPartialOverride", - "shortDescription": { - "text": "Overlapping sections" - }, - "fullDescription": { - "text": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: '[{foo,bar}]' and '[{foo,bas}]' both contain “foo”.", - "markdown": "Reports subsets of files specified in the current section that overlap with other subsets in other sections. For example: `[{foo,bar}]` and `[{foo,bas}]` both contain \"foo\"." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigPartialOverride", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEmptySection", - "shortDescription": { - "text": "Empty section" - }, - "fullDescription": { - "text": "Reports sections that do not contain any EditorConfig properties.", - "markdown": "Reports sections that do not contain any EditorConfig properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigEmptySection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigShadowingOption", - "shortDescription": { - "text": "Overriding property" - }, - "fullDescription": { - "text": "Reports properties that override the same properties defined earlier in the file. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes the same files as '[*.java]' but also sets indent_size to value 2. Thus the first declaration 'indent_size=4'will be ignored.", - "markdown": "Reports properties that override the same properties defined earlier in the file.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes the same files as `[*.java]` but also sets indent_size to value 2. Thus the first declaration `indent_size=4`will be ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigShadowingOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigListAcceptability", - "shortDescription": { - "text": "Unexpected value list" - }, - "fullDescription": { - "text": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified.", - "markdown": "Reports lists of values that are used in properties in which lists are not supported. In this case, only a single value can be specified." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigListAcceptability", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigKeyCorrectness", - "shortDescription": { - "text": "Unknown property" - }, - "fullDescription": { - "text": "Reports properties that are not supported by the IDE. Note: some “ij” domain properties may require specific language plugins.", - "markdown": "Reports properties that are not supported by the IDE. Note: some \"ij\" domain properties may require specific language plugins." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigKeyCorrectness", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPatternEnumerationRedundancy", - "shortDescription": { - "text": "Unnecessary braces" - }, - "fullDescription": { - "text": "Reports pattern lists that are either empty '{}' or contain just one pattern, for example '{foo}' in contrast to a list containing multiple patterns, for example '{foo,bar}'. In this case braces are handled as a part of the name. For example, the pattern '*.{a}' will match the file 'my.{a}' but not 'my.a'.", - "markdown": "Reports pattern lists that are either empty `{}` or contain just one pattern, for example `{foo}` in contrast to a list containing multiple patterns, for example `{foo,bar}`. In this case braces are handled as a part of the name. For example, the pattern `*.{a}` will match the file `my.{a}` but not `my.a`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigPatternEnumerationRedundancy", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEncoding", - "shortDescription": { - "text": "File encoding doesn't match EditorConfig charset" - }, - "fullDescription": { - "text": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file.", - "markdown": "Checks that current file encoding matches the encoding defined in \"charset\" property of .editorconfig file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigRootDeclarationCorrectness", - "shortDescription": { - "text": "Unexpected top-level declaration" - }, - "fullDescription": { - "text": "Reports unexpected top-level declarations. Top-level declarations other than “root=true” are not allowed in the EditorConfig file.", - "markdown": "Reports unexpected top-level declarations. Top-level declarations other than \"root=true\" are not allowed in the EditorConfig file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigRootDeclarationCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigReferenceCorrectness", - "shortDescription": { - "text": "Invalid reference" - }, - "fullDescription": { - "text": "Reports identifiers that are either unknown or have a wrong type.", - "markdown": "Reports identifiers that are either unknown or have a wrong type." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigReferenceCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPairAcceptability", - "shortDescription": { - "text": "Unexpected key-value pair" - }, - "fullDescription": { - "text": "Reports key-value pairs that are not allowed in the current context.", - "markdown": "Reports key-value pairs that are not allowed in the current context." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigPairAcceptability", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigPatternRedundancy", - "shortDescription": { - "text": "Duplicate or redundant pattern" - }, - "fullDescription": { - "text": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in '[{*.java,*}]' the first '*.java' pattern defines a narrower scope compared to '*'. That is why it is redundant and can be removed.", - "markdown": "Reports file patterns that are redundant as there already are other patterns that define the same scope of files or even a broader one. For example, in `[{*.java,*}]` the first `*.java` pattern defines a narrower scope compared to `*`. That is why it is redundant and can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigPatternRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigNoMatchingFiles", - "shortDescription": { - "text": "No matching files" - }, - "fullDescription": { - "text": "Reports sections with wildcard patterns that do not match any files under the directory in which the '.editorconfig' file is located.", - "markdown": "Reports sections with wildcard patterns that do not match any files under the directory in which the `.editorconfig` file is located." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigNoMatchingFiles", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigDeprecatedDescriptor", - "shortDescription": { - "text": "Deprecated property" - }, - "fullDescription": { - "text": "Reports EditorConfig properties that are no longer supported.", - "markdown": "Reports EditorConfig properties that are no longer supported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigDeprecatedDescriptor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigWildcardRedundancy", - "shortDescription": { - "text": "Redundant wildcard" - }, - "fullDescription": { - "text": "Reports wildcards that become redundant when the “**” wildcard is used in the same section. The “**” wildcard defines a broader set of files than any other wildcard. That is why, any other wildcard used in the same section has no affect and can be removed.", - "markdown": "Reports wildcards that become redundant when the \"\\*\\*\" wildcard is used in the same section.\n\n\nThe \"\\*\\*\" wildcard defines a broader set of files than any other wildcard.\nThat is why, any other wildcard used in the same section has no affect and can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigWildcardRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigHeaderUniqueness", - "shortDescription": { - "text": "EditorConfig section is not unique" - }, - "fullDescription": { - "text": "Reports sections that define the same file pattern as other sections.", - "markdown": "Reports sections that define the same file pattern as other sections." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigHeaderUniqueness", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigShadowedOption", - "shortDescription": { - "text": "Overridden property" - }, - "fullDescription": { - "text": "Reports properties that are already defined in other sections. For example: '[*.java]\nindent_size=4\n[{*.java,*.js}]\nindent_size=2' The second section includes all '*.java' files too but it also redefines indent_size. As a result the value 2 will be used for files matching '*.java'.", - "markdown": "Reports properties that are already defined in other sections.\n\nFor example:\n\n\n [*.java]\n indent_size=4\n [{*.java,*.js}]\n indent_size=2\n\nThe second section includes all `*.java` files too but it also redefines indent_size. As a result the value 2 will be used for files matching `*.java`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigShadowedOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigEmptyHeader", - "shortDescription": { - "text": "Empty header" - }, - "fullDescription": { - "text": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by 'gitignore'.", - "markdown": "Reports sections with an empty header. Section header must contain file path globs in the format similar to one supported by `gitignore`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigEmptyHeader", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigValueCorrectness", - "shortDescription": { - "text": "Invalid property value" - }, - "fullDescription": { - "text": "Reports property values that do not meet value restrictions. For example, some properties may be only “true” or “false”, others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them.", - "markdown": "Reports property values that do not meet value restrictions. For example, some properties may be only \"true\" or \"false\", others contain only integer numbers etc. If a value has a limited set of variants, use code completion to see all of them." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigValueCorrectness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigVerifyByCore", - "shortDescription": { - "text": "Invalid .editorconfig file" - }, - "fullDescription": { - "text": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied.", - "markdown": "Verifies the whole file using the backing EditorConfig core library and reports any failures. Any such failure would prevent EditorConfig properties from being correctly applied." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigVerifyByCore", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigValueUniqueness", - "shortDescription": { - "text": "Non-unique list value" - }, - "fullDescription": { - "text": "Reports duplicates in lists of values.", - "markdown": "Reports duplicates in lists of values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigValueUniqueness", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigMissingRequiredDeclaration", - "shortDescription": { - "text": "Required declarations are missing" - }, - "fullDescription": { - "text": "Reports properties that miss the required declarations. Refer to the documentation for more information.", - "markdown": "Reports properties that miss the required declarations. Refer to the documentation for more information." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigMissingRequiredDeclaration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigCharClassLetterRedundancy", - "shortDescription": { - "text": "Duplicate character class letter" - }, - "fullDescription": { - "text": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example '[aa]'.", - "markdown": "Reports wildcard patterns in the EditorConfig section that contain a duplicate character in the character class, for example `[aa]`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigCharClassLetterRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigSpaceInHeader", - "shortDescription": { - "text": "Space in file pattern" - }, - "fullDescription": { - "text": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed.", - "markdown": "Reports space characters in wildcard patterns that affect pattern matching. If these characters are not intentional, they should be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "EditorConfigSpaceInHeader", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigOptionRedundancy", - "shortDescription": { - "text": "Redundant property" - }, - "fullDescription": { - "text": "Reports properties that are redundant when another applicable section already contains the same property and value. For example: '[*]\nindent_size=4\n[*.java]\nindent_size=4' are both applicable to '*.java' files and define the same 'indent_size' value.", - "markdown": "Reports properties that are redundant when another applicable section already contains the same property and value.\n\n\nFor example:\n\n\n [*]\n indent_size=4\n [*.java]\n indent_size=4\n\nare both applicable to `*.java` files and define the same `indent_size` value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigOptionRedundancy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigUnusedDeclaration", - "shortDescription": { - "text": "Unused declaration" - }, - "fullDescription": { - "text": "Reports unused declarations. Such declarations can be removed.", - "markdown": "Reports unused declarations. Such declarations can be removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EditorConfigUnusedDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EditorConfigUnexpectedComma", - "shortDescription": { - "text": "Unexpected comma" - }, - "fullDescription": { - "text": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists.", - "markdown": "Reports commas that cannot be used in the current context. Commas are allowed only as separators for values in lists." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "EditorConfigUnexpectedComma", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "EditorConfig", - "index": 0, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "JavaScript", - "version": "251.25776", - "rules": [ - { - "id": "ConstantConditionalExpressionJS", - "shortDescription": { - "text": "Constant conditional expression" - }, - "fullDescription": { - "text": "Reports a conditional expression in the format 'true? result1: result2' or 'false? result1: result2. Suggests simplifying the expression.'", - "markdown": "Reports a conditional expression in the format `true? result1: result2` or `false? result1: result2``.\nSuggests simplifying the expression.\n`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConstantConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSTestFailedLine", - "shortDescription": { - "text": "Highlight failure line in test code" - }, - "fullDescription": { - "text": "Reports a failed method call or an assertion in a test.", - "markdown": "Reports a failed method call or an assertion in a test." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSTestFailedLine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unit testing", - "index": 8, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IfStatementWithTooManyBranchesJS", - "shortDescription": { - "text": "'if' statement with too many branches" - }, - "fullDescription": { - "text": "Reports an 'if' statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction. Use the field below to specify the maximum number of branches expected.", - "markdown": "Reports an `if` statement with too many branches. Such statements may be confusing, and often indicate inadequate levels of design abstraction.\n\n\nUse the field below to specify the maximum number of branches expected." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IfStatementWithTooManyBranchesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSValidateJSDoc", - "shortDescription": { - "text": "Syntax errors and unresolved references in JSDoc" - }, - "fullDescription": { - "text": "Reports a syntax discrepancy in a documentation comment.", - "markdown": "Reports a syntax discrepancy in a documentation comment." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSValidateJSDoc", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NonBlockStatementBodyJS", - "shortDescription": { - "text": "Statement body without braces" - }, - "fullDescription": { - "text": "Reports a 'if', 'while', 'for', or 'with' statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance.", - "markdown": "Reports a `if`, `while`, `for`, or `with` statements whose body is not a block statement. Using code block in statement bodies is usually safer for downstream maintenance." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NonBlockStatementBodyJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BreakStatementJS", - "shortDescription": { - "text": "'break' statement" - }, - "fullDescription": { - "text": "Reports a 'break' statements. Ignores 'break' statements that end case blocks.", - "markdown": "Reports a `break` statements. Ignores `break` statements that end case blocks." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BreakStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSConfig", - "shortDescription": { - "text": "Missing .flowconfig" - }, - "fullDescription": { - "text": "Reports a JavaScript file with a '@flow' flag that doesn't have an associated '.flowconfig' file in the project.", - "markdown": "Reports a JavaScript file with a `@flow` flag that doesn't have an associated `.flowconfig` file in the project." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FlowJSConfig", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidUsageOfClassThis", - "shortDescription": { - "text": "Potentially invalid reference to 'this' of a class from closure" - }, - "fullDescription": { - "text": "Reports an attempt to reference a member of an ECMAScript class via the 'this.' qualifier in a nested function that is not a lambda. 'this' in a nested function that is not a lambda is the function's own 'this' and doesn't relate to the outer class.", - "markdown": "Reports an attempt to reference a member of an ECMAScript class via the `this.` qualifier in a nested function that is not a lambda. \n`this` in a nested function that is not a lambda is the function's own `this` and doesn't relate to the outer class." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidUsageOfClassThis", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DebuggerStatementJS", - "shortDescription": { - "text": "'debugger' statement" - }, - "fullDescription": { - "text": "Reports a 'debugger' statement used for interaction with the Javascript debuggers. Such statements should not appear in production code.", - "markdown": "Reports a `debugger` statement used for interaction with the Javascript debuggers. Such statements should not appear in production code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DebuggerStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnusedAssignment", - "shortDescription": { - "text": "Unused assignment" - }, - "fullDescription": { - "text": "Reports a variable whose value is never used after assignment. Suggests removing the unused variable to shorten the code and to avoid redundant allocations. The following cases are reported: A variable is never read after assignment. The value of a variable is always overwritten with another assignment before the variable is read next time. The initializer of a variable is redundant (for one of the above-mentioned reasons).", - "markdown": "Reports a variable whose value is never used after assignment. \nSuggests removing the unused variable to shorten the code and to avoid redundant allocations.\n\nThe following cases are reported:\n\n* A variable is never read after assignment.\n* The value of a variable is always overwritten with another assignment before the variable is read next time.\n* The initializer of a variable is redundant (for one of the above-mentioned reasons)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnusedAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unused symbols", - "index": 19, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReuseOfLocalVariableJS", - "shortDescription": { - "text": "Reuse of local variable" - }, - "fullDescription": { - "text": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.", - "markdown": "Reports reusing a local variable and overwriting its value with a new value that is not related to the original variable usage. Reusing a local variable in this way may be confusing because the intended semantics of the local variable may vary with each usage. It may also cause bugs, if code changes result in values that were expected to be overwritten while they are actually live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReuseOfLocalVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Data flow", - "index": 20, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ShiftOutOfRangeJS", - "shortDescription": { - "text": "Shift operation by possibly wrong constant" - }, - "fullDescription": { - "text": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range '0..31', shifting by negative or overly large values.", - "markdown": "Reports a shift operation where the second operand is a constant outside the reasonable range, for example, an integer shift operation outside the range `0..31`, shifting by negative or overly large values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ShiftOutOfRangeJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSClosureCompilerSyntax", - "shortDescription": { - "text": "Incorrect usage of JSDoc tags" - }, - "fullDescription": { - "text": "Reports warnings implied by Google Closure Compiler annotations including correct use of '@abstract', '@interface', and '@implements' tags.", - "markdown": "Reports warnings implied by *Google Closure Compiler* annotations including correct use of `@abstract`, `@interface`, and `@implements` tags." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSClosureCompilerSyntax", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryContinueJS", - "shortDescription": { - "text": "Unnecessary 'continue' statement" - }, - "fullDescription": { - "text": "Reports an unnecessary 'continue' statement at the end of a loop. Suggests removing such statements.", - "markdown": "Reports an unnecessary `continue` statement at the end of a loop. Suggests removing such statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryContinueJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertLetToConst", - "shortDescription": { - "text": "'let' is used instead of 'const'" - }, - "fullDescription": { - "text": "Reports a 'let' declaration that can be made 'const'.", - "markdown": "Reports a `let` declaration that can be made `const`. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertLetToConst", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXDomNesting", - "shortDescription": { - "text": "Invalid DOM element nesting" - }, - "fullDescription": { - "text": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements.", - "markdown": "Detects HTML elements in JSX files which are not nested properly according to the DOM specification. React reports runtime warnings on incorrectly nested elements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSXDomNesting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/React", - "index": 25, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptValidateTypes", - "shortDescription": { - "text": "Type mismatch" - }, - "fullDescription": { - "text": "Reports a parameter, return value, or assigned expression of incorrect type.", - "markdown": "Reports a parameter, return value, or assigned expression of incorrect type." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptValidateTypes", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BadExpressionStatementJS", - "shortDescription": { - "text": "Expression statement which is not assignment or call" - }, - "fullDescription": { - "text": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error.", - "markdown": "Reports an expression statement that is neither an assignment nor a call. Such statements usually indicate an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "BadExpressionStatementJS", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConfusingFloatingPointLiteralJS", - "shortDescription": { - "text": "Confusing floating point literal" - }, - "fullDescription": { - "text": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards.", - "markdown": "Reports any floating point number that does not have a decimal point, or any numbers before the decimal point, or and numbers after the decimal point. Such literals may be confusing, and violate several coding standards." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConfusingFloatingPointLiteralJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BreakStatementWithLabelJS", - "shortDescription": { - "text": "'break' statement with label" - }, - "fullDescription": { - "text": "Reports a labeled 'break' statement.", - "markdown": "Reports a labeled `break` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BreakStatementWithLabelJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueOrBreakFromFinallyBlockJS", - "shortDescription": { - "text": "'continue' or 'break' inside 'finally' block" - }, - "fullDescription": { - "text": "Reports a 'break' or 'continue' statement inside a 'finally' block. Such statements are very confusing, may hide exceptions, and complicate debugging.", - "markdown": "Reports a `break` or `continue` statement inside a `finally` block. Such statements are very confusing, may hide exceptions, and complicate debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueOrBreakFromFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StatementsPerFunctionJS", - "shortDescription": { - "text": "Overly long function" - }, - "fullDescription": { - "text": "Reports an overly long function. Function length is calculated by counting up the number of non-empty statements in the function. Functions that are too long are error-prone and difficult to test. Use the field below to specify the maximum acceptable number of statements in a function.", - "markdown": "Reports an overly long function. Function length is calculated by counting up the number of non-empty statements in the function. Functions that are too long are error-prone and difficult to test.\n\n\nUse the field below to specify the maximum acceptable number of statements in a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionTooLongJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLocalVariableJS", - "shortDescription": { - "text": "Redundant local variable" - }, - "fullDescription": { - "text": "Reports an unnecessary local variable that does not make a function more comprehensible: a local variable that is immediately returned a local variable that is immediately assigned to another variable and is not used anymore a local variable that always has the same value as another local variable or parameter. Use the checkbox below to have this inspection ignore variables that are immediately returned or thrown. Some coding styles suggest using such variables for clarity and ease of debugging.", - "markdown": "Reports an unnecessary local variable that does not make a function more comprehensible:\n\n* a local variable that is immediately returned\n* a local variable that is immediately assigned to another variable and is not used anymore\n* a local variable that always has the same value as another local variable or parameter.\n\n\nUse the checkbox below to have this inspection ignore variables that are immediately\nreturned or thrown. Some coding styles suggest using such variables for clarity and\nease of debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLocalVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Data flow", - "index": 20, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMethodCanBeStatic", - "shortDescription": { - "text": "Method can be made 'static'" - }, - "fullDescription": { - "text": "Reports a class method that can be safely made 'static'. A method can be 'static' if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass. Use the first checkbox below to inspect only 'private' methods.", - "markdown": "Reports a class method that can be safely made `static`. A method can be `static` if it does not reference any of its class' non-static methods and non-static fields and is not overridden in a subclass.\n\n\nUse the first checkbox below to inspect only `private` methods." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSMethodCanBeStatic", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDeclarationsAtScopeStart", - "shortDescription": { - "text": "'var' declared not at the beginning of a function" - }, - "fullDescription": { - "text": "Checks that declarations of local variables declared with var are at the top of a function scope. By default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code.", - "markdown": "Checks that declarations of local variables declared with **var** are at the top of a function scope. \n\nBy default, variable declarations are always moved (\"hoisted\") invisibly to the top of their containing scope when the code is executed. Therefore, declaring them at the top of the scope helps represent this behavior in the code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSDeclarationsAtScopeStart", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueStatementWithLabelJS", - "shortDescription": { - "text": "'continue' statement with label" - }, - "fullDescription": { - "text": "Reports a labeled 'continue' statement.", - "markdown": "Reports a labeled `continue` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueStatementWithLabelJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSObjectNullOrUndefined", - "shortDescription": { - "text": "Object is 'null' or 'undefined'" - }, - "fullDescription": { - "text": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is 'undefined' or 'null'.", - "markdown": "Reports an error caused by invoking a method, accessing a property, or calling a function on an object that is `undefined` or `null`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSObjectNullOrUndefined", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptMissingConfigOption", - "shortDescription": { - "text": "Missing tsconfig.json option " - }, - "fullDescription": { - "text": "Reports a usage that requires an explicit option in 'tsconfig.json'. For example, to use JSX in '.tsx' files, 'tsconfig.json' must contain '\"jsx\"' property.", - "markdown": "Reports a usage that requires an explicit option in `tsconfig.json`. For example, to use JSX in `.tsx` files, `tsconfig.json` must contain `\"jsx\"` property." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptMissingConfigOption", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXUnresolvedComponent", - "shortDescription": { - "text": "Unresolved JSX component" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name. The template for a new component can be modified in Editor | File and Code Templates.", - "markdown": "Reports an unresolved reference to a JSX component. Suggests adding a missing import statement if the referenced component is defined in the project or its dependencies or creating a new component with this name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSXUnresolvedComponent", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ShorthandObjectProperty", - "shortDescription": { - "text": "Property can be replaced with shorthand" - }, - "fullDescription": { - "text": "Reports an object property that can be converted to ES6 shorthand style and provides a quick-fix to do it. Example: 'var obj = {foo:foo}' After applying the quick-fix the code looks as follows: 'var obj = {foo}'", - "markdown": "Reports an object property that can be converted to ES6 shorthand style and provides a quick-fix to do it.\n\nExample:\n\n\n var obj = {foo:foo}\n\nAfter applying the quick-fix the code looks as follows:\n\n\n var obj = {foo}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ShorthandObjectProperty", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLabelOnBreakStatementJS", - "shortDescription": { - "text": "Unnecessary label on 'break' statement" - }, - "fullDescription": { - "text": "Reports a labeled 'break' statement whose labels may be removed without changing the flow of control.", - "markdown": "Reports a labeled `break` statement whose labels may be removed without changing the flow of control." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLabelOnBreakStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ContinueStatementJS", - "shortDescription": { - "text": "'continue' statement" - }, - "fullDescription": { - "text": "Reports a 'continue' statement.", - "markdown": "Reports a `continue` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ContinueStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AssignmentToForLoopParameterJS", - "shortDescription": { - "text": "Assignment to 'for' loop parameter" - }, - "fullDescription": { - "text": "Reports an assignment to a variable declared as a 'for' loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error.", - "markdown": "Reports an assignment to a variable declared as a `for` loop parameter. Although occasionally intended, this construct can be extremely confusing, and is often a result of an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AssignmentToForLoopParameterJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidConstructorUsage", - "shortDescription": { - "text": "Potentially invalid constructor usage" - }, - "fullDescription": { - "text": "Reports a usage of a potentially invalid constructor function, for example: a function that is not a constructor after 'new', using a constructor's prototype or calling a constructor without 'new'. A constructor function is assumed to have an upper case name (optional) or have an explicit JSDoc '@constructor' tag.", - "markdown": "Reports a usage of a potentially invalid constructor function, for example: a function that is not a constructor after `new`, using a constructor's prototype or calling a constructor without `new`. A constructor function is assumed to have an upper case name (optional) or have an explicit JSDoc `@constructor` tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidConstructorUsage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessArithmeticExpressionJS", - "shortDescription": { - "text": "Pointless arithmetic expression" - }, - "fullDescription": { - "text": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring.", - "markdown": "Reports an arithmetic expression that include adding or subtracting zero, multiplying by zero or one, division by one, and shift by zero. Such expressions may result from not fully completed automated refactoring." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessArithmeticExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NodeCoreCodingAssistance", - "shortDescription": { - "text": "Unresolved Node.js APIs" - }, - "fullDescription": { - "text": "Suggests configuring coding assistance for Node.js, for example, 'require' and/or core modules ('path', 'http', 'fs', etc.). See https://nodejs.org/api/ for the complete list.", - "markdown": "Suggests configuring coding assistance for Node.js, for example, `require` and/or core modules ('path', 'http', 'fs', etc.).\n\n\nSee for the complete list." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NodeCoreCodingAssistance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Node.js", - "index": 45, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUndeclaredVariable", - "shortDescription": { - "text": "Implicitly declared global JavaScript variable" - }, - "fullDescription": { - "text": "Reports an implicit declaration of a global variable. Example: 'var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere'", - "markdown": "Reports an implicit declaration of a global variable.\n\nExample:\n\n\n var aaa = 1; // good\n bbb = 2; // bad, if bbb is not declared with 'var' somewhere\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUndeclaredVariable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DivideByZeroJS", - "shortDescription": { - "text": "Division by zero" - }, - "fullDescription": { - "text": "Reports division by zero or a remainder by zero.", - "markdown": "Reports division by zero or a remainder by zero." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DivideByZeroJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPrimitiveTypeWrapperUsage", - "shortDescription": { - "text": "Primitive type object wrapper used" - }, - "fullDescription": { - "text": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost.", - "markdown": "Reports an improper usage of a wrapper for primitive types or a property of a primitive type being modified, as in the latter case the assigned value will be lost." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPrimitiveTypeWrapperUsage", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptSmartCast", - "shortDescription": { - "text": "Narrowed type" - }, - "fullDescription": { - "text": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection.", - "markdown": "Reports a usage of a variable where the variable type is narrowed by a type guard. Note that severity level doesn't affect this inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptSmartCast", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertIndexedForToForOf", - "shortDescription": { - "text": "Indexed 'for' is used instead of 'for..of'" - }, - "fullDescription": { - "text": "Reports an indexed 'for' loop used on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops are introduced in ECMAScript 6 and iterate over 'iterable' objects.", - "markdown": "Reports an indexed [for](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for) loop used on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops are introduced in ECMAScript 6 and iterate over `iterable` objects." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertIndexedForToForOf", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSLastCommaInArrayLiteral", - "shortDescription": { - "text": "Unneeded last comma in array literal" - }, - "fullDescription": { - "text": "Reports a usage of a trailing comma in an array literal. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Although trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", - "markdown": "Reports a usage of a trailing comma in an array literal.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nAlthough trailing commas in arrays are allowed by the specification, some browsers may throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSLastCommaInArrayLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConditionalExpressionJS", - "shortDescription": { - "text": "Conditional expression" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit 'if' statements.", - "markdown": "Reports a ternary conditional expression. Some coding standards prohibit such expressions in favor of explicit `if` statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertVarToLetConst", - "shortDescription": { - "text": "'var' is used instead of 'let' or 'const'" - }, - "fullDescription": { - "text": "Reports a 'var' declaration that is used instead of 'let' or 'const'. Both 'let' and 'const' are block-scoped and behave more strictly. Suggests replacing all 'var' declarations with 'let' or 'const' declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. Select the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action.", - "markdown": "Reports a `var` declaration that is used instead of `let` or `const`. \nBoth `let` and `const` are block-scoped and behave more strictly. \n\nSuggests replacing all `var` declarations with `let` or `const` declarations, depending on the semantics of a particular value. The declarations may be moved to the top of the function or placed before the first usage of the variable to avoid Reference errors. \nSelect the 'Conservatively convert var with Fix all action' option to prevent any changes in these complex cases when using the 'Fix all' action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertVarToLetConst", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessBooleanExpressionJS", - "shortDescription": { - "text": "Pointless statement or boolean expression" - }, - "fullDescription": { - "text": "Reports a pointless or pointlessly complicated boolean expression or statement. Example: 'let a = !(false && x);\n let b = false || x;' After the quick fix is applied the result looks like: 'let a = true;\n let b = x;'", - "markdown": "Reports a pointless or pointlessly complicated boolean expression or statement.\n\nExample:\n\n\n let a = !(false && x);\n let b = false || x;\n\nAfter the quick fix is applied the result looks like:\n\n\n let a = true;\n let b = x;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessBooleanExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSReferencingMutableVariableFromClosure", - "shortDescription": { - "text": "Referencing mutable variable from closure" - }, - "fullDescription": { - "text": "Reports access to outer mutable variables from functions. Example: 'for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }'", - "markdown": "Reports access to outer mutable variables from functions.\n\nExample:\n\n\n for (var i = 1; i <= 3; i++) {\n setTimeout(function() {\n console.log(i); // bad\n }, 0);\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSReferencingMutableVariableFromClosure", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DynamicallyGeneratedCodeJS", - "shortDescription": { - "text": "Execution of dynamically generated code" - }, - "fullDescription": { - "text": "Reports a call of the 'eval()', 'setTimeout()', or 'setInterval()' function or an allocation of a 'Function' object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. Ignores the cases when a callback function is provided to these methods statically, without code generation.", - "markdown": "Reports a call of the `eval()`, `setTimeout()`, or `setInterval()` function or an allocation of a `Function` object. These functions are used to execute arbitrary strings of JavaScript text, which often dynamically generated. This can be very confusing, and may be a security risk. \n\nIgnores the cases when a callback function is provided to these methods statically, without code generation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DynamicallyGeneratedCodeJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NegatedConditionalExpressionJS", - "shortDescription": { - "text": "Negated conditional expression" - }, - "fullDescription": { - "text": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: '!condition ? 2 : 1'", - "markdown": "Reports a conditional expression whose condition is negated. Suggests flipping the order of branches in the conditional expression to increase the clarity of the statement. Example: `!condition ? 2 : 1`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NegatedConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUrlImportUsage", - "shortDescription": { - "text": "URL import is used" - }, - "fullDescription": { - "text": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. URLs in import specifiers are supported only for ECMAScript modules in the JavaScript language.", - "markdown": "Checks used URL imports in the JavaScript language. Suggests downloading the module for the specified remote URL. Such association enables the IDE to provide proper code completion and navigation. \n\nURLs in import specifiers are supported only for ECMAScript modules in the JavaScript language." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUrlImportUsage", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryLabelOnContinueStatementJS", - "shortDescription": { - "text": "Unnecessary label on 'continue' statement" - }, - "fullDescription": { - "text": "Reports a labeled 'continue' statement whose labels may be removed without changing the flow of control.", - "markdown": "Reports a labeled `continue` statement whose labels may be removed without changing the flow of control." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryLabelOnContinueStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ChainedEqualityJS", - "shortDescription": { - "text": "Chained equality" - }, - "fullDescription": { - "text": "Reports a chained equality comparison (i.e. 'a==b==c'). Such comparisons are confusing.", - "markdown": "Reports a chained equality comparison (i.e. `a==b==c`). Such comparisons are confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ChainedEqualityComparisonsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SillyAssignmentJS", - "shortDescription": { - "text": "Variable is assigned to itself" - }, - "fullDescription": { - "text": "Reports an assignment in the form 'x = x'.", - "markdown": "Reports an assignment in the form `x = x`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SillyAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", - "shortDescription": { - "text": "Possibly incorrect target of indexed property access" - }, - "fullDescription": { - "text": "Reports a potentially invalid indexed property access, for example, 'Array[1]'.", - "markdown": "Reports a potentially invalid indexed property access, for example, `Array[1]`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidTargetOfIndexedPropertyAccess", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSAccessibilityCheck", - "shortDescription": { - "text": "Inaccessible @private and @protected members referenced" - }, - "fullDescription": { - "text": "Reports a reference to a JavaScript member that is marked with a '@private' or '@protected' tag but does not comply with visibility rules that these tags imply.", - "markdown": "Reports a reference to a JavaScript member that is marked with a `@private` or `@protected` tag but does not comply with visibility rules that these tags imply." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSAccessibilityCheck", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertRequireIntoImport", - "shortDescription": { - "text": "'require()' is used instead of 'import'" - }, - "fullDescription": { - "text": "Reports a 'require()' statement. Suggests converting it to a 'require()' call with an 'import' statement. Enable 'Convert require() inside inner scopes with Fix all action' to convert all 'require()' calls inside the nested functions and statements when using the 'Fix all' action. Please note that converting 'require()' statements inside inner scopes to 'import' statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. 'require()' calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. Clear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action.", - "markdown": "Reports a `require()` statement. Suggests converting it to a `require()` call with an `import` statement. \n\nEnable 'Convert require() inside inner scopes with Fix all action' to convert all `require()` calls inside the nested functions and statements when using the 'Fix all' action. \n\nPlease note that converting `require()` statements inside inner scopes to `import` statements may cause changes in the semantics of the code. Import statements are static module dependencies and are hoisted, which means that they are moved to the top of the current module. `require()` calls load modules dynamically. They can be executed conditionally, and their scope is defined by the expression in which they are used. \nClear the 'Convert require() inside inner scopes with Fix all action' checkbox to prevent any changes in these complex cases when using the 'Fix all' action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertRequireIntoImport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithMultipleLoopsJS", - "shortDescription": { - "text": "Function with multiple loops" - }, - "fullDescription": { - "text": "Reports a function with multiple loop statements.", - "markdown": "Reports a function with multiple loop statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMultipleLoopsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LabeledStatementJS", - "shortDescription": { - "text": "Labeled statement" - }, - "fullDescription": { - "text": "Reports a labeled statement.", - "markdown": "Reports a labeled statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LabeledStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedCatchParameterJS", - "shortDescription": { - "text": "Unused 'catch' parameter" - }, - "fullDescription": { - "text": "Reports a 'catch' parameter that is not used in the corresponding block. The 'catch' parameters named 'ignore' or 'ignored' are ignored. Use the checkbox below to disable this inspection for 'catch' blocks with comments.", - "markdown": "Reports a `catch` parameter that is not used in the corresponding block. The `catch` parameters named `ignore` or `ignored` are ignored.\n\n\nUse the checkbox below to disable this inspection for `catch`\nblocks with comments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedCatchParameterJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NpmUsedModulesInstalled", - "shortDescription": { - "text": "Missing module dependency" - }, - "fullDescription": { - "text": "Reports a module from a 'require()' call or an 'import' statement that is not installed or is not listed in package.json dependencies. Suggests installing the module and/or including it into package.json. For 'require()' calls, works only in the files from the scope of Node.js Core JavaScript library.", - "markdown": "Reports a module from a `require()` call or an `import` statement that is not installed or is not listed in package.json dependencies.\n\nSuggests installing the module and/or including it into package.json.\n\nFor `require()` calls, works only in the files from the scope of *Node.js Core* JavaScript library." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "NpmUsedModulesInstalled", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "WithStatementJS", - "shortDescription": { - "text": "'with' statement" - }, - "fullDescription": { - "text": "Reports a 'with' statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables.", - "markdown": "Reports a `with` statements. Such statements result in potentially confusing implicit bindings, and may behave strangely in setting new variables." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "WithStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptCheckImport", - "shortDescription": { - "text": "Unresolved imported name" - }, - "fullDescription": { - "text": "Reports an unresolved name or binding in an 'import' declaration in TypeScript code.", - "markdown": "Reports an unresolved name or binding in an `import` declaration in TypeScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptCheckImport", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSConstantReassignment", - "shortDescription": { - "text": "Attempt to assign to const or readonly variable" - }, - "fullDescription": { - "text": "Reports reassigning a value to a constant or a readonly variable.", - "markdown": "Reports reassigning a value to a constant or a readonly variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSConstantReassignment", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MagicNumberJS", - "shortDescription": { - "text": "Magic number" - }, - "fullDescription": { - "text": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored.", - "markdown": "Reports a \"magic number\" that is a numeric literal used without being named by a constant declaration. Magic numbers can result in code whose intention is unclear, and may result in errors if a magic number is changed in one code location but remains unchanged in another. The numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000, 0.0 and 1.0 are ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MagicNumberJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionNamingConventionJS", - "shortDescription": { - "text": "Function naming convention" - }, - "fullDescription": { - "text": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression for function names. Use the standard 'java.util.regex' format for regular expressions.", - "markdown": "Reports a function whose name is too short, too long, or does not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nfor function names. Use the standard `java.util.regex` format for regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXSyntaxUsed", - "shortDescription": { - "text": "JSX syntax used" - }, - "fullDescription": { - "text": "Reports a usage of a JSX tag in JavaScript code.", - "markdown": "Reports a usage of a JSX tag in JavaScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSXSyntaxUsed", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSJoinVariableDeclarationAndAssignment", - "shortDescription": { - "text": "Variable declaration can be merged with the first assignment to the variable" - }, - "fullDescription": { - "text": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression.", - "markdown": "Reports a variable that is declared without an initializer and is used much further in the code or in a single nested scope. Suggests moving the variable closer to its usages and joining it with the initializer expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSJoinVariableDeclarationAndAssignment", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSRedundantSwitchStatement", - "shortDescription": { - "text": "'switch' statement is redundant and can be replaced" - }, - "fullDescription": { - "text": "Reports a 'switch' statement with an empty body, or with only one 'case' branch, or with a 'default' branch only.", - "markdown": "Reports a `switch` statement with an empty body, or with only one `case` branch, or with a `default` branch only." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSRedundantSwitchStatement", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptLibrary", - "shortDescription": { - "text": "Missing global library" - }, - "fullDescription": { - "text": "Reports a TypeScript library file that is required for a symbol but is not listed under the 'lib' compiler option in 'tsconfig.json'.", - "markdown": "Reports a TypeScript library file that is required for a symbol but is not listed under the `lib` compiler option in `tsconfig.json`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptLibrary", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptMissingAugmentationImport", - "shortDescription": { - "text": "Missing augmentation import" - }, - "fullDescription": { - "text": "Reports a usage from augmentation module without an explicit import.", - "markdown": "Reports a usage from [augmentation module](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation) without an explicit import." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptMissingAugmentationImport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnusedGlobalSymbols", - "shortDescription": { - "text": "Unused global symbol" - }, - "fullDescription": { - "text": "Reports an unused globally accessible public function, variable, class, or property.", - "markdown": "Reports an unused globally accessible public function, variable, class, or property." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnusedGlobalSymbols", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unused symbols", - "index": 19, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertModuleExportToExport", - "shortDescription": { - "text": "'module.exports' is used instead of 'export'" - }, - "fullDescription": { - "text": "Reports a 'module.export' statement. Suggests replacing it with an 'export' or 'export default' statement. Please note that the quick-fix for converting 'module.export' into 'export' is not available for 'module.export' inside functions or statements because 'export' statements can only be at the top level of a module.", - "markdown": "Reports a `module.export` statement. Suggests replacing it with an `export` or `export default` statement. \n\nPlease note that the quick-fix for converting `module.export` into `export` is not available for `module.export` inside functions or statements because `export` statements can only be at the top level of a module." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertModuleExportToExport", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DocumentWriteJS", - "shortDescription": { - "text": "Call to 'document.write()'" - }, - "fullDescription": { - "text": "Reports a method call to 'document.write()' or 'document.writeln()'. Most usages of such calls are performed better with explicit DOM calls, such as 'getElementByID()' and 'createElement()'. Additionally, the 'write()' and 'writeln()' calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs.", - "markdown": "Reports a method call to `document.write()` or `document.writeln()`. Most usages of such calls are performed better with explicit DOM calls, such as `getElementByID()` and `createElement()`. Additionally, the `write()` and `writeln()` calls will not work with XML DOMs, including DOMs for XHTML if viewed as XML. This can result in difficulty to point out bugs." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DocumentWriteJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/DOM issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "BlockStatementJS", - "shortDescription": { - "text": "Unnecessary block statement" - }, - "fullDescription": { - "text": "Reports a block statement that is not used as the body of 'if', 'for', 'while', 'do', 'with', or 'try' statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for 'let' and 'const' variables, but still free-standing block statements may be confusing and result in subtle bugs when used with 'var' variables.", - "markdown": "Reports a block statement that is not used as the body of `if`, `for`, `while`, `do`, `with`, or `try` statements, or as the body of a function declaration. Starting from ECMAScript 6, JavaScript blocks introduce new scopes for `let` and `const` variables, but still free-standing block statements may be confusing and result in subtle bugs when used with `var` variables." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "BlockStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AnonymousFunctionJS", - "shortDescription": { - "text": "Anonymous function" - }, - "fullDescription": { - "text": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a 'name' property specified in the ECMAScript 6 standard. For example, 'var bar = function() {};' is not reported.", - "markdown": "Reports an anonymous function. An explicit name of a function expression may be helpful for debugging. Ignores function expressions without names if they have a `name` property specified in the ECMAScript 6 standard. For example, `var bar = function() {};` is not reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AnonymousFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially undesirable code constructs", - "index": 15, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ObjectAllocationIgnoredJS", - "shortDescription": { - "text": "Result of object allocation ignored" - }, - "fullDescription": { - "text": "Reports object allocation where the result of the allocated object is ignored, for example, 'new Error();' as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy.", - "markdown": "Reports object allocation where the result of the allocated object is ignored, for example, `new Error();` as a statement, without any assignment. Such allocation expressions may indicate an odd object initialization strategy." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ObjectAllocationIgnored", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InfiniteRecursionJS", - "shortDescription": { - "text": "Infinite recursion" - }, - "fullDescription": { - "text": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally.", - "markdown": "Reports a function which must either recurse infinitely or throw an exception. Such functions may not return normally." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InfiniteRecursionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSTypeOfValues", - "shortDescription": { - "text": "'typeof' comparison with non-standard value" - }, - "fullDescription": { - "text": "Reports a comparison of a 'typeof' expression with a literal string which is not one of the standard types: 'undefined', 'object', 'boolean', 'number', 'string', 'function', or 'symbol'. Such comparisons always return 'false'.", - "markdown": "Reports a comparison of a `typeof` expression with a literal string which is not one of the standard types: `undefined`, `object`, `boolean`, `number`, `string`, `function`, or `symbol`. Such comparisons always return `false`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSTypeOfValues", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedConditionalExpressionJS", - "shortDescription": { - "text": "Nested conditional expression" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic.", - "markdown": "Reports a ternary conditional expression within another ternary condition. Such nested conditionals may be extremely confusing, and best replaced by more explicit conditional logic." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedConditionalExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncompatibleMaskJS", - "shortDescription": { - "text": "Incompatible bitwise mask operation" - }, - "fullDescription": { - "text": "Reports a bitwise mask expression which for sure evaluates to 'true' or 'false'. Expressions are of the form '(var & constant1) == constant2' or '(var | constant1) == constant2', where 'constant1' and 'constant2' are incompatible bitmask constants. Example: '// Incompatible mask: as the last byte in mask is zero,\n// something like 0x1200 would be possible, but not 0x1234\nif ((mask & 0xFF00) == 0x1234) {...}'", - "markdown": "Reports a bitwise mask expression which for sure evaluates to `true` or `false`. Expressions are of the form `(var & constant1) == constant2` or `(var | constant1) == constant2`, where `constant1` and `constant2` are incompatible bitmask constants.\n\nExample:\n\n\n // Incompatible mask: as the last byte in mask is zero,\n // something like 0x1200 would be possible, but not 0x1234\n if ((mask & 0xFF00) == 0x1234) {...}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IncompatibleBitwiseMaskOperation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6PossiblyAsyncFunction", - "shortDescription": { - "text": "'await' in non-async function" - }, - "fullDescription": { - "text": "Reports a usage of 'await' in a function that was possibly intended to be async but is actually missing the 'async' modifier. Although 'await' can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made 'async'.", - "markdown": "Reports a usage of `await` in a function that was possibly intended to be async but is actually missing the `async` modifier. Although `await` can be used as an identifier, it is likely that it was intended to be used as an operator, so the containing function should be made `async`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6PossiblyAsyncFunction", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TextLabelInSwitchStatementJS", - "shortDescription": { - "text": "Text label in 'switch' statement" - }, - "fullDescription": { - "text": "Reports a labeled statement inside a 'switch' statement, which often results from a typo. Example: 'switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }'", - "markdown": "Reports a labeled statement inside a `switch` statement, which often results from a typo.\n\nExample:\n\n\n switch(x)\n {\n case 1:\n case2: //typo!\n case 3:\n break;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TextLabelInSwitchStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyCatchBlockJS", - "shortDescription": { - "text": "Empty 'catch' block" - }, - "fullDescription": { - "text": "Reports an empty 'catch' block. This indicates that errors are simply ignored instead of handling them. Any comment in a 'catch' block mutes the inspection.", - "markdown": "Reports an empty `catch` block. This indicates that errors are simply ignored instead of handling them. \n\nAny comment in a `catch` block mutes the inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyCatchBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSHint", - "shortDescription": { - "text": "JSHint" - }, - "fullDescription": { - "text": "Reports a problem detected by the JSHint linter.", - "markdown": "Reports a problem detected by the [JSHint](https://jshint.com/) linter." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSHint", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FlowJSFlagCommentPlacement", - "shortDescription": { - "text": "Misplaced @flow flag" - }, - "fullDescription": { - "text": "Reports a '@flow' flag comment that is not located at the top of a file.", - "markdown": "Reports a `@flow` flag comment that is not located at the top of a file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FlowJSFlagCommentPlacement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Flow type checker", - "index": 16, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Eslint", - "shortDescription": { - "text": "ESLint" - }, - "fullDescription": { - "text": "Reports a discrepancy detected by the ESLint linter. The highlighting is based on the rule severity specified in the ESLint configuration file for each individual rule. Clear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules.", - "markdown": "Reports a discrepancy detected by the [ESLint](https://eslint.org) linter. \n\nThe highlighting is based on the rule severity specified in the [ESLint configuration file](https://eslint.org/docs/user-guide/configuring) for each individual rule. \n\nClear the 'Use rule severity from the configuration file' checkbox to use the severity configured in this inspection for all ESLint rules." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "Eslint", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDuplicatedDeclaration", - "shortDescription": { - "text": "Duplicate declaration" - }, - "fullDescription": { - "text": "Reports multiple declarations in a scope.", - "markdown": "Reports multiple declarations in a scope." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSDuplicatedDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSEqualityComparisonWithCoercion.TS", - "shortDescription": { - "text": "Equality operator may cause type coercion" - }, - "fullDescription": { - "text": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing '==' or '!=' equality operators with type-safe '===' or '!==' operators. Depending on the option selected, one of the following cases will be reported: All usages of '==' and '!=' operators. All usages except comparison with null. Some code styles allow using 'x == null' as a replacement for 'x === null || x === undefined'. Only suspicious expressions, such as: '==' or '!=' comparisons with '0', '''', 'null', 'true', 'false', or 'undefined'.", - "markdown": "Reports a usage of equality operators may cause unexpected type coercions. Suggests replacing `==` or `!=` equality operators with type-safe `===` or `!==` operators.\n\nDepending on the option selected, one of the following cases will be reported:\n\n* All usages of `==` and `!=` operators.\n* All usages except comparison with null. Some code styles allow using `x == null` as a replacement for `x === null || x === undefined`.\n* Only suspicious expressions, such as: `==` or `!=` comparisons with `0`, `''`, `null`, `true`, `false`, or `undefined`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EqualityComparisonWithCoercionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSOctalInteger", - "shortDescription": { - "text": "Octal integer" - }, - "fullDescription": { - "text": "Reports a deprecated octal integer literal prefixed with '0' instead of '0o'. Such literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. To force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below.", - "markdown": "Reports a deprecated octal integer literal prefixed with `0` instead of `0o`. \nSuch literals are not allowed in modern ECMAScript code, and using them in the strict mode is an error. \nTo force this inspection for ES5 and ES3 language levels, select the 'Warn about obsolete octal literals in ES5- code' checkbox below." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSOctalInteger", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ExceptionCaughtLocallyJS", - "shortDescription": { - "text": "Exception used for local control-flow" - }, - "fullDescription": { - "text": "Reports a 'throw' statement whose exceptions are always caught by the containing 'try' statement. Using 'throw' statements as a 'goto' to change the local flow of control is confusing.", - "markdown": "Reports a `throw` statement whose exceptions are always caught by the containing `try` statement. Using `throw` statements as a `goto` to change the local flow of control is confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ExceptionCaughtLocallyJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThrowFromFinallyBlockJS", - "shortDescription": { - "text": "'throw' inside 'finally' block" - }, - "fullDescription": { - "text": "Reports s 'throw' statement inside a 'finally' block. Such 'throw' statements may mask exceptions thrown, and complicate debugging.", - "markdown": "Reports s `throw` statement inside a `finally` block. Such `throw` statements may mask exceptions thrown, and complicate debugging." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ThrowInsideFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptValidateGenericTypes", - "shortDescription": { - "text": "Incorrect generic type argument" - }, - "fullDescription": { - "text": "Reports an invalid type argument in a function, interface, or class declaration.", - "markdown": "Reports an invalid type argument in a function, interface, or class declaration." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "TypeScriptValidateGenericTypes", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CyclomaticComplexityJS", - "shortDescription": { - "text": "Overly complex function" - }, - "fullDescription": { - "text": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test. Use the field provided below to specify the maximum acceptable cyclomatic complexity for a function.", - "markdown": "Reports a function with too many branching points in a function (too high cyclomatic complexity). Such functions may be confusing and hard to test.\n\n\nUse the field provided below to specify the maximum acceptable cyclomatic complexity for a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMismatchedCollectionQueryUpdate", - "shortDescription": { - "text": "Mismatched query and update of collection" - }, - "fullDescription": { - "text": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error. Query methods are automatically detected, based on whether they return something, or a callback is passed to them. Use the table below to specify which methods are update methods.", - "markdown": "Reports a collection of fields or variables whose contents are either queried and not updated or updated and not queried. Such mismatched queries and updates are pointless and may indicate either dead code or a typographical error.\n\n\nQuery methods are automatically detected, based on whether they return something, or a callback is passed to them.\nUse the table below to specify which methods are update methods." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSMismatchedCollectionQueryUpdate", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PackageJsonMismatchedDependency", - "shortDescription": { - "text": "Mismatched dependencies in package.json" - }, - "fullDescription": { - "text": "Reports a dependency from package.json that is not installed or doesn't match the specified version range.", - "markdown": "Reports a dependency from package.json that is not installed or doesn't match the specified [version range](https://docs.npmjs.com/about-semantic-versioning)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PackageJsonMismatchedDependency", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSPotentiallyInvalidUsageOfThis", - "shortDescription": { - "text": "Potentially invalid reference to 'this' from closure" - }, - "fullDescription": { - "text": "Reports a 'this' in closure that is used for referencing properties of outer context. Example: 'function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n}'", - "markdown": "Reports a `this` in closure that is used for referencing properties of outer context.\n\nExample:\n\n\n function Outer() {\n this.outerProp = 1;\n function inner() {\n // bad, because 'outerProp' of Outer\n // won't be updated here\n // on calling 'new Outer()' as may be expected\n this.outerProp = 2;\n }\n inner();\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSPotentiallyInvalidUsageOfThis", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSMissingSwitchDefault", - "shortDescription": { - "text": "'switch' statement has no 'default' branch" - }, - "fullDescription": { - "text": "Reports a 'switch' statement without a 'default' clause when some possible values are not enumerated.", - "markdown": "Reports a `switch` statement without a `default` clause when some possible values are not enumerated." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSMissingSwitchDefault", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSXNamespaceValidation", - "shortDescription": { - "text": "Missing JSX namespace" - }, - "fullDescription": { - "text": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation.", - "markdown": "Reports a usage of a JSX construction without importing namespace. Having the namespace in the file scope ensures proper code compilation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSXNamespaceValidation", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnresolvedLibraryURL", - "shortDescription": { - "text": "Missed locally stored library for HTTP link" - }, - "fullDescription": { - "text": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation.", - "markdown": "Reports a URL of an external JavaScript library that is not associated with any locally stored file. Suggests downloading the library. Such association enables the IDE to provide proper code completion and navigation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnresolvedLibraryURL", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6PreferShortImport", - "shortDescription": { - "text": "Import can be shortened" - }, - "fullDescription": { - "text": "Reports an ES6 import whose 'from' part can be shortened. Suggests importing the parent directory.", - "markdown": "Reports an ES6 import whose `from` part can be shortened. Suggests importing the parent directory." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ES6PreferShortImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PointlessBitwiseExpressionJS", - "shortDescription": { - "text": "Bitwise expression can be simplified" - }, - "fullDescription": { - "text": "Reports an expression that includes 'and' with zero, 'or' by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings.", - "markdown": "Reports an expression that includes `and` with zero, `or` by zero, or shifting by zero. Such expressions may result from not fully completed automated refactorings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PointlessBitwiseExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Bitwise operation issues", - "index": 21, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InfiniteLoopJS", - "shortDescription": { - "text": "Infinite loop statement" - }, - "fullDescription": { - "text": "Reports a 'for', 'while', or 'do' statement which can only exit by throwing an exception. Such statements often indicate coding errors.", - "markdown": "Reports a `for`, `while`, or `do` statement which can only exit by throwing an exception. Such statements often indicate coding errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InfiniteLoopJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSStringConcatenationToES6Template", - "shortDescription": { - "text": "String concatenation is used instead of template literal" - }, - "fullDescription": { - "text": "Reports a string concatenation. Suggests replacing it with a template literal Example '\"result: \" + a + \".\"' After applying the quick-fix the code looks as follows: '`result: ${a}.`'", - "markdown": "Reports a string concatenation. Suggests replacing it with a [template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)\n\nExample\n\n \"result: \" + a + \".\" \n\nAfter applying the quick-fix the code looks as follows:\n\n `result: ${a}.` \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSStringConcatenationToES6Template", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSArrowFunctionBracesCanBeRemoved", - "shortDescription": { - "text": "Redundant braces around arrow function body" - }, - "fullDescription": { - "text": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces. 'let incrementer = (x) => {return x + 1};' After the quick-fix is applied, the code fragment looks as follows: 'let incrementer = (x) => x + 1;'", - "markdown": "Reports an arrow function whose body only consists of braces and exactly one statement. Suggests converting to concise syntax without braces.\n\n\n let incrementer = (x) => {return x + 1};\n\nAfter the quick-fix is applied, the code fragment looks as follows:\n\n\n let incrementer = (x) => x + 1;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSArrowFunctionBracesCanBeRemoved", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReplaceAssignmentWithOperatorAssignmentJS", - "shortDescription": { - "text": "Assignment could be replaced with operator assignment" - }, - "fullDescription": { - "text": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer. Example: 'x = x + 3;'\n 'x = x / 3;'\n After the quick fix is applied the result looks like: 'x += 3;'\n 'x /= 3;'", - "markdown": "Reports an assignment operation that can be replaced by an operator assignment to make your code shorter and probably clearer.\n\n\nExample:\n\n x = x + 3;\n x = x / 3;\n\nAfter the quick fix is applied the result looks like:\n\n x += 3;\n x /= 3;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "AssignmentReplaceableWithOperatorAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSFileReferences", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references.", - "markdown": "Reports an unresolved file reference in a JavaScript file, including CommonJS and AMD modules references." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSFileReferences", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithInconsistentReturnsJS", - "shortDescription": { - "text": "Function with inconsistent returns" - }, - "fullDescription": { - "text": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error. Example: 'function foo() {\n if (true)\n return 3;\n return;\n}'", - "markdown": "Reports a function that returns a value in some cases while in other cases no value is returned. This usually indicates an error.\n\nExample:\n\n\n function foo() {\n if (true)\n return 3;\n return;\n }\n\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithInconsistentReturnsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyTryBlockJS", - "shortDescription": { - "text": "Empty 'try' block" - }, - "fullDescription": { - "text": "Reports an empty 'try' block, which usually indicates an error.", - "markdown": "Reports an empty `try` block, which usually indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyTryBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ClassMemberInitializationOrder", - "shortDescription": { - "text": "Use of possibly unassigned property in a static initializer" - }, - "fullDescription": { - "text": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. Initialization of class members happens consequently for fields, so a field cannot reference another field that is declared later.", - "markdown": "Reports a class member initializer which references another non-hoisted class member while the latter may be not initialized yet. \n\nInitialization of class members happens consequently for fields, so a field cannot reference another field that is declared later." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ES6ClassMemberInitializationOrder", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReservedWordUsedAsNameJS", - "shortDescription": { - "text": "Reserved word used as name" - }, - "fullDescription": { - "text": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords.", - "markdown": "Reports a JavaScript reserved word used as a name. The JavaScript specification reserves a number of words which are currently not used as keywords. Using those words as identifiers may result in broken code if later versions of JavaScript start using them as keywords." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReservedWordAsName", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSClassNamingConvention", - "shortDescription": { - "text": "Class naming convention" - }, - "fullDescription": { - "text": "Reports a class or a function that is annotated with a JSDoc '@constructor' or '@class' tag whose names are too short, too long, or do not follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for classes names. Use the standard 'java.util.regex' format for regular expressions.", - "markdown": "Reports a class or a function that is annotated with a JSDoc `@constructor` or `@class` tag whose names are too short, too long, or do not follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for classes names. Use the standard `java.util.regex` format for regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSClassNamingConvention", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedFunctionJS", - "shortDescription": { - "text": "Nested function" - }, - "fullDescription": { - "text": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing. Use the checkbox below to ignore anonymous nested functions.", - "markdown": "Reports a function nested inside another function. Although JavaScript allows functions to be nested, such constructs may be confusing.\n\n\nUse the checkbox below to ignore anonymous nested functions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XHTMLIncompatabilitiesJS", - "shortDescription": { - "text": "Incompatible XHTML usages" - }, - "fullDescription": { - "text": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include document.body, document.images, document.applets, document.links, document.forms, and document.anchors.", - "markdown": "Reports common JavaScript DOM patterns which may present problems with XHTML documents. In particular, the patterns detected will behave completely differently depending on whether the document is loaded as XML or HTML. This can result in subtle bugs where script behaviour is dependent on the MIME-type of the document, rather than its content. Patterns detected include **document.body** , **document.images** , **document.applets** , **document.links** , **document.forms** , and **document.anchors**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XHTMLIncompatabilitiesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/DOM issues", - "index": 51, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncrementDecrementResultUsedJS", - "shortDescription": { - "text": "Result of increment or decrement used" - }, - "fullDescription": { - "text": "Reports an increment ('++') or decrement ('--') expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: 'var a = b++'", - "markdown": "Reports an increment (`++`) or decrement (`--`) expression where the result of the assignment is used in a containing expression. Such assignments can result in confusion due to the order of operations, as evaluation of the assignment may affect the outer expression in unexpected ways. Example: `var a = b++`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IncrementDecrementResultUsedJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SuspiciousTypeOfGuard", - "shortDescription": { - "text": "Unsound type guard check" - }, - "fullDescription": { - "text": "Reports a 'typeof' or 'instanceof' unsound type guard check. The 'typeof x' type guard can be unsound in one of the following two cases: 'typeof x' never corresponds to the specified value (for example, 'typeof x === 'number'' when 'x' is of the type 'string | boolean') 'typeof x' always corresponds to the specified value (for example, 'typeof x === 'string'' when 'x' is of the type 'string') The 'x instanceof A' type guard can be unsound in one of the following two cases: The type of 'x' is not related to 'A' The type of 'x' is 'A' or a subtype of 'A'", - "markdown": "Reports a `typeof` or `instanceof` unsound type guard check. The `typeof x` type guard can be unsound in one of the following two cases:\n\n* `typeof x` never corresponds to the specified value (for example, `typeof x === 'number'` when `x` is of the type 'string \\| boolean')\n* `typeof x` always corresponds to the specified value (for example, `typeof x === 'string'` when `x` is of the type 'string')\n\nThe `x instanceof A` type guard can be unsound in one of the following two cases:\n\n* The type of `x` is not related to `A`\n* The type of `x` is `A` or a subtype of `A`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SuspiciousTypeOfGuard", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptJSXUnresolvedComponent", - "shortDescription": { - "text": "Unresolved JSX component" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name. The template for a new component can be modified in Editor | File and Code Templates.", - "markdown": "Reports an unresolved reference to a JSX component. Suggests adding an import statement if the referenced component is defined in the project or its dependencies or creating a new component with the specified name.\n\nThe template for a new component can be modified in Editor \\| File and Code Templates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptJSXUnresolvedComponent", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptFieldCanBeMadeReadonly", - "shortDescription": { - "text": "Field can be readonly" - }, - "fullDescription": { - "text": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor).", - "markdown": "Reports a private field that can be made readonly (for example, if the field is assigned only in the constructor)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptFieldCanBeMadeReadonly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6DestructuringVariablesMerge", - "shortDescription": { - "text": "Destructuring properties with the same key" - }, - "fullDescription": { - "text": "Reports multiple destructuring properties with identical keys. Suggests merging the properties.", - "markdown": "Reports multiple destructuring properties with identical keys. Suggests merging the properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6DestructuringVariablesMerge", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LoopStatementThatDoesntLoopJS", - "shortDescription": { - "text": "Loop statement that doesn't loop" - }, - "fullDescription": { - "text": "Reports a 'for', 'while', or 'do' statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error.", - "markdown": "Reports a `for`, `while`, or `do` statement whose bodies are guaranteed to execute at most once. Normally, this indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LoopStatementThatDoesntLoopJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NegatedIfStatementJS", - "shortDescription": { - "text": "Negated 'if' statement" - }, - "fullDescription": { - "text": "Reports if statements which have an else branch and a negated condition. Flipping the order of the if and else branches will usually increase the clarity of such statements.", - "markdown": "Reports **if** statements which have an **else** branch and a negated condition. Flipping the order of the **if** and **else** branches will usually increase the clarity of such statements." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NegatedIfStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSNonASCIINames", - "shortDescription": { - "text": "Identifiers with non-ASCII symbols" - }, - "fullDescription": { - "text": "Reports a non-ASCII symbol in a name. If the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. Otherwise reports all names that contain both ASCII and non-ASCII symbols.", - "markdown": "Reports a non-ASCII symbol in a name. \n\nIf the 'Allow only ASCII names' option is selected, reports all names that contain non-ASCII symbols. \nOtherwise reports all names that contain both ASCII and non-ASCII symbols." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSNonASCIINames", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptRedundantGenericType", - "shortDescription": { - "text": "Redundant type arguments" - }, - "fullDescription": { - "text": "Reports a type argument that is equal to the default one and can be removed. Example: 'type Foo = T;\nlet z: Foo;'", - "markdown": "Reports a type argument that is equal to the default one and can be removed.\n\n\nExample:\n\n\n type Foo = T;\n let z: Foo;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptRedundantGenericType", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptUMDGlobal", - "shortDescription": { - "text": "Referenced UMD global variable" - }, - "fullDescription": { - "text": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly.", - "markdown": "Reports a usage of a Universal Module Definition (UMD) global variable if the current file is a module (ECMAScript or CommonJS). Referencing UMD variables without explicit imports can lead to a runtime error if the library isn't included implicitly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptUMDGlobal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnnecessaryReturnJS", - "shortDescription": { - "text": "Unnecessary 'return' statement" - }, - "fullDescription": { - "text": "Reports an unnecessary 'return' statement, that is, a 'return' statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed.", - "markdown": "Reports an unnecessary `return` statement, that is, a `return` statement that returns no value and occurs just before the function would have \"fallen through\" the bottom. These statements may be safely removed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnnecessaryReturnStatementJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConditionalExpressionWithIdenticalBranchesJS", - "shortDescription": { - "text": "Conditional expression with identical branches" - }, - "fullDescription": { - "text": "Reports a ternary conditional expression with identical 'then' and 'else' branches.", - "markdown": "Reports a ternary conditional expression with identical `then` and `else` branches." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConditionalExpressionWithIdenticalBranchesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSIncompatibleTypesComparison", - "shortDescription": { - "text": "Comparison of expressions having incompatible types" - }, - "fullDescription": { - "text": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values.", - "markdown": "Reports a comparison with operands of incompatible types or an operand with a type without possible common values." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSIncompatibleTypesComparison", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnfilteredForInLoop", - "shortDescription": { - "text": "Unfiltered for..in loop" - }, - "fullDescription": { - "text": "Reports unfiltered 'for-in' loops. The use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when 'Object''s prototype may be incorrectly modified. For example, the following code will print 42 and myMethod: 'Object.prototype.myMethod = function myMethod() {};\nlet a = { foo: 42 };\nfor (let i in a) {\n console.log(a[i]);\n}' Suggests replacing the whole loop with a 'Object.keys()' method or adding a 'hasOwnProperty()' check. After applying the quick-fix the code looks as follows: 'for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n}'", - "markdown": "Reports unfiltered `for-in` loops. \n\nThe use of this construct results in processing not only own properties of an object but properties from its prototype as well. It may be unexpected in some specific cases, for example, in utility methods that copy or modify all properties or when `Object`'s prototype may be incorrectly modified. For example, the following code will print **42** and **myMethod** : \n\n\n Object.prototype.myMethod = function myMethod() {};\n let a = { foo: 42 };\n for (let i in a) {\n console.log(a[i]);\n }\n\nSuggests replacing the whole loop with a `Object.keys()` method or adding a `hasOwnProperty()` check. After applying the quick-fix the code looks as follows:\n\n\n for (let i in a) {\n if (a.hasOwnProperty(i)) {\n console.log(a[i]);\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnfilteredForInLoop", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSAnnotator", - "shortDescription": { - "text": "ECMAScript specification is not followed" - }, - "fullDescription": { - "text": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. Generally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors.", - "markdown": "Reports basic syntax issues and inconsistencies with language specification, such as invalid usages of keywords, usages of incompatible numeric format, or multiple parameters to getters/setters. \nGenerally, such errors must always be reported and shouldn't be disabled. But in some cases, such as issues due to the dynamic nature of JavaScript, the use of not yet supported language features, or bugs in IDE's checker, it may be handy to disable reporting these very basic errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JSAnnotator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSLastCommaInObjectLiteral", - "shortDescription": { - "text": "Unneeded last comma in object literal" - }, - "fullDescription": { - "text": "Reports usages of a trailing comma in object literals. The warning is reported only when the JavaScript language version is set to ECMAScript 5.1. Trailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used. You can configure formatting options for trailing commas in Code Style | JavaScript or TypeScript | Punctuation.", - "markdown": "Reports usages of a trailing comma in object literals.\n\nThe warning is reported only when the JavaScript language version is set to ECMAScript 5.1.\n\nTrailing commas in object literals are allowed by the specification, however, some browsers might throw an error when a trailing comma is used.\n\nYou can configure formatting options for trailing commas in **Code Style** \\| **JavaScript** or **TypeScript** \\| **Punctuation**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSLastCommaInObjectLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSFunctionExpressionToArrowFunction", - "shortDescription": { - "text": "Function expression is used instead of arrow function" - }, - "fullDescription": { - "text": "Reports a function expression. Suggests converting it to an arrow function. Example: 'arr.map(function(el) {return el + 1})' After applying the quick-fix the code looks as follows: 'arr.map(el => el + 1)'", - "markdown": "Reports a [function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function) expression. Suggests converting it to an [arrow function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions).\n\nExample:\n\n arr.map(function(el) {return el + 1})\n\nAfter applying the quick-fix the code looks as follows:\n\n arr.map(el => el + 1)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSFunctionExpressionToArrowFunction", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6TopLevelAwaitExpression", - "shortDescription": { - "text": "Top-level 'await' expression" - }, - "fullDescription": { - "text": "Reports a usage of a top-level 'await' expression. While the new 'top-level async' proposal is on its way, using 'await' outside async functions is not allowed.", - "markdown": "Reports a usage of a top-level `await` expression. While the new 'top-level async' proposal is on its way, using `await` outside async functions is not allowed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "ES6TopLevelAwaitExpression", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6MissingAwait", - "shortDescription": { - "text": "Missing await for an async function call" - }, - "fullDescription": { - "text": "Reports an 'async' function call without an expected 'await' prefix inside an 'async' function. Such call returns a 'Promise' and control flow is continued immediately. Example: 'async function bar() { /* ... */ }\nasync function foo() {\n bar(); // bad\n}' After the quick-fix is applied, the 'await' prefix is added: 'async function bar() { /* ... */ }\nasync function foo() {\n await bar(); // good\n}' When the 'Report for promises in return statements' checkbox is selected, also suggests adding 'await' in return statements. While this is generally not necessary, it gives two main benefits. You won't forget to add 'await' when surrounding your code with 'try-catch'. An explicit 'await' helps V8 runtime to provide async stack traces.", - "markdown": "Reports an `async` function call without an expected `await` prefix inside an `async` function. Such call returns a `Promise` and control flow is continued immediately.\n\nExample:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n bar(); // bad\n }\n\n\nAfter the quick-fix is applied, the `await` prefix is added:\n\n\n async function bar() { /* ... */ }\n async function foo() {\n await bar(); // good\n }\n\nWhen the 'Report for promises in return statements' checkbox is selected, also suggests adding `await` in return statements. \nWhile this is generally not necessary, it gives two main benefits. \n\n* You won't forget to add `await` when surrounding your code with `try-catch`.\n* An explicit `await` helps V8 runtime to provide [async stack traces](https://bit.ly/v8-zero-cost-async-stack-traces)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6MissingAwait", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TailRecursionJS", - "shortDescription": { - "text": "Tail recursion" - }, - "fullDescription": { - "text": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments.", - "markdown": "Reports a tail recursion, that is, when a function calls itself as its last action before returning. A tail recursion can always be replaced by looping, which will be considerably faster. Some JavaScript engines perform this optimization, while others do not. Thus, tail recursive solutions may have considerably different performance characteristics in different environments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TailRecursionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Control flow issues", - "index": 2, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6ConvertToForOf", - "shortDescription": { - "text": "'for..in' is used instead of 'for..of'" - }, - "fullDescription": { - "text": "Reports a usage of a 'for..in' loop on an array. Suggests replacing it with a 'for..of' loop. 'for..of' loops, which are introduced in ECMAScript 6, iterate over 'iterable' objects. For arrays, this structure is preferable to 'for..in', because it works only with array values but not with array object's properties.", - "markdown": "Reports a usage of a [for..in](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) loop on an array. Suggests replacing it with a [for..of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) loop. \n`for..of` loops, which are introduced in ECMAScript 6, iterate over `iterable` objects. For arrays, this structure is preferable to `for..in`, because it works only with array values but not with array object's properties." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6ConvertToForOf", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/ES2015 migration aids", - "index": 22, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ParameterNamingConventionJS", - "shortDescription": { - "text": "Function parameter naming convention" - }, - "fullDescription": { - "text": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length and regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", - "markdown": "Reports a function parameter whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length and regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ParameterNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUndefinedPropertyAssignment", - "shortDescription": { - "text": "Undefined property assignment" - }, - "fullDescription": { - "text": "Reports an assignment to a property that is not defined in the type of a variable. Example: '/**\n * @type {{ property1: string, property2: number }}\n */\nlet myVariable = create();\n\nmyVariable.newProperty = 3; // bad'", - "markdown": "Reports an assignment to a property that is not defined in the type of a variable.\n\nExample:\n\n\n /**\n * @type {{ property1: string, property2: number }}\n */\n let myVariable = create();\n\n myVariable.newProperty = 3; // bad\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSUndefinedPropertyAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StandardJS", - "shortDescription": { - "text": "Standard code style" - }, - "fullDescription": { - "text": "Reports a discrepancy detected by the JavaScript Standard Style linter. The highlighting severity in the editor is based on the severity level the linter reports.", - "markdown": "Reports a discrepancy detected by the [JavaScript Standard Style](https://standardjs.com/) linter. \n\nThe highlighting severity in the editor is based on the severity level the linter reports." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "StandardJS", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code quality tools", - "index": 53, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ParametersPerFunctionJS", - "shortDescription": { - "text": "Function with too many parameters" - }, - "fullDescription": { - "text": "Reports a function with too many parameters. Such functions often indicate problems with design. Use the field below to specify the maximum acceptable number of parameters for a function.", - "markdown": "Reports a function with too many parameters. Such functions often indicate problems with design.\n\n\nUse the field below to specify the maximum acceptable number of parameters for a function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexFunctionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThisExpressionReferencesGlobalObjectJS", - "shortDescription": { - "text": "'this' expression which references the global object" - }, - "fullDescription": { - "text": "Reports a 'this' expression outside an object literal or a constructor body. Such 'this' expressions reference the top-level \"global\" JavaScript object, but are mostly useless.", - "markdown": "Reports a `this` expression outside an object literal or a constructor body. Such `this` expressions reference the top-level \"global\" JavaScript object, but are mostly useless." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ThisExpressionReferencesGlobalObjectJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Validity issues", - "index": 27, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NestedAssignmentJS", - "shortDescription": { - "text": "Nested assignment" - }, - "fullDescription": { - "text": "Reports an assignment expression nested inside another expression, for example, 'a = b = 1'. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing.", - "markdown": "Reports an assignment expression nested inside another expression, for example, `a = b = 1`. Such expressions may be confusing and violate the general design principle that a given construct should do precisely one thing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NestedAssignmentJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Assignment issues", - "index": 40, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DefaultNotLastCaseInSwitchJS", - "shortDescription": { - "text": "'default' not last case in 'switch'" - }, - "fullDescription": { - "text": "Reports a 'switch' statement where the 'default' case comes before another case instead of being the very last case, which may cause confusion.", - "markdown": "Reports a `switch` statement where the `default` case comes before another case instead of being the very last case, which may cause confusion." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DefaultNotLastCaseInSwitchJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Switch statement issues", - "index": 50, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ConfusingPlusesOrMinusesJS", - "shortDescription": { - "text": "Confusing sequence of '+' or '-'" - }, - "fullDescription": { - "text": "Reports a suspicious combination of '+' or '-' characters in JavaScript code (for example, 'a+++b'. Such sequences are confusing, and their semantics may change through changes in the whitespace.", - "markdown": "Reports a suspicious combination of `+` or `-` characters in JavaScript code (for example, `a+++b`. Such sequences are confusing, and their semantics may change through changes in the whitespace." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ConfusingPlusesOrMinusesJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSDeprecatedSymbols", - "shortDescription": { - "text": "Deprecated symbol used" - }, - "fullDescription": { - "text": "Reports a usage of a deprecated function variable.", - "markdown": "Reports a usage of a deprecated function variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSDeprecatedSymbols", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LocalVariableNamingConventionJS", - "shortDescription": { - "text": "Local variable naming convention" - }, - "fullDescription": { - "text": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern. Use the fields provided below to specify minimum length, maximum length, and a regular expression expected for local variables names. Use the standard 'java.util.regex' format regular expressions.", - "markdown": "Reports a local variable whose name is too short, too long, or doesn't follow the specified regular expression pattern.\n\n\nUse the fields provided below to specify minimum length, maximum length, and a regular expression\nexpected for local variables names. Use the standard `java.util.regex` format regular expressions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LocalVariableNamingConventionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Naming conventions", - "index": 49, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyFinallyBlockJS", - "shortDescription": { - "text": "Empty 'finally' block" - }, - "fullDescription": { - "text": "Reports an empty 'finally' block, which usually indicates an error.", - "markdown": "Reports an empty `finally` block, which usually indicates an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyFinallyBlockJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Try statement issues", - "index": 32, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSCommentMatchesSignature", - "shortDescription": { - "text": "Mismatched JSDoc and function signature" - }, - "fullDescription": { - "text": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment. Example: '/**\n * @param height Height in pixels\n */\nfunction sq(height, width) {} // width is not documented' After the quick-fix is applied: '/**\n * @param height Height in pixels\n * @param width\n */\nfunction sq(height, width) {}'", - "markdown": "Reports mismatch between the names and the number of parameters within a JSDoc comment and the actual parameters of a function. Suggests updating parameters in JSDoc comment.\n\n**Example:**\n\n\n /**\n * @param height Height in pixels\n */\n function sq(height, width) {} // width is not documented\n\nAfter the quick-fix is applied:\n\n\n /**\n * @param height Height in pixels\n * @param width\n */\n function sq(height, width) {}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSCommentMatchesSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UpdateDependencyToLatestVersion", - "shortDescription": { - "text": "Update package.json dependencies to latest versions" - }, - "fullDescription": { - "text": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions.", - "markdown": "Suggests to upgrade your package.json dependencies to the latest versions, ignoring specified versions." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "UpdateDependencyToLatestVersion", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Imports and dependencies", - "index": 46, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptConfig", - "shortDescription": { - "text": "Inconsistent tsconfig.json properties" - }, - "fullDescription": { - "text": "Reports inconsistency of a 'paths', 'checkJs', or 'extends' property in a tsconfig.json file. The 'checkJs' property requires 'allowJs'. The 'extends' property should be a valid file reference.", - "markdown": "Reports inconsistency of a `paths`, `checkJs`, or `extends` property in a tsconfig.json file. \nThe `checkJs` property requires `allowJs`. \nThe `extends` property should be a valid file reference." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TypeScriptConfig", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSSuspiciousNameCombination", - "shortDescription": { - "text": "Suspicious variable/parameter name combination" - }, - "fullDescription": { - "text": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it. Example: 'var x = 0;\n var y = x;' or 'var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);' Here the inspection guesses that 'x' and 'y' are mixed up. Specify the names that should not be used together. An error is reported if a parameter name or an assignment target name contains words from one group while the name of the assigned or passed variable contains words from another group.", - "markdown": "Reports an assignment or a function call where the name of the target variable or the function parameter does not match the name of the value assigned to it.\n\nExample:\n\n\n var x = 0;\n var y = x;\n\nor\n\n\n var x = 0, y = 0;\n var rc = new Rectangle(y, x, 20, 20);\n\nHere the inspection guesses that `x` and `y` are mixed up.\n\nSpecify the names that should not be used together. An error is reported\nif a parameter name or an assignment target name contains words from one group while the name of the assigned or passed\nvariable contains words from another group." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSSuspiciousNameCombination", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSUnresolvedExtXType", - "shortDescription": { - "text": "Unresolved Ext JS xtype" - }, - "fullDescription": { - "text": "Reports an Ext JS 'xtype' reference that doesn't have a corresponding class.", - "markdown": "Reports an Ext JS `xtype` reference that doesn't have a corresponding class." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JSUnresolvedExtXType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ForLoopThatDoesntUseLoopVariableJS", - "shortDescription": { - "text": "'for' loop where update or condition does not use loop variable" - }, - "fullDescription": { - "text": "Reports a 'for' loop where the condition or update does not use the 'for' loop variable.", - "markdown": "Reports a `for` loop where the condition or update does not use the `for` loop variable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ForLoopThatDoesntUseLoopVariableJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Probable bugs", - "index": 17, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TypeScriptAbstractClassConstructorCanBeMadeProtected", - "shortDescription": { - "text": "Abstract class constructor can be made protected" - }, - "fullDescription": { - "text": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public).", - "markdown": "Reports a public constructor of an abstract class and suggests making it protected (because it is useless to have it public)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "TypeScriptAbstractClassConstructorCanBeMadeProtected", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/TypeScript", - "index": 26, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "FunctionWithMultipleReturnPointsJS", - "shortDescription": { - "text": "Function with multiple return points" - }, - "fullDescription": { - "text": "Reports a function with multiple return points. Such functions are hard to understand and maintain.", - "markdown": "Reports a function with multiple return points. Such functions are hard to understand and maintain." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMultipleReturnPointsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSIgnoredPromiseFromCall", - "shortDescription": { - "text": "Result of method call returning a promise is ignored" - }, - "fullDescription": { - "text": "Reports a function call that returns a 'Promise' that is not used later. Such calls are usually unintended and indicate an error.", - "markdown": "Reports a function call that returns a `Promise` that is not used later. Such calls are usually unintended and indicate an error." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSIgnoredPromiseFromCall", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Async code and promises", - "index": 52, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ThreeNegationsPerFunctionJS", - "shortDescription": { - "text": "Function with more than three negations" - }, - "fullDescription": { - "text": "Reports a function with three or more negation operations ('!' or '!='). Such functions may be unnecessarily confusing.", - "markdown": "Reports a function with three or more negation operations (`!` or `!=`). Such functions may be unnecessarily confusing." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "FunctionWithMoreThanThreeNegationsJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Function metrics", - "index": 33, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JSRemoveUnnecessaryParentheses", - "shortDescription": { - "text": "Unnecessary parentheses" - }, - "fullDescription": { - "text": "Reports redundant parentheses. In expressions: 'var x = ((1) + 2) + 3' In arrow function argument lists: 'var incrementer = (x) => x + 1' In TypeScript and Flow type declarations: 'type Card = (Suit & Rank) | (Suit & Number)'", - "markdown": "Reports redundant parentheses.\n\nIn expressions:\n\n var x = ((1) + 2) + 3\n\nIn arrow function argument lists:\n\n var incrementer = (x) => x + 1\n\nIn TypeScript and Flow type declarations:\n\n type Card = (Suit & Rank) | (Suit & Number)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JSRemoveUnnecessaryParentheses", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Code style issues", - "index": 12, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OverlyComplexBooleanExpressionJS", - "shortDescription": { - "text": "Overly complex boolean expression" - }, - "fullDescription": { - "text": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", - "markdown": "Reports a boolean expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexBooleanExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OverlyComplexArithmeticExpressionJS", - "shortDescription": { - "text": "Overly complex arithmetic expression" - }, - "fullDescription": { - "text": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone. Use the field below to specify the maximum number of terms allowed in an arithmetic expression.", - "markdown": "Reports an arithmetic expression with too many terms. Such expressions may be confusing and bug-prone.\n\n\nUse the field below to specify the maximum number of terms allowed in an arithmetic expression." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "OverlyComplexArithmeticExpressionJS", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Potentially confusing code constructs", - "index": 28, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ES6RedundantNestingInTemplateLiteral", - "shortDescription": { - "text": "Redundant nesting in template literal" - }, - "fullDescription": { - "text": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string. Example: 'let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`' After applying the quick-fix the code looks as follows: 'let a = `Hello, Brave New World!`'", - "markdown": "Reports nested instances of a string or a template literal. Suggests inlining the nested instances into the containing template string.\n\nExample:\n\n\n let a = `Hello, ${`Brave ${\"New\"}`} ${\"World\"}!`\n\nAfter applying the quick-fix the code looks as follows:\n\n\n let a = `Hello, Brave New World!`\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "ES6RedundantNestingInTemplateLiteral", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "StringLiteralBreaksHTMLJS", - "shortDescription": { - "text": "String literal which breaks HTML parsing" - }, - "fullDescription": { - "text": "Reports a string literal that contains a ' int:\n return 1\n\n def bar(self, x: str) -> str:\n return x\n\nclass Child(Parent):\n @override\n def foo(self) -> int:\n return 2\n\n @override # Missing super method for override function\n def baz(self) -> int:\n return 1'", - "markdown": "Reports when a method decorated with @override doesn't have a matching method in its ancestor classes\n\n**Example:**\n\n\n from typing import override\n\n class Parent:\n def foo(self) -> int:\n return 1\n\n def bar(self, x: str) -> str:\n return x\n\n class Child(Parent):\n @override\n def foo(self) -> int:\n return 2\n\n @override # Missing super method for override function\n def baz(self) -> int:\n return 1\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyOverrides", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInitNewSignatureInspection", - "shortDescription": { - "text": "Incompatible signatures of __new__ and __init__" - }, - "fullDescription": { - "text": "Reports incompatible signatures of the '__new__' and '__init__' methods. Example: 'class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass' If the '__new__' and '__init__' have different arguments, then the 'MyClass' cannot be instantiated. As a fix, the IDE offers to apply the Change Signature refactoring.", - "markdown": "Reports incompatible signatures of the `__new__` and `__init__` methods.\n\n**Example:**\n\n\n class MyClass(object):\n def __new__(cls, arg1):\n return super().__new__(cls)\n\n def __init__(self):\n pass\n\nIf the `__new__` and `__init__` have different arguments, then the `MyClass`\ncannot be instantiated.\n\nAs a fix, the IDE offers to apply the Change Signature refactoring." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyInitNewSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingConstructorInspection", - "shortDescription": { - "text": "Missed call to '__init__' of the super class" - }, - "fullDescription": { - "text": "Reports cases when a call to the 'super' constructor in a class is missed. Example: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n pass' The 'Pear' class should have a 'super' call in the '__init__' method. When the quick-fix is applied, the code changes to: 'class Fruit:\n def __init__(self):\n pass\n\n\nclass Pear(Fruit):\n def __init__(self):\n super().__init__()'", - "markdown": "Reports cases when a call to the `super` constructor in a class is missed.\n\n**Example:**\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n pass\n\nThe `Pear` class should have a `super` call in the `__init__`\nmethod.\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Fruit:\n def __init__(self):\n pass\n\n\n class Pear(Fruit):\n def __init__(self):\n super().__init__()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMissingConstructor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySimplifyBooleanCheckInspection", - "shortDescription": { - "text": "Redundant boolean variable check" - }, - "fullDescription": { - "text": "Reports equality comparison with a boolean literal. Example: 'def func(s):\n if s.isdigit() == True:\n return int(s)' With the quick-fix applied, the code fragment will be simplified to: 'def func(s):\n if s.isdigit():\n return int(s)'", - "markdown": "Reports equality comparison with a boolean literal.\n\n**Example:**\n\n\n def func(s):\n if s.isdigit() == True:\n return int(s)\n\nWith the quick-fix applied, the code fragment will be simplified to:\n\n\n def func(s):\n if s.isdigit():\n return int(s)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PySimplifyBooleanCheck", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyCallingNonCallableInspection", - "shortDescription": { - "text": "Attempt to call a non-callable object" - }, - "fullDescription": { - "text": "Reports a problem when you are trying to call objects that are not callable, like, for example, properties: Example: 'class Record:\n @property\n def as_json(self):\n\njson = Record().as_json()'", - "markdown": "Reports a problem when you are trying\nto call objects that are not callable, like, for example, properties:\n\n**Example:**\n\n\n class Record:\n @property\n def as_json(self):\n\n json = Record().as_json()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyCallingNonCallable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnreachableCodeInspection", - "shortDescription": { - "text": "Unreachable code" - }, - "fullDescription": { - "text": "Reports code fragments that cannot be normally reached. Example: 'if True:\n print('Yes')\nelse:\n print('No')' As a fix, you might want to check and modify the algorithm to ensure it implements the expected logic.", - "markdown": "Reports code fragments that cannot be normally reached.\n\n**Example:**\n\n\n if True:\n print('Yes')\n else:\n print('No')\n\nAs a fix, you might want to check and modify the algorithm to ensure it implements\nthe expected logic." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnreachableCode", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAssertTypeInspection", - "shortDescription": { - "text": "typing.assert_type" - }, - "fullDescription": { - "text": "Checks 'typing.assert_type(val, typ, /)' calls and reports cases when 'val''s inferred type is not 'typ'. Example: 'def greet(name: str) -> None:\n assert_type(name, str) # OK\n assert_type(name, int) # Expected type 'int', got 'str' instead'", - "markdown": "Checks `typing.assert_type(val, typ, /)` calls and reports cases when `val`'s inferred type is not\n`typ`.\n\n**Example:**\n\n\n def greet(name: str) -> None:\n assert_type(name, str) # OK\n assert_type(name, int) # Expected type 'int', got 'str' instead\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyAssertType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyChainedComparisonsInspection", - "shortDescription": { - "text": "Too complex chained comparisons" - }, - "fullDescription": { - "text": "Reports chained comparisons that can be simplified. Example: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass' The IDE offers to simplify 'if x >= xmin and x <= xmax'. When the quick-fix is applied, the code changes to: 'def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass'", - "markdown": "Reports chained comparisons that can be simplified.\n\n**Example:**\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if x >= xmin and x <= xmax:\n pass\n\nThe IDE offers to simplify `if x >= xmin and x <= xmax`.\nWhen the quick-fix is applied, the code changes to:\n\n\n def do_comparison(x):\n xmin = 10\n xmax = 100\n if xmin <= x <= xmax:\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyChainedComparisons", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyCompatibilityInspection", - "shortDescription": { - "text": "Code is incompatible with specific Python versions" - }, - "fullDescription": { - "text": "Reports incompatibility with the specified versions of Python. Enable this inspection if you need your code to be compatible with a range of Python versions, for example, if you are building a library. To define the range of the inspected Python versions, select the corresponding checkboxes in the Options section. For more information about the Python versions supported by the IDE, see the web help.", - "markdown": "Reports incompatibility with the specified versions of Python.\nEnable this inspection if you need your code to be compatible with a range of Python versions, for example,\nif you are building a library.\n\nTo define the range of the inspected Python versions, select the corresponding checkboxes in the **Options**\nsection.\n\nFor more information about the Python versions supported by the IDE, see the\n[web help](https://www.jetbrains.com/help/pycharm/python.html#support)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyCompatibility", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyGlobalUndefinedInspection", - "shortDescription": { - "text": "Global variable is not defined at the module level" - }, - "fullDescription": { - "text": "Reports problems when a variable defined through the 'global' statement is not defined in the module scope. Example: 'def foo():\n global bar\n print(bar)\n\nfoo()' As a fix, you can move the global variable declaration: 'global bar\n\n\ndef foo():\n print(bar)'", - "markdown": "Reports problems when a variable defined through the `global`\nstatement is not defined in the module scope.\n\n**Example:**\n\n\n def foo():\n global bar\n print(bar)\n\n foo()\n\nAs a fix, you can move the global variable declaration:\n\n\n global bar\n\n\n def foo():\n print(bar)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyGlobalUndefined", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnsatisfiedRequirementInspection", - "shortDescription": { - "text": "Requirement is not satisfied" - }, - "fullDescription": { - "text": "Reports packages mentioned in requirements files (for example, 'requirements.txt', or 'dependencies' section in 'pyproject.toml' files) but not installed, or imported but not mentioned in requirements files.", - "markdown": "Reports packages mentioned in requirements files (for example, `requirements.txt`, or `dependencies` section in `pyproject.toml` files) but not installed,\nor imported but not mentioned in requirements files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnsatisfiedRequirement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Requirements", - "index": 37, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyProtocolInspection", - "shortDescription": { - "text": "Invalid protocol definitions and usages" - }, - "fullDescription": { - "text": "Reports invalid definitions and usages of protocols introduced in PEP-544. Example: 'from typing import Protocol\n\n\nclass MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\nclass MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\nclass MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass'", - "markdown": "Reports invalid definitions and usages of protocols introduced in\n[PEP-544](https://www.python.org/dev/peps/pep-0544/).\n\n**Example:**\n\n\n from typing import Protocol\n\n\n class MyProtocol(Protocol):\n def method(self, p: int) -> str:\n pass\n\n\n class MyClass(MyProtocol):\n def method(self, p: str) -> int: # Type of 'method' is not compatible with 'MyProtocol'\n pass\n\n\n class MyAnotherProtocol(MyClass, Protocol): # All bases of a protocol must be protocols\n pass\n\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyProtocol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypeHintsInspection", - "shortDescription": { - "text": "Invalid type hints definitions and usages" - }, - "fullDescription": { - "text": "Reports invalid usages of type hints. Example: 'from typing import TypeVar\n\nT0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\ndef b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\ndef c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass' Available quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown.", - "markdown": "Reports invalid usages of type hints.\n\n**Example:**\n\n\n from typing import TypeVar\n\n T0 = TypeVar('T1') # Argument of 'TypeVar' must be 'T0'\n\n\n def b(p: int) -> int: # Type specified both in a comment and annotation\n # type: (int) -> int\n pass\n\n\n def c(p1, p2): # Type signature has too many arguments\n # type: (int) -> int\n pass\n\nAvailable quick-fixes offer various actions. You can rename, remove, or move problematic elements. You can also manually modify type declarations to ensure no warning is shown." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypeHints", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodMayBeStaticInspection", - "shortDescription": { - "text": "Method is not declared static" - }, - "fullDescription": { - "text": "Reports any methods that do not require a class instance creation and can be made static. Example: 'class MyClass(object):\n def my_method(self, x):\n print(x)' If a Make function from method quick-fix is applied, the code changes to: 'def my_method(x):\n print(x)\n\n\nclass MyClass(object):\n pass' If you select the Make method static quick-fix, the '@staticmethod' decorator is added: 'class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)'", - "markdown": "Reports any methods that do not require a class instance creation and can be\nmade static.\n\n**Example:**\n\n\n class MyClass(object):\n def my_method(self, x):\n print(x)\n\nIf a **Make function from method** quick-fix is applied, the code changes to:\n\n\n def my_method(x):\n print(x)\n\n\n class MyClass(object):\n pass\n\nIf you select the **Make method static** quick-fix, the `@staticmethod` decorator is added:\n\n\n class MyClass(object):\n @staticmethod\n def my_method(x):\n print(x)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyMethodMayBeStatic", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDictCreationInspection", - "shortDescription": { - "text": "Dictionary creation can be rewritten by dictionary literal" - }, - "fullDescription": { - "text": "Reports situations when you can rewrite dictionary creation by using a dictionary literal. This approach brings performance improvements. Example: 'dic = {}\ndic['var'] = 1' When the quick-fix is applied, the code changes to: 'dic = {'var': 1}'", - "markdown": "Reports situations when you can rewrite dictionary creation\nby using a dictionary literal.\n\nThis approach brings performance improvements.\n\n**Example:**\n\n\n dic = {}\n dic['var'] = 1\n\nWhen the quick-fix is applied, the code changes to:\n\n\n dic = {'var': 1}\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyDictCreation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStringFormatInspection", - "shortDescription": { - "text": "Errors in string formatting operations" - }, - "fullDescription": { - "text": "Reports errors in string formatting operations. Example 1: '\"Hello {1}\".format(\"people\")' Example 2: 'def bar():\n return 1\n\n\n\"%s %s\" % bar()' As a fix, you need to rewrite string formatting fragments to adhere to the formatting syntax.", - "markdown": "Reports errors in string formatting operations.\n\n**Example 1:**\n\n\n \"Hello {1}\".format(\"people\")\n\n**Example 2:**\n\n\n def bar():\n return 1\n\n\n \"%s %s\" % bar()\n\nAs a fix, you need to rewrite string formatting fragments to\nadhere to the [formatting syntax](https://docs.python.org/3/library/string.html#format-string-syntax)." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStringFormat", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyExceptionInheritInspection", - "shortDescription": { - "text": "Exceptions do not inherit from standard 'Exception' class" - }, - "fullDescription": { - "text": "Reports cases when a custom exception class is raised but does not inherit from the builtin Exception class. Example: 'class A:\n pass\n\n\ndef me_exception():\n raise A()' The proposed quick-fix changes the code to: 'class A(Exception):\n pass\n\n\ndef me_exception():\n raise A()'", - "markdown": "Reports cases when a custom exception class is\nraised but does not inherit from the\n[builtin Exception class](https://docs.python.org/3/library/exceptions.html).\n\n**Example:**\n\n\n class A:\n pass\n\n\n def me_exception():\n raise A()\n\nThe proposed quick-fix changes the code to:\n\n\n class A(Exception):\n pass\n\n\n def me_exception():\n raise A()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyExceptionInherit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAssignmentToLoopOrWithParameterInspection", - "shortDescription": { - "text": "Assignments to 'for' loop or 'with' statement parameter" - }, - "fullDescription": { - "text": "Reports the cases when you rewrite a loop variable with an inner loop. Example: 'for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)' It also warns you if a variable declared in the 'with' statement is redeclared inside the statement body: 'with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:'", - "markdown": "Reports the cases when you rewrite a loop variable with an inner loop.\n\n**Example:**\n\n\n for i in range(5):\n for i in range(20, 25):\n print(\"Inner\", i)\n print(\"Outer\", i)\n \nIt also warns you if a variable declared in the `with` statement is redeclared inside the statement body:\n\n\n with open(\"file\") as f:\n f.read()\n with open(\"file\") as f:\n \n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAssignmentToLoopOrWithParameter", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInconsistentReturnsInspection", - "shortDescription": { - "text": "Inconsistent return statements" - }, - "fullDescription": { - "text": "Highlights inconsistent return statements in functions. According to PEP8, either all return statements in a function should return an expression, or none of them should. PEP8's recommendation: Either all return statements in a function should return an expression, or none of them should. If any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present at the end of the function (if reachable): '# Correct:\n\ndef foo(x):\n if x >= 0:\n return math.sqrt(x)\n else:\n return None\n\ndef bar(x):\n if x < 0:\n return None\n return math.sqrt(x)' '# Wrong:\n\ndef foo(x):\n if x >= 0:\n return math.sqrt(x)\n\ndef bar(x):\n if x < 0:\n return\n return math.sqrt(x)'", - "markdown": "Highlights inconsistent return statements in functions. According to PEP8, either all return statements in a function should return an expression, or none of them should.\n\n\nPEP8's recommendation:\nEither all return statements in a function should return an expression, or none of them should.\nIf any return statement returns an expression, any return statements where no value is returned\nshould explicitly state this as return None, and an explicit return statement should be present\nat the end of the function (if reachable):\n\n\n # Correct:\n\n def foo(x):\n if x >= 0:\n return math.sqrt(x)\n else:\n return None\n\n def bar(x):\n if x < 0:\n return None\n return math.sqrt(x)\n\n\n # Wrong:\n\n def foo(x):\n if x >= 0:\n return math.sqrt(x)\n\n def bar(x):\n if x < 0:\n return\n return math.sqrt(x)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyInconsistentReturns", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySuperArgumentsInspection", - "shortDescription": { - "text": "Wrong arguments to call super" - }, - "fullDescription": { - "text": "Reports cases when any call to 'super(A, B)' does not meet the following requirements: 'B' is an instance of 'A' 'B' a subclass of 'A' Example: 'class Figure:\n def color(self):\n pass\n\n\nclass Rectangle(Figure):\n def color(self):\n pass\n\n\nclass Square(Figure):\n def color(self):\n return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle' As a fix, you can make the 'Square' an instance of the 'Rectangle' class.", - "markdown": "Reports cases when any call to `super(A, B)` does not meet the\nfollowing requirements:\n\n* `B` is an instance of `A`\n* `B` a subclass of `A`\n\n**Example:**\n\n\n class Figure:\n def color(self):\n pass\n\n\n class Rectangle(Figure):\n def color(self):\n pass\n\n\n class Square(Figure):\n def color(self):\n return super(Rectangle, self).color() # Square is not an instance or subclass of Rectangle\n\nAs a fix, you can make the `Square` an instance of the `Rectangle` class." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PySuperArguments", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNonAsciiCharInspection", - "shortDescription": { - "text": "File contains non-ASCII character" - }, - "fullDescription": { - "text": "Reports cases in Python 2 when a file contains non-ASCII characters and does not have an encoding declaration at the top. Example: 'class A(object):\n# №5\n def __init__(self):\n pass' In this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding declaration. Apply the proposed quick-fix to add a missing encoding declaration: '# coding=utf-8\nclass A(object)\n# №5\n def __init__(self):\n pass'", - "markdown": "Reports cases in Python 2 when a file contains non-ASCII characters and does not\nhave an encoding declaration at the top.\n\n**Example:**\n\n\n class A(object):\n # №5\n def __init__(self):\n pass\n\nIn this example, the IDE reports a non-ASCII symbol in a comment and a lack of encoding\ndeclaration. Apply the proposed quick-fix to add a missing encoding declaration:\n\n\n # coding=utf-8\n class A(object)\n # №5\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNonAsciiChar", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyOldStyleClassesInspection", - "shortDescription": { - "text": "Old-style class contains new-style class features" - }, - "fullDescription": { - "text": "Reports occurrences of new-style class features in old-style classes. The inspection highlights '__slots__', '__getattribute__', and 'super()' inside old-style classes.", - "markdown": "Reports occurrences of\n[new-style class features](https://www.python.org/doc/newstyle/)\nin old-style classes. The inspection highlights\n`__slots__`, `__getattribute__`, and `super()`\ninside old-style classes." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyOldStyleClasses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAbstractClassInspection", - "shortDescription": { - "text": "Invalid abstract class definition and usages" - }, - "fullDescription": { - "text": "Reports invalid definition and usages of abstract classes. Example: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure): # Not all abstract methods are defined in 'Triangle' class\n def do_triangle(self):\n pass\n\n\nTriangle() # Cannot instantiate abstract class 'Triangle'' When the quick-fix is applied, the IDE implements an abstract method for the 'Triangle' class: 'from abc import abstractmethod, ABC\n\n\nclass Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\nclass Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n\n\nTriangle()' It also warns you if 'abc.abstractmethod' is used in a class whose metaclass is not 'abc.ABCMeta': '' 'from abc import abstractmethod\n\n\nclass MyClass:\n @abstractmethod # 'MyClass' is not abstract\n def foo(self):\n ...'", - "markdown": "Reports invalid definition and usages of abstract classes.\n\n**Example:**\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure): # Not all abstract methods are defined in 'Triangle' class\n def do_triangle(self):\n pass\n\n\n Triangle() # Cannot instantiate abstract class 'Triangle'\n\nWhen the quick-fix is applied, the IDE implements an abstract method for the `Triangle` class:\n\n\n from abc import abstractmethod, ABC\n\n\n class Figure(ABC):\n\n @abstractmethod\n def do_figure(self):\n pass\n\n\n class Triangle(Figure):\n def do_figure(self):\n pass\n\n def do_triangle(self):\n pass\n\n\n Triangle()\n\nIt also warns you if `abc.abstractmethod` is used in a class whose metaclass is not `abc.ABCMeta`:\n\n from abc import abstractmethod\n\n\n class MyClass:\n @abstractmethod # 'MyClass' is not abstract\n def foo(self):\n ...\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAbstractClass", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyBroadExceptionInspection", - "shortDescription": { - "text": "Unclear exception clauses" - }, - "fullDescription": { - "text": "Reports exception clauses that do not provide specific information about the problem. Example: Clauses that do not specify an exception class Clauses that are specified as 'Exception'", - "markdown": "Reports exception clauses that do not provide specific information\nabout the problem.\n\n**Example:**\n\n* Clauses that do not specify an exception class\n* Clauses that are specified as `Exception`" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyBroadException", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypeCheckerInspection", - "shortDescription": { - "text": "Incorrect type" - }, - "fullDescription": { - "text": "Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases. Types of function parameters can be specified in docstrings or in Python 3 function annotations. Example: 'def foo() -> int:\n return \"abc\" # Expected int, got str\n\n\na: str\na = foo() # Expected str, got int' With the quick-fix, you can modify the problematic types: 'def foo() -> str:\n return \"abc\"\n\n\na: str\na = foo()'", - "markdown": "Reports type errors in function call expressions, targets, and return values. In a dynamically typed language, this is possible in a limited number of cases.\n\nTypes of function parameters can be specified in\ndocstrings or in Python 3 function annotations.\n\n**Example:**\n\n\n def foo() -> int:\n return \"abc\" # Expected int, got str\n\n\n a: str\n a = foo() # Expected str, got int\n\nWith the quick-fix, you can modify the problematic types:\n\n\n def foo() -> str:\n return \"abc\"\n\n\n a: str\n a = foo()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypeChecker", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyByteLiteralInspection", - "shortDescription": { - "text": "A byte literal contains a non-ASCII character" - }, - "fullDescription": { - "text": "Reports characters in byte literals that are outside ASCII range. Example: 's = b'№5''", - "markdown": "Reports characters in byte literals that are outside ASCII range.\n\n**Example:**\n\n\n s = b'№5'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyByteLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UvPackageVersionsInspection", - "shortDescription": { - "text": "Outdated Poetry package versions" - }, - "fullDescription": { - "text": "Reports outdated versions of packages in '[dependencies]' and '[dev-dependencies]' sections of 'pyproject.toml'.", - "markdown": "Reports outdated versions of packages in `[dependencies]` and `[dev-dependencies]`\nsections of `pyproject.toml`." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "UvPackageVersions", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAugmentAssignmentInspection", - "shortDescription": { - "text": "Assignment can be replaced with augmented assignment" - }, - "fullDescription": { - "text": "Reports assignments that can be replaced with augmented assignments. Example: 'a = 23\nb = 3\na = a + b' After the quick-fix is applied, the code changes to: 'a = 23\nb = 3\na += b'", - "markdown": "Reports assignments that can be replaced with augmented assignments.\n\n**Example:**\n\n\n a = 23\n b = 3\n a = a + b\n\nAfter the quick-fix is applied, the code changes to:\n\n\n a = 23\n b = 3\n a += b\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyAugmentAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDeprecationInspection", - "shortDescription": { - "text": "Deprecated function, class, or module" - }, - "fullDescription": { - "text": "Reports usages of Python functions, or methods that are marked as deprecated and raise the 'DeprecationWarning' or 'PendingDeprecationWarning' warning. Also, this inspection highlights usages of 'abc.abstractstaticmethod', 'abc.abstractproperty', and 'abc.abstractclassmethod' decorators. Example: 'class Foo:\n @property\n def bar(self):\n import warnings\n warnings.warn(\"this is deprecated\", DeprecationWarning, 2)\n return 5\n\n\nfoo = Foo()\nprint(foo.bar)'", - "markdown": "Reports usages of Python functions, or methods that are marked as\ndeprecated and raise the `DeprecationWarning` or `PendingDeprecationWarning` warning.\n\nAlso, this inspection highlights usages of `abc.abstractstaticmethod`, `abc.abstractproperty`, and `abc.abstractclassmethod`\ndecorators.\n\n**Example:**\n\n\n class Foo:\n @property\n def bar(self):\n import warnings\n warnings.warn(\"this is deprecated\", DeprecationWarning, 2)\n return 5\n\n\n foo = Foo()\n print(foo.bar)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnnecessaryBackslashInspection", - "shortDescription": { - "text": "Unnecessary backslash" - }, - "fullDescription": { - "text": "Reports backslashes in places where line continuation is implicit inside '()', '[]', and '{}'. Example: 'a = ('first', \\\n 'second', 'third')' When the quick-fix is applied, the redundant backslash is deleted.", - "markdown": "Reports backslashes in places where line continuation is implicit inside `()`,\n`[]`, and `{}`.\n\n**Example:**\n\n\n a = ('first', \\\n 'second', 'third')\n\nWhen the quick-fix is applied, the redundant backslash is deleted." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnnecessaryBackslash", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyShadowingNamesInspection", - "shortDescription": { - "text": "Shadowing names from outer scopes" - }, - "fullDescription": { - "text": "Reports shadowing names defined in outer scopes. Example: 'def outer(p):\n def inner(p):\n pass' As a quick-fix, the IDE offers to remove a parameter or rename it.", - "markdown": "Reports shadowing names defined in outer scopes.\n\n**Example:**\n\n\n def outer(p):\n def inner(p):\n pass\n\nAs a quick-fix, the IDE offers to remove a parameter or rename it." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyShadowingNames", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyFinalInspection", - "shortDescription": { - "text": "Invalid usages of final classes, methods, and variables" - }, - "fullDescription": { - "text": "Reports invalid usages of final classes, methods and variables. Example: 'from typing import final\n\n\n@final\nclass A:\n def a_method(self):\n pass\n\n\nclass B(A):\n def a_method(self):\n pass'", - "markdown": "Reports invalid usages of final classes,\nmethods and variables.\n\n**Example:**\n\n\n from typing import final\n\n\n @final\n class A:\n def a_method(self):\n pass\n\n\n class B(A):\n def a_method(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyFinal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PySingleQuotedDocstringInspection", - "shortDescription": { - "text": "Single quoted docstring" - }, - "fullDescription": { - "text": "Reports docstrings that do not adhere to the triple double-quoted string format. Example: 'def calc(self, balance=0):\n 'param: balance'\n self.balance = balance' When the quick-fix is applied, the code changes to: 'def calc(self, balance=0):\n \"\"\"param: balance\"\"\"\n self.balance = balance'", - "markdown": "Reports docstrings that do not adhere to the triple double-quoted string format.\n\n**Example:**\n\n\n def calc(self, balance=0):\n 'param: balance'\n self.balance = balance\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def calc(self, balance=0):\n \"\"\"param: balance\"\"\"\n self.balance = balance\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PySingleQuotedDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnusedLocalInspection", - "shortDescription": { - "text": "Unused local symbols" - }, - "fullDescription": { - "text": "Reports local variables, parameters, and functions that are locally defined, but not used name in a function.", - "markdown": "Reports local variables, parameters, and functions that are locally defined, but not used name in a function." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyUnusedLocal", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyReturnFromInitInspection", - "shortDescription": { - "text": "__init__ method that returns a value" - }, - "fullDescription": { - "text": "Reports occurrences of 'return' statements with a return value inside '__init__' methods of classes. Example: 'class Sum:\n def __init__(self, a, b):\n self.a = a\n self.b = b\n self.sum = a + b\n return self.sum' A constructor should not return any value. The '__init__' method should only initialize the values of instance members for news objects. As a quick-fix, the IDE offers to remove the 'return' statement.", - "markdown": "Reports occurrences of `return` statements with a return value inside\n`__init__` methods of classes.\n\n**Example:**\n\n\n class Sum:\n def __init__(self, a, b):\n self.a = a\n self.b = b\n self.sum = a + b\n return self.sum\n\nA constructor should not return any value. The `__init__` method should\nonly initialize the values of instance members for news objects.\n\nAs a quick-fix, the IDE offers to remove the `return` statement." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyReturnFromInit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingOrEmptyDocstringInspection", - "shortDescription": { - "text": "Missing or empty docstring" - }, - "fullDescription": { - "text": "Reports missing and empty docstrings. Example of a missing docstring 'def demo(a):\n c = a ** 2' Example of an empty docstring 'def demo(a):\n \"\"\"\n \"\"\"\n c = a ** 2' When the quick-fix is applied, the code fragments change to: 'def demo(a):\n \"\"\"\n\n :param a:\n \"\"\"\n c = a ** 2' You need to provide some details about the parameter in the generated template.", - "markdown": "Reports missing and empty docstrings.\n\n**Example of a missing docstring**\n\n\n def demo(a):\n c = a ** 2\n\n**Example of an empty docstring**\n\n\n def demo(a):\n \"\"\"\n \"\"\"\n c = a ** 2\n\nWhen the quick-fix is applied, the code fragments change to:\n\n\n def demo(a):\n \"\"\"\n\n :param a:\n \"\"\"\n c = a ** 2\n\nYou need to provide some details about the parameter in the generated template." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyMissingOrEmptyDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPep8NamingInspection", - "shortDescription": { - "text": "PEP 8 naming convention violation" - }, - "fullDescription": { - "text": "Reports violations of the PEP8 naming conventions. Example: 'class mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")' In this code fragment, IDE offers to rename 'mammalia' to 'Mammalia'. When the quick-fix is applied, the code change to: 'class Mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")'", - "markdown": "Reports violations of the\n[PEP8](https://www.python.org/dev/peps/pep-0008/) naming conventions.\n\n**Example:**\n\n\n class mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")\n\nIn this code fragment, IDE offers to rename `mammalia` to `Mammalia`.\nWhen the quick-fix is applied, the code change to:\n\n\n class Mammalia(object):\n extremities = 4\n\n def feeds(self):\n print(\"milk\")\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPep8Naming", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDictDuplicateKeysInspection", - "shortDescription": { - "text": "Dictionary contains duplicate keys" - }, - "fullDescription": { - "text": "Reports using the same value as the dictionary key twice. Example: 'dic = {\"a\": [1, 2], \"a\": [3, 4]}'", - "markdown": "Reports using the same value as the dictionary key twice.\n\n**Example:**\n\n\n dic = {\"a\": [1, 2], \"a\": [3, 4]}\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDictDuplicateKeys", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNoneFunctionAssignmentInspection", - "shortDescription": { - "text": "Assigning function calls that don't return anything" - }, - "fullDescription": { - "text": "Reports cases when an assignment is done on a function that does not return anything. This inspection is similar to pylint inspection E1111. Example: 'def just_print():\n print(\"Hello!\")\n\n\naction = just_print()' As a quick-fix, the IDE offers to remove the assignment.", - "markdown": "Reports cases when an assignment is done on a function that does not return anything.\nThis inspection is similar to [pylint inspection E1111](https://docs.pylint.org/en/1.6.0/features.html#id6).\n\n**Example:**\n\n\n def just_print():\n print(\"Hello!\")\n\n\n action = just_print()\n\nAs a quick-fix, the IDE offers to remove the assignment." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyNoneFunctionAssignment", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStatementEffectInspection", - "shortDescription": { - "text": "Statement has no effect" - }, - "fullDescription": { - "text": "Reports statements that have no effect. Example: 'class Car:\n def __init__(self, speed=0):\n self.speed = speed\n self.time # has no effect\n\n2 + 3 # has no effect' In this example, you can either add a field 'time' to the 'Car' class or introduce variables for the problematic statements.", - "markdown": "Reports statements that have no effect.\n\n**Example:**\n\n\n class Car:\n def __init__(self, speed=0):\n self.speed = speed\n self.time # has no effect\n\n 2 + 3 # has no effect\n\nIn this example, you can either add a field `time` to the `Car` class or\nintroduce variables for the problematic statements." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStatementEffect", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMandatoryEncodingInspection", - "shortDescription": { - "text": "No encoding specified for file" - }, - "fullDescription": { - "text": "Reports a missing encoding comment in Python 2. Example: 'class Book(object):\n def __init__(self):\n pass' When the quick-fix is applied, the missing comment is added: '# coding=utf-8\nclass Book(object):\n def __init__(self):\n pass'", - "markdown": "Reports a missing encoding comment in Python 2.\n\n**Example:**\n\n\n class Book(object):\n def __init__(self):\n pass\n\nWhen the quick-fix is applied, the missing comment is added:\n\n\n # coding=utf-8\n class Book(object):\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyMandatoryEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInconsistentIndentationInspection", - "shortDescription": { - "text": "Inconsistent indentation" - }, - "fullDescription": { - "text": "Reports inconsistent indentation in Python source files when, for example, you use a mixture of tabs and spaces in your code.", - "markdown": "Reports inconsistent indentation in Python source files when, for example,\nyou use a mixture of tabs and spaces in your code." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyInconsistentIndentation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAttributeOutsideInitInspection", - "shortDescription": { - "text": "An instance attribute is defined outside `__init__`" - }, - "fullDescription": { - "text": "Reports a problem when instance attribute definition is outside '__init__' method. Example: 'class Book:\n def __init__(self):\n self.author = 'Mark Twain'\n\n def release(self):\n self.year = '1889'' When the quick-fix is applied, the code sample changes to: 'class Book:\n def __init__(self):\n self.year = '1889'\n self.author = 'Mark Twain'\n\n def release(self):\n pass'", - "markdown": "Reports a problem when instance attribute definition is outside `__init__` method.\n\n**Example:**\n\n\n class Book:\n def __init__(self):\n self.author = 'Mark Twain'\n\n def release(self):\n self.year = '1889'\n\n\nWhen the quick-fix is applied, the code sample changes to:\n\n\n class Book:\n def __init__(self):\n self.year = '1889'\n self.author = 'Mark Twain'\n\n def release(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyAttributeOutsideInit", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTypedDictInspection", - "shortDescription": { - "text": "Invalid TypedDict definition and usages" - }, - "fullDescription": { - "text": "Reports invalid definition and usage of TypedDict. Example: 'from typing import TypedDict\n\n\nclass Movie(TypedDict):\n name: str\n year: int\n rate: int = 10 # Right-hand side values are not supported\n\n def method(self): # Invalid statement in TypedDict\n pass\n\n\nm = Movie(name=\"name\", year=1000, rate=9)\nprint(m[\"director\"]) # There is no the 'director' key in 'Movie'\ndel m[\"name\"] # The 'name' key cannot be deleted\nm[\"year\"] = \"1001\" # Expected 'int', got 'str''", - "markdown": "Reports invalid definition and usage of\n[TypedDict](https://www.python.org/dev/peps/pep-0589/).\n\n**Example:**\n\n\n from typing import TypedDict\n\n\n class Movie(TypedDict):\n name: str\n year: int\n rate: int = 10 # Right-hand side values are not supported\n\n def method(self): # Invalid statement in TypedDict\n pass\n\n\n m = Movie(name=\"name\", year=1000, rate=9)\n print(m[\"director\"]) # There is no the 'director' key in 'Movie'\n del m[\"name\"] # The 'name' key cannot be deleted\n m[\"year\"] = \"1001\" # Expected 'int', got 'str'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTypedDict", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPep8Inspection", - "shortDescription": { - "text": "PEP 8 coding style violation" - }, - "fullDescription": { - "text": "Reports violations of the PEP 8 coding style guide by running the bundled pycodestyle.py tool.", - "markdown": "Reports violations of the [PEP 8 coding style guide](https://www.python.org/dev/peps/pep-0008/) by running the bundled [pycodestyle.py](https://github.com/PyCQA/pycodestyle) tool." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPep8", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMissingTypeHintsInspection", - "shortDescription": { - "text": "Missing type hinting for function definition" - }, - "fullDescription": { - "text": "Reports missing type hints for function declaration in one of the two formats: parameter annotations or a type comment. Select the Only when types are known checkbox if you want the inspection check the types collected from runtime or inferred.", - "markdown": "Reports missing type hints for function declaration in\none of the two formats: parameter annotations or a type comment.\n\nSelect the **Only when types are known** checkbox if you want the inspection check\nthe types collected from runtime or inferred." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyMissingTypeHints", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTupleItemAssignmentInspection", - "shortDescription": { - "text": "Tuple item assignment is prohibited" - }, - "fullDescription": { - "text": "Reports assignments to a tuple item. Example: 't = ('red', 'blue', 'green', 'white')\nt[3] = 'black'' A quick-fix offers to replace the tuple with a list.", - "markdown": "Reports assignments to a tuple item.\n\n**Example:**\n\n\n t = ('red', 'blue', 'green', 'white')\n t[3] = 'black'\n\nA quick-fix offers to replace the tuple with a list." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTupleItemAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDunderSlotsInspection", - "shortDescription": { - "text": "Invalid usages of classes with '__slots__' definitions" - }, - "fullDescription": { - "text": "Reports invalid usages of a class with '__slots__' definitions. Example: 'class Foo:\n __slots__ = ['foo', 'bar']\n\n\nfoo = Foo()\nfoo.baz = 'spam''", - "markdown": "Reports invalid usages of a class with `__slots__` definitions.\n\n**Example:**\n\n\n class Foo:\n __slots__ = ['foo', 'bar']\n\n\n foo = Foo()\n foo.baz = 'spam'\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDunderSlots", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDefaultArgumentInspection", - "shortDescription": { - "text": "The default argument is mutable" - }, - "fullDescription": { - "text": "Reports a problem when a mutable value as a list or dictionary is detected in a default value for an argument. Default argument values are evaluated only once at function definition time, which means that modifying the default value of the argument will affect all subsequent calls of that function. Example: 'def func(s, cache={}):\n cache[s] = None' When the quick-fix is applied, the code changes to: 'def func(s, cache=None):\n if cache is None:\n cache = {}\n cache[s] = None'", - "markdown": "Reports a problem when a mutable value as a list or dictionary is detected in a default value for\nan argument. \n\nDefault argument values are evaluated only once at function definition time,\nwhich means that modifying the\ndefault value of the argument will affect all subsequent calls of that function.\n\n**Example:**\n\n\n def func(s, cache={}):\n cache[s] = None\n\nWhen the quick-fix is applied, the code changes to:\n\n\n def func(s, cache=None):\n if cache is None:\n cache = {}\n cache[s] = None\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDefaultArgument", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTestUnpassedFixtureInspection", - "shortDescription": { - "text": "Fixture is not requested by test functions" - }, - "fullDescription": { - "text": "Reports if a fixture is used without being passed to test function parameters or to '@pytest.mark.usefixtures' decorator", - "markdown": "Reports if a fixture is used without being passed to test function parameters or to `@pytest.mark.usefixtures` decorator" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTestUnpassedFixture", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyShadowingBuiltinsInspection", - "shortDescription": { - "text": "Shadowing built-in names" - }, - "fullDescription": { - "text": "Reports shadowing built-in names, such as 'len' or 'list'. Example: 'def len(a, b, c):\n d = a + b + c\n return d' In this code fragment, the 'len' built-in name is used. The IDE offers to apply the Rename refactoring as a fix.", - "markdown": "Reports shadowing built-in names, such as `len` or `list`.\n\n**Example:**\n\n\n def len(a, b, c):\n d = a + b + c\n return d\n\nIn this code fragment, the `len` built-in name is used. The IDE offers to\napply the Rename refactoring as a fix." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyShadowingBuiltins", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodOverridingInspection", - "shortDescription": { - "text": "Method signature does not match signature of overridden method" - }, - "fullDescription": { - "text": "Reports inconsistencies in overriding method signatures. Example: 'class Book:\n def add_title(self):\n pass\n\n\nclass Novel(Book):\n def add_title(self, text):\n pass' Parameters of the 'add_title' method in the 'Novel' class do not match the method signature specified in the 'Book' class. As a fix, the IDE offers to apply the Change Signature refactoring.", - "markdown": "Reports inconsistencies in overriding method signatures.\n\n**Example:**\n\n\n class Book:\n def add_title(self):\n pass\n\n\n class Novel(Book):\n def add_title(self, text):\n pass\n\nParameters of the `add_title` method in the `Novel` class do not match the method\nsignature specified in the `Book` class. As a fix, the IDE offers to apply the Change Signature\nrefactoring." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMethodOverriding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PoetryPackageVersionsInspection", - "shortDescription": { - "text": "Outdated Poetry package versions" - }, - "fullDescription": { - "text": "Reports outdated versions of packages in '[tool.poetry.dependencies]' and '[tool.poetry.dev-dependencies]' sections of 'pyproject.toml'.", - "markdown": "Reports outdated versions of packages in `[tool.poetry.dependencies]` and `[tool.poetry.dev-dependencies]`\nsections of `pyproject.toml`." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PoetryPackageVersions", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTestParametrizedInspection", - "shortDescription": { - "text": "Incorrect arguments in @pytest.mark.parametrize" - }, - "fullDescription": { - "text": "Reports functions that are decorated with @pytest.mark.parametrize but do not have arguments to accept parameters of the decorator.", - "markdown": "Reports functions that are decorated with [@pytest.mark.parametrize](https://docs.pytest.org/en/stable/parametrize.html) but do not have arguments to accept\nparameters of the decorator." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTestParametrized", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDecoratorInspection", - "shortDescription": { - "text": "Class-specific decorator is used outside the class" - }, - "fullDescription": { - "text": "Reports usages of '@classmethod' or '@staticmethod' decorators in methods outside a class. Example: 'class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n@classmethod\ndef change_state(self):\n pass' The 'change_state' method should not use the '@classmethod' decorator or it should be moved to the 'State' class declaration. If you apply the 'Remove decorator' action, the code changes to: 'class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\ndef change_state(self):\n pass'", - "markdown": "Reports usages of `@classmethod` or `@staticmethod` decorators\nin methods outside a class.\n\n**Example:**\n\n\n class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n @classmethod\n def change_state(self):\n pass\n\nThe `change_state` method should not use the `@classmethod` decorator or it should be\nmoved to the `State` class declaration.\n\nIf you apply the `Remove decorator` action, the code changes to:\n\n\n class State(object):\n\n @classmethod\n def my_state(cls, name):\n cls.name = name\n\n\n def change_state(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyDecorator", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyAsyncCallInspection", - "shortDescription": { - "text": "Missing `await` syntax in coroutine calls" - }, - "fullDescription": { - "text": "Reports coroutines that were called without using the 'await' syntax. Example: 'async def bar():\n pass\n\n\nasync def foo():\n bar()' After the quick-fix is applied, the code changes to: 'async def bar():\n pass\n\n\nasync def foo():\n await bar()'", - "markdown": "Reports coroutines that were called\nwithout using the `await` syntax.\n\n**Example:**\n\n\n async def bar():\n pass\n\n\n async def foo():\n bar()\n\nAfter the quick-fix is applied, the code changes to:\n\n\n async def bar():\n pass\n\n\n async def foo():\n await bar()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyAsyncCall", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyComparisonWithNoneInspection", - "shortDescription": { - "text": "Using equality operators to compare with None" - }, - "fullDescription": { - "text": "Reports comparisons with 'None'. That type of comparisons should always be done with 'is' or 'is not', never the equality operators. Example: 'a = 2\n\n\nif a == None:\n print(\"Success\")' Once the quick-fix is applied, the code changes to: 'a = 2\n\n\nif a is None:\n print(\"Success\")'", - "markdown": "Reports comparisons with `None`. That type of comparisons\nshould always be done with `is` or `is not`, never\nthe equality operators.\n\n**Example:**\n\n\n a = 2\n\n\n if a == None:\n print(\"Success\")\n\nOnce the quick-fix is applied, the code changes to:\n\n\n a = 2\n\n\n if a is None:\n print(\"Success\")\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyComparisonWithNone", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CommandLineInspection", - "shortDescription": { - "text": "Incorrect CLI syntax" - }, - "fullDescription": { - "text": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies that option names and arguments are correct. Do not disable the inspection if you are going to use command-line interfaces like manage.py in Django.", - "markdown": "Reports the problems if the arguments of the command you type in the console are not in the proper order. The inspection also verifies\nthat option names and arguments are correct.\n\nDo not disable the inspection if you are going to use command-line interfaces like [manage.py in Django](https://www.jetbrains.com/help/pycharm/running-manage-py.html)." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CommandLineInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodParametersInspection", - "shortDescription": { - "text": "Improper first parameter" - }, - "fullDescription": { - "text": "Reports methods that lack the first parameter that is usually named 'self'. Example: 'class Movie:\n\n def show():\n pass' When the quick-fix is applied, the code changes to: 'class Movie:\n\n def show(self):\n pass' The inspection also reports naming issues in class methods. Example: 'class Movie:\n @classmethod\n def show(abc):\n pass' Since the first parameter of a class method should be 'cls', the IDE provides a quick-fix to rename it.", - "markdown": "Reports methods that lack the first parameter that is usually\nnamed `self`.\n\n**Example:**\n\n\n class Movie:\n\n def show():\n pass\n\nWhen the quick-fix is applied, the code changes to:\n\n\n class Movie:\n\n def show(self):\n pass\n\nThe inspection also reports naming issues in class methods.\n\n**Example:**\n\n\n class Movie:\n @classmethod\n def show(abc):\n pass\n\nSince the first parameter of a class method should be `cls`, the IDE provides a quick-fix\nto rename it." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyMethodParameters", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDocstringTypesInspection", - "shortDescription": { - "text": "Type in docstring does not match inferred type" - }, - "fullDescription": { - "text": "Reports types in docstring that do not match dynamically inferred types.", - "markdown": "Reports types in docstring that do not match dynamically inferred types." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyDocstringTypes", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyMethodFirstArgAssignmentInspection", - "shortDescription": { - "text": "First argument of the method is reassigned" - }, - "fullDescription": { - "text": "Reports cases when the first parameter, such as 'self' or 'cls', is reassigned in a method. Because in most cases, there are no objectives in such reassignment, the IDE indicates an error. Example: 'class Account:\n def calc(self, balance):\n if balance == 0:\n self = balance\n return self' As a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct, you can invoke intention actions for this code and opt to ignore the warning.", - "markdown": "Reports cases when the first parameter,\nsuch as `self` or `cls`, is reassigned in a method.\nBecause in most cases, there are no objectives in such reassignment, the\nIDE indicates an error.\n\n**Example:**\n\n\n class Account:\n def calc(self, balance):\n if balance == 0:\n self = balance\n return self\n\nAs a fix, you might want to check and modify the algorithm to ensure that reassignment is needed. If everything is correct,\nyou can invoke intention actions for this code and opt to ignore the warning." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyMethodFirstArgAssignment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNewStyleGenericSyntaxInspection", - "shortDescription": { - "text": "Invalid usage of new-style type parameters and type aliases" - }, - "fullDescription": { - "text": "Reports invalid usage of PEP 695 type parameter syntax Finds the following problems in function and class definitions and new-style type alias statements: Extending typing.Generic in new-style generic classes Extending parameterized typing.Protocol in new-style generic classes Using generic upper bounds and constraints with type parameters for ParamSpec and TypeVarTuple Mixing traditional and new-style type variables Using traditional type variables in new-style type aliases Examples: 'from typing import Generic\n\n class Example[T](Generic[T]): ... # Classes with type parameter list should not extend 'Generic'' 'class Example[T: (list[S], str)]: ... # Generic types are not allowed inside constraints and bounds of type parameters' 'from typing import TypeVar\n\n K = TypeVar(\"K\")\n\n class ClassC[V]:\n def method2[M](self, a: M, b: K) -> M | K: ... # Mixing traditional and new-style TypeVars is not allowed'", - "markdown": "Reports invalid usage of [PEP 695](https://www.python.org/dev/peps/pep-0695/) type parameter syntax\n\n\nFinds the following problems in function and class definitions and new-style type alias statements:\n\n* Extending typing.Generic in new-style generic classes\n* Extending parameterized typing.Protocol in new-style generic classes\n* Using generic upper bounds and constraints with type parameters for ParamSpec and TypeVarTuple\n* Mixing traditional and new-style type variables\n* Using traditional type variables in new-style type aliases\n\n\nExamples:\n\n\n from typing import Generic\n\n class Example[T](Generic[T]): ... # Classes with type parameter list should not extend 'Generic'\n\n\n class Example[T: (list[S], str)]: ... # Generic types are not allowed inside constraints and bounds of type parameters\n\n\n from typing import TypeVar\n\n K = TypeVar(\"K\")\n\n class ClassC[V]:\n def method2[M](self, a: M, b: K) -> M | K: ... # Mixing traditional and new-style TypeVars is not allowed\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNewStyleGenericSyntax", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTupleAssignmentBalanceInspection", - "shortDescription": { - "text": "Tuple assignment balance is incorrect" - }, - "fullDescription": { - "text": "Reports cases when the number of expressions on the right-hand side and targets on the left-hand side are not the same. Example: 't = ('red', 'blue', 'green', 'white')\n(c1, c2, c3) = t' As a quick-fix, you can modify the highlighted code fragment to restore the tuple balance.", - "markdown": "Reports cases when the number of expressions on the right-hand side\nand targets on the left-hand side are not the same.\n\n**Example:**\n\n\n t = ('red', 'blue', 'green', 'white')\n (c1, c2, c3) = t\n\nAs a quick-fix, you can modify the highlighted code fragment to restore the tuple\nbalance." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTupleAssignmentBalance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassHasNoInitInspection", - "shortDescription": { - "text": "Class has no `__init__` method" - }, - "fullDescription": { - "text": "Reports cases in Python 2 when a class has no '__init__' method, neither its parent classes. Example: 'class Book():\n pass' The quick-fix adds the '__init__' method: 'class Book():\n def __init__(self):\n pass'", - "markdown": "Reports cases in Python 2 when a class has no `__init__` method, neither its parent\nclasses.\n\n**Example:**\n\n\n class Book():\n pass\n\nThe quick-fix adds the `__init__` method:\n\n\n class Book():\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyClassHasNoInit", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyArgumentEqualDefaultInspection", - "shortDescription": { - "text": "The function argument is equal to the default parameter value" - }, - "fullDescription": { - "text": "Reports a problem when an argument passed to the function is equal to the default parameter value. This inspection is disabled by default to avoid performance degradation. Example: 'def my_function(a: int = 2):\n print(a)\n\n\nmy_function(2)'", - "markdown": "Reports a problem when an argument\npassed to the function is equal to the default parameter value.\n\nThis inspection is disabled by default to avoid performance degradation.\n\n**Example:**\n\n\n def my_function(a: int = 2):\n print(a)\n\n\n my_function(2)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "PyArgumentEqualDefault", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassVarInspection", - "shortDescription": { - "text": "Invalid usage of ClassVar variables" - }, - "fullDescription": { - "text": "Reports invalid usages of ClassVar annotations. Example: 'from typing import ClassVar\n\n\nclass Cat:\n color: ClassVar[str] = \"white\"\n weight: int\n\n def __init__(self, weight: int):\n self.weight = weight\n\n\nCat.color = \"black\" # OK\nmy_cat = Cat(5)\nmy_cat.color = \"gray\" # Error, setting class variable on instance'", - "markdown": "Reports invalid usages of [ClassVar](https://docs.python.org/3/library/typing.html#typing.ClassVar) annotations.\n\n**Example:**\n\n\n from typing import ClassVar\n\n\n class Cat:\n color: ClassVar[str] = \"white\"\n weight: int\n\n def __init__(self, weight: int):\n self.weight = weight\n\n\n Cat.color = \"black\" # OK\n my_cat = Cat(5)\n my_cat.color = \"gray\" # Error, setting class variable on instance\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyClassVar", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyFromFutureImportInspection", - "shortDescription": { - "text": "Improper position of from __future__ import" - }, - "fullDescription": { - "text": "Reports 'from __future__ import' statements that are used not at the beginning of a file. Example: 'a = 1\nfrom __future__ import print_function\nprint()' When the quick-fix is applied, the code changes to: 'from __future__ import print_function\n\na = 1\nprint()'", - "markdown": "Reports `from __future__ import`\nstatements that are used not at\nthe beginning of a file.\n\n**Example:**\n\n\n a = 1\n from __future__ import print_function\n print()\n\nWhen the quick-fix is applied, the code changes to:\n\n\n from __future__ import print_function\n\n a = 1\n print()\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyFromFutureImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnresolvedReferencesInspection", - "shortDescription": { - "text": "Unresolved references" - }, - "fullDescription": { - "text": "Reports references in your code that cannot be resolved. In a dynamically typed language, this is possible in a limited number of cases. If a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be: 'def print_string(s):\n print(s.abc())' In this code fragment 's' is always a string and 'abc' should be highlighted as unresolved. However, 's' type is inferred as 'Any' and no warning is reported. The IDE provides quick-fix actions to add missing references on-the-fly.", - "markdown": "Reports references in your code that cannot be resolved.\n\nIn a dynamically typed language, this is possible in a limited number of cases.\n\nIf a reference type is unknown, then its attributes are not highlighted as unresolved even if you know that they should be:\n\n\n def print_string(s):\n print(s.abc())\n\nIn this code fragment `s` is always a string and `abc` should be highlighted as unresolved. However, `s`\ntype is inferred as `Any` and no warning is reported.\n\nThe IDE provides quick-fix actions to add missing references on-the-fly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnresolvedReferences", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPackageRequirementsInspection", - "shortDescription": { - "text": "Unsatisfied package requirements" - }, - "fullDescription": { - "text": "Reports packages mentioned in requirements files (for example, 'requirements.txt' or 'Pipfile') but not installed, or imported but not mentioned in requirements files. The IDE shows a quick-fix banner so that you can install the missing packages in one click.", - "markdown": "Reports packages mentioned in requirements files (for example, `requirements.txt` or `Pipfile`) but not installed,\nor imported but not mentioned in requirements files.\n\n\nThe IDE shows a quick-fix banner so that you can install the missing packages in one click." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPackageRequirements", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRedundantParenthesesInspection", - "shortDescription": { - "text": "Redundant parentheses" - }, - "fullDescription": { - "text": "Reports about redundant parentheses in expressions. The IDE provides the quick-fix action to remove the redundant parentheses.", - "markdown": "Reports about redundant parentheses in expressions.\n\nThe IDE provides the quick-fix action to remove the redundant parentheses." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyRedundantParentheses", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyTrailingSemicolonInspection", - "shortDescription": { - "text": "Prohibited trailing semicolon in a statement" - }, - "fullDescription": { - "text": "Reports trailing semicolons in statements. Example: 'def my_func(a):\n c = a ** 2;\n return c' IDE provides a quick-fix that removes a trailing semicolon. When you apply it, the code changes to: 'def my_func(a):\n c = a ** 2\n return c'", - "markdown": "Reports trailing semicolons in statements.\n\n**Example:**\n\n\n def my_func(a):\n c = a ** 2;\n return c\n\nIDE provides a quick-fix that removes a trailing semicolon. When you\napply it, the code changes to:\n\n\n def my_func(a):\n c = a ** 2\n return c\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyTrailingSemicolon", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyArgumentListInspection", - "shortDescription": { - "text": "Incorrect call arguments" - }, - "fullDescription": { - "text": "Reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments, for example, duplicate named arguments, and incorrect argument order. Example: 'class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\nbar = Foo()\nbar.__call__() # unfilled parameter\nbar(5, \"#\") # unexpected argument' The correct code fragment looks at follows: 'class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\nbar = Foo()\nbar.__call__(5)\nbar(5, p2=\"#\")'", - "markdown": "Reports discrepancies between declared parameters and actual arguments, as well as\nincorrect arguments, for example, duplicate named arguments, and incorrect argument order.\n\n**Example:**\n\n\n class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\n bar = Foo()\n bar.__call__() # unfilled parameter\n bar(5, \"#\") # unexpected argument\n\nThe correct code fragment looks at follows:\n\n\n class Foo:\n def __call__(self, p1: int, *, p2: str = \"%\"):\n return p2 * p1\n\n\n bar = Foo()\n bar.__call__(5)\n bar(5, p2=\"#\")\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyArgumentList", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyInterpreterInspection", - "shortDescription": { - "text": "An invalid interpreter" - }, - "fullDescription": { - "text": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly configured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features. The IDE provides quick access to the interpreter settings.", - "markdown": "Reports problems if there is no Python interpreter configured for the project or if the interpreter is invalid. Without a properly\nconfigured interpreter, you cannot execute your Python scripts and benefit from some Python code insight features.\n\nThe IDE provides quick access to the interpreter settings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyInterpreter", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPropertyAccessInspection", - "shortDescription": { - "text": "Inappropriate access to properties" - }, - "fullDescription": { - "text": "Reports cases when properties are accessed inappropriately: Read-only properties are set Write-only properties are read Non-deletable properties are deleted Example: 'class MyClass:\n @property\n def read_only(self): return None\n\n def __write_only_setter(self, value): pass\n\n write_only = property(None, __write_only_setter)\n\n\na = MyClass()\na.read_only = 10 # property cannot be set\ndel a.read_only # property cannot be deleted\nprint(a.write_only) # property cannot be read'", - "markdown": "Reports cases when properties are accessed inappropriately:\n\n* Read-only properties are set\n* Write-only properties are read\n* Non-deletable properties are deleted\n\n**Example:**\n\n\n class MyClass:\n @property\n def read_only(self): return None\n\n def __write_only_setter(self, value): pass\n\n write_only = property(None, __write_only_setter)\n\n\n a = MyClass()\n a.read_only = 10 # property cannot be set\n del a.read_only # property cannot be deleted\n print(a.write_only) # property cannot be read\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPropertyAccess", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStubPackagesAdvertiser", - "shortDescription": { - "text": "Stub packages advertiser" - }, - "fullDescription": { - "text": "Reports availability of stub packages. Stub package is a package that contains type information for the corresponding runtime package. Using stub packages ensures better coding assistance for the corresponding python package.", - "markdown": "Reports availability of stub packages.\n\n\n[Stub package](https://www.python.org/dev/peps/pep-0561/) is a package that contains type information for the corresponding\nruntime package.\n\nUsing stub packages ensures better coding assistance for the corresponding python package." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStubPackagesAdvertiser", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRelativeImportInspection", - "shortDescription": { - "text": "Suspicious relative imports" - }, - "fullDescription": { - "text": "Reports usages of relative imports inside plain directories, for example, directories neither containing '__init__.py' nor explicitly marked as namespace packages.", - "markdown": "Reports usages of relative imports inside plain directories, for example, directories neither containing `__init__.py` nor\nexplicitly marked as namespace packages." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyPackages", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyRedeclarationInspection", - "shortDescription": { - "text": "Redeclared names without usages" - }, - "fullDescription": { - "text": "Reports unconditional redeclarations of names without being used in between. Example: 'def x(): pass\n\n\nx = 2' It applies to function and class declarations, and top-level assignments. When the warning is shown, you can try a recommended action, for example, you might be prompted to rename the variable.", - "markdown": "Reports unconditional redeclarations of names without being used in between.\n\n**Example:**\n\n\n def x(): pass\n\n\n x = 2\n\nIt applies to function and class declarations, and top-level assignments.\n\nWhen the warning is shown, you can try a recommended action, for example, you might be prompted to\nrename the variable." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyRedeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyStubPackagesCompatibilityInspection", - "shortDescription": { - "text": "Incompatible stub packages" - }, - "fullDescription": { - "text": "Reports stub packages that do not support the version of the corresponding runtime package. A stub package contains type information for some runtime package.", - "markdown": "Reports stub packages that do not support the version of the corresponding runtime package.\n\nA [stub package](https://www.python.org/dev/peps/pep-0561/) contains type information for some runtime package." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyStubPackagesCompatibility", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyProtectedMemberInspection", - "shortDescription": { - "text": "Accessing a protected member of a class or a module" - }, - "fullDescription": { - "text": "Reports cases when a protected member is accessed outside the class, a descendant of the class where it is defined, or a module. Example: 'class Foo:\n def _protected_method(self):\n pass\n\n\nclass Bar(Foo):\n def public_method(self):\n self._protected_method()\n\n\nfoo = Foo()\nfoo._protected_method() # Access to a protected method'", - "markdown": "Reports cases when a protected member is accessed outside the class,\na descendant of the class where it is defined, or a module.\n\n**Example:**\n\n\n class Foo:\n def _protected_method(self):\n pass\n\n\n class Bar(Foo):\n def public_method(self):\n self._protected_method()\n\n\n foo = Foo()\n foo._protected_method() # Access to a protected method\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyProtectedMember", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyUnboundLocalVariableInspection", - "shortDescription": { - "text": "Unbound local variables" - }, - "fullDescription": { - "text": "Reports local variables referenced before assignment. Example: 'x = 0\nif x > 10:\n b = 3\nprint(b)' The IDE reports a problem for 'print(b)'. A possible fix is: 'x = 0\nif x > 10:\n b = 3\n print(b)'", - "markdown": "Reports local variables referenced before assignment.\n\n**Example:**\n\n\n x = 0\n if x > 10:\n b = 3\n print(b)\n\nThe IDE reports a problem for `print(b)`. A possible fix is:\n\n\n x = 0\n if x > 10:\n b = 3\n print(b)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyUnboundLocalVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNamedTupleInspection", - "shortDescription": { - "text": "Invalid definition of 'typing.NamedTuple'" - }, - "fullDescription": { - "text": "Reports invalid definition of a typing.NamedTuple. Example: 'import typing\n\n\nclass FullName(typing.NamedTuple):\n first: str\n last: str = \"\"\n middle: str' As a fix, place the field with the default value after the fields without default values: 'import typing\n\n\nclass FullName(typing.NamedTuple):\n first: str\n middle: str\n last: str = \"\"'", - "markdown": "Reports invalid definition of a\n[typing.NamedTuple](https://docs.python.org/3/library/typing.html#typing.NamedTuple).\n\n**Example:**\n\n\n import typing\n\n\n class FullName(typing.NamedTuple):\n first: str\n last: str = \"\"\n middle: str\n\nAs a fix, place the field with the default value after the fields without default values:\n\n\n import typing\n\n\n class FullName(typing.NamedTuple):\n first: str\n middle: str\n last: str = \"\"\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNamedTuple", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNewTypeInspection", - "shortDescription": { - "text": "Invalid usage of NewType" - }, - "fullDescription": { - "text": "Reports invalid usages of NewType. Examples: 'from typing import NewType\n\n InvalidName = NewType(\"Name\", int) # Variable name 'InvalidName' does not match NewType name 'Name'' 'from typing import Literal\n\n InvalidType = NewType(\"InvalidType\", Literal[1]) # NewType cannot be used with 'Literal[1]'' 'Base = NewType(\"Base\", str)\n\n class Derived(Base): # 'Base' cannot be subclassed\n pass'", - "markdown": "Reports invalid usages of [NewType](https://docs.python.org/3/library/typing.html#typing.NewType).\n\n\n**Examples:**\n\n\n from typing import NewType\n\n InvalidName = NewType(\"Name\", int) # Variable name 'InvalidName' does not match NewType name 'Name'\n\n\n from typing import Literal\n\n InvalidType = NewType(\"InvalidType\", Literal[1]) # NewType cannot be used with 'Literal[1]'\n\n\n Base = NewType(\"Base\", str)\n\n class Derived(Base): # 'Base' cannot be subclassed\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyNewType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyNestedDecoratorsInspection", - "shortDescription": { - "text": "Problematic nesting of decorators" - }, - "fullDescription": { - "text": "Reports problems with nesting decorators. The inspection highlights the cases when 'classmethod' or 'staticmethod' is applied before another decorator. Example: 'def innocent(f):\n return f\n\n\nclass A:\n @innocent # Decorator will not receive a callable it may expect\n @classmethod\n def f2(cls):\n pass\n\n @innocent # Decorator will not receive a callable it may expect\n @staticmethod\n def f1():\n pass' As a quick-fix, the IDE offers to remove the decorator.", - "markdown": "Reports problems with nesting decorators. The inspection highlights the cases when `classmethod` or `staticmethod`\nis applied before another decorator.\n\n**Example:**\n\n\n def innocent(f):\n return f\n\n\n class A:\n @innocent # Decorator will not receive a callable it may expect\n @classmethod\n def f2(cls):\n pass\n\n @innocent # Decorator will not receive a callable it may expect\n @staticmethod\n def f1():\n pass\n\nAs a quick-fix, the IDE offers to remove the decorator." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyNestedDecorators", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyOverloadsInspection", - "shortDescription": { - "text": "Overloads in regular Python files" - }, - "fullDescription": { - "text": "Reports cases when overloads in regular Python files are placed after the implementation or when their signatures are not compatible with the implementation. Example: 'from typing import overload\n\n\n@overload\ndef foo(p1, p2): # Overload signature is not compatible with the implementation\n pass\n\n\n@overload\ndef foo(p1): # Overload signature is not compatible with the implementation\n pass\n\n\ndef foo(p1, p2, p3):\n print(p1, p2, p3)'", - "markdown": "Reports cases when overloads in regular Python files are placed after the implementation or when their signatures are\nnot compatible with the implementation.\n\n**Example:**\n\n\n from typing import overload\n\n\n @overload\n def foo(p1, p2): # Overload signature is not compatible with the implementation\n pass\n\n\n @overload\n def foo(p1): # Overload signature is not compatible with the implementation\n pass\n\n\n def foo(p1, p2, p3):\n print(p1, p2, p3)\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyOverloads", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyExceptClausesOrderInspection", - "shortDescription": { - "text": "Wrong order of 'except' clauses" - }, - "fullDescription": { - "text": "Reports cases when 'except' clauses are not in the proper order, from the more specific to the more generic, or one exception class is caught twice. If you do not fix the order, some exceptions may not be caught by the most specific handler. Example: 'try:\n call()\nexcept ValueError:\n pass\nexcept UnicodeError:\n pass' The IDE recommends moving the clause up. When the quick-fix is applied, the code changes to: 'try:\n call()\nexcept UnicodeError:\n pass\nexcept ValueError:\n pass'", - "markdown": "Reports cases when `except` clauses are not in the proper order,\nfrom the more specific to the more generic, or one exception class is caught twice.\n\n\nIf you do not fix the order, some exceptions may not be caught by the most specific handler.\n\n**Example:**\n\n\n try:\n call()\n except ValueError:\n pass\n except UnicodeError:\n pass\n\nThe IDE recommends moving the clause up. When the quick-fix is applied, the code changes to:\n\n\n try:\n call()\n except UnicodeError:\n pass\n except ValueError:\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyExceptClausesOrder", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyDataclassInspection", - "shortDescription": { - "text": "Invalid definition and usage of Data Classes" - }, - "fullDescription": { - "text": "Reports invalid definitions and usages of classes created with 'dataclasses' or 'attr' modules. Example: 'import dataclasses\n\n\n@dataclasses.dataclass\nclass FullName:\n first: str\n middle: str = \"\"\n last: str'", - "markdown": "Reports invalid definitions and usages of classes created with\n`dataclasses` or `attr` modules.\n\n**Example:**\n\n\n import dataclasses\n\n\n @dataclasses.dataclass\n class FullName:\n first: str\n middle: str = \"\"\n last: str\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyDataclass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyClassicStyleClassInspection", - "shortDescription": { - "text": "Classic style class usage" - }, - "fullDescription": { - "text": "Reports classic style classes usage. This inspection applies only to Python 2. Example: 'class A:\n pass' With quick-fixes provided by the IDE, this code fragment changes to: 'class A(object):\n def __init__(self):\n pass'", - "markdown": "Reports [classic style classes](https://docs.python.org/2/reference/datamodel.html#new-style-and-classic-classes) usage. This inspection applies only to Python 2.\n\n**Example:**\n\n\n class A:\n pass\n\nWith quick-fixes provided by the IDE, this code fragment changes to:\n\n\n class A(object):\n def __init__(self):\n pass\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyClassicStyleClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyPropertyDefinitionInspection", - "shortDescription": { - "text": "Incorrect property definition" - }, - "fullDescription": { - "text": "Reports problems with the arguments of 'property()' and functions annotated with '@property'. 'class C:\n @property\n def abc(self): # Getter should return or yield something\n pass\n\n @abc.setter\n def foo(self, value): # Names of function and decorator don't match\n pass\n\n @abc.setter\n def abc(self, v1, v2): # Setter signature should be (self, value)\n pass\n\n @abc.deleter\n def abc(self, v1): # Delete signature should be (self)\n pass' A quick-fix offers to update parameters.", - "markdown": "Reports problems with the arguments of `property()` and functions\nannotated with `@property`.\n\n\n class C:\n @property\n def abc(self): # Getter should return or yield something\n pass\n\n @abc.setter\n def foo(self, value): # Names of function and decorator don't match\n pass\n\n @abc.setter\n def abc(self, v1, v2): # Setter signature should be (self, value)\n pass\n\n @abc.deleter\n def abc(self, v1): # Delete signature should be (self)\n pass\n\nA quick-fix offers to update parameters." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyPropertyDefinition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyIncorrectDocstringInspection", - "shortDescription": { - "text": "Incorrect docstring" - }, - "fullDescription": { - "text": "Reports mismatched parameters in a docstring. For example, 'b' is highlighted, because there is no such a parameter in the 'add' function. 'def add(a, c):\n \"\"\"\n @param a:\n @param b:\n @return:\n \"\"\"\n pass' The inspection does not warn you of missing parameters if none of them is mentioned in a docstring: 'def mult(a, c):\n \"\"\"\n @return:\n \"\"\"\n pass'", - "markdown": "Reports mismatched parameters in a docstring. For example, `b` is highlighted, because there is no\nsuch a parameter in the `add` function.\n\n\n def add(a, c):\n \"\"\"\n @param a:\n @param b:\n @return:\n \"\"\"\n pass\n\nThe inspection does not warn you of missing parameters if none of them is mentioned in a docstring:\n\n\n def mult(a, c):\n \"\"\"\n @return:\n \"\"\"\n pass\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyIncorrectDocstring", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyEnumInspection", - "shortDescription": { - "text": "Invalid Enum definition and usages" - }, - "fullDescription": { - "text": "Reports invalid definition and usage of Enum. Example: 'from enum import Enum\n\n\nclass Shape(Enum):\n SQUARE = 1\n CIRCLE = 2\n\n\nclass ExtendedShape(Shape): # Enum class 'Shape' is final and cannot be subclassed\n TRIANGLE = 3' 'from enum import Enum\n\n\n class Color(Enum):\n _value_: int\n RED = 1\n GREEN = \"green\" # Type 'str' is not assignable to declared type 'int'' 'from enum import Enum\n\n\n class Pet(Enum):\n CAT = 1\n DOG: int = 2 # Type annotations are not allowed for enum members'", - "markdown": "Reports invalid definition and usage of [Enum](https://peps.python.org/pep-0435/).\n\n\n**Example:**\n\n\n from enum import Enum\n\n\n class Shape(Enum):\n SQUARE = 1\n CIRCLE = 2\n\n\n class ExtendedShape(Shape): # Enum class 'Shape' is final and cannot be subclassed\n TRIANGLE = 3\n\n\n from enum import Enum\n\n\n class Color(Enum):\n _value_: int\n RED = 1\n GREEN = \"green\" # Type 'str' is not assignable to declared type 'int'\n\n\n from enum import Enum\n\n\n class Pet(Enum):\n CAT = 1\n DOG: int = 2 # Type annotations are not allowed for enum members\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyEnum", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyListCreationInspection", - "shortDescription": { - "text": "Non-optimal list declaration" - }, - "fullDescription": { - "text": "Reports cases when a list declaration can be rewritten with a list literal. This ensures better performance of your application. Example: 'l = [1]\nl.append(2)' When the quick-fix is applied, the code changes to: 'l = [1, 2]'", - "markdown": "Reports cases when a list declaration\ncan be rewritten with a list literal.\n\nThis ensures better performance of your application.\n\n**Example:**\n\n\n l = [1]\n l.append(2)\n\nWhen the quick-fix is applied, the code changes to:\n\n\n l = [1, 2]\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "PyListCreation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.jetbrains.restClient", - "version": "251.25776", - "rules": [ - { - "id": "HttpRequestCustomHttpMethodInspection", - "shortDescription": { - "text": "Unknown HTTP method" - }, - "fullDescription": { - "text": "Reports possible custom HTTP methods. The quick fix suggests adding the custom HTTP method to project settings.", - "markdown": "Reports possible custom HTTP methods. The quick fix suggests adding the custom HTTP method to project settings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpRequestCustomHttpMethodInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestRequestSeparatorJsonBodyInspection", - "shortDescription": { - "text": "Missing request separator in JSON body" - }, - "fullDescription": { - "text": "Reports possible requests in injected JSON body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", - "markdown": "Reports possible requests in injected JSON body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpRequestRequestSeparatorJsonBodyInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpClientRunRequestNameInspection", - "shortDescription": { - "text": "Possible request name" - }, - "fullDescription": { - "text": "Highlights request name in run block which has no specified import file. Suggests adding import for the file which contains this named request.", - "markdown": "Highlights request name in run block which has no specified import file. Suggests adding import for the file which contains this named request." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpClientRunRequestNameInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestWhitespaceInsideRequestTargetPath", - "shortDescription": { - "text": "Whitespace in URL in request" - }, - "fullDescription": { - "text": "Highlights spaces inside URL path segments. HTTP Client will ignore them. For better composing use Split Lines action.", - "markdown": "Highlights spaces inside URL path segments. HTTP Client will ignore them. For better composing use Split Lines action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpRequestWhitespaceInsideRequestTargetPath", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpClientUnresolvedAuthId", - "shortDescription": { - "text": "Unresolved Auth identifier" - }, - "fullDescription": { - "text": "Highlights references to non-existent Auth configurations. Suggests creating a new one in the current environment.", - "markdown": "Highlights references to non-existent Auth configurations. Suggests creating a new one in the current environment." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "HttpClientUnresolvedAuthId", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestAmbiguityEncoding", - "shortDescription": { - "text": "Ambiguity Encoding Inspection" - }, - "fullDescription": { - "text": "Detects '+' in an encoded query string. It is ambiguous whether it should be encoded as space or as a '+' character. Example: 'GET https://example.com/api?name=John+Doe%40example.com' After the quick-fix is applied 'GET https://example.com/api?name=John%20Doe%40example.com'", - "markdown": "Detects '+' in an encoded query string. It is ambiguous whether it should be encoded as space or as a '+' character.\n\n**Example:**\n\n\n GET https://example.com/api?name=John+Doe%40example.com\n\nAfter the quick-fix is applied\n\n\n GET https://example.com/api?name=John%20Doe%40example.com\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpRequestAmbiguityEncoding", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestEnvironmentAuthConfigurationValidationInspection", - "shortDescription": { - "text": "Auth configuration validation" - }, - "fullDescription": { - "text": "Reports Auth configuration the following problems in HTTP Client environment files: Missing properties in Auth configuration Auth/Security configuration placed in private environment file", - "markdown": "Reports Auth configuration the following problems in HTTP Client environment files:\n\n* Missing properties in Auth configuration\n* Auth/Security configuration placed in private environment file" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpRequestEnvironmentAuthConfigurationValidationInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestContentLengthIsIgnored", - "shortDescription": { - "text": "Redundant 'Content-Length'" - }, - "fullDescription": { - "text": "Reports an explicitly set 'Content-Length' header. The header is redundant because HTTP Client uses the actual request body length.", - "markdown": "Reports an explicitly set `Content-Length` header. The header is redundant because HTTP Client uses the actual request body length." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpRequestContentLengthIsIgnored", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestRequestSeparatorXmlBodyInspection", - "shortDescription": { - "text": "Missing request separator in HTML/XML body" - }, - "fullDescription": { - "text": "Reports possible requests in injected XML/HTML body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", - "markdown": "Reports possible requests in injected XML/HTML body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpRequestRequestSeparatorXmlBodyInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncorrectHttpHeaderInspection", - "shortDescription": { - "text": "Incorrect HTTP header" - }, - "fullDescription": { - "text": "Reports unknown HTTP headers that do not match any publicly known headers. The quick fix suggests adding the header to the list of custom headers when the Use custom HTTP headers option is enabled. HTTP headers from the list of custom headers will not trigger the inspection.", - "markdown": "Reports unknown HTTP headers that do not match any [publicly\nknown headers](https://www.iana.org/assignments/message-headers/message-headers.xml). The quick fix suggests adding the header to the list of custom headers when the **Use custom HTTP headers** option\nis enabled. HTTP headers from the list of custom headers will not trigger the inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IncorrectHttpHeaderInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpClientInappropriateProtocolUsageInspection", - "shortDescription": { - "text": "Inappropriate HTTP Protocol usage" - }, - "fullDescription": { - "text": "Reports inappropriate usage of HTTP protocol keyword, e.g. 'HTTP/2', with non-HTTP method requests. Such a usage will be ignored.", - "markdown": "Reports inappropriate usage of HTTP protocol keyword, e.g. `HTTP/2`, with non-HTTP method requests. Such a usage will be ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpClientInappropriateProtocolUsageInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestPlaceholder", - "shortDescription": { - "text": "'$placeholder' in HTTP Request" - }, - "fullDescription": { - "text": "Reports a '$placeholder' inside a request. A '$placeholder' to be replaced by the user is created automatically when a tool cannot recognize a part of a request. For example, a request mapping '/aaaa/*/bbb' will be generated as 'GET localhost/aaaa/{{$placeholder}}/bbb'.", - "markdown": "Reports a `$placeholder` inside a request.\n\nA `$placeholder` to be replaced by the user is created automatically when a tool cannot recognize a part of a request. For example, a request mapping `/aaaa/*/bbb` will be generated as `GET localhost/aaaa/{{$placeholder}}/bbb`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpRequestPlaceholder", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpClientUnresolvedVariable", - "shortDescription": { - "text": "Unresolved environment variable" - }, - "fullDescription": { - "text": "Reports variables undeclared in the current environment HTTP Client. Executing requests with undeclared variables probably fail. Consider adding a variable to the environment or selecting an environment with this variable. Inspection doesn't report variables in request bodies, because it can be a valid syntax of the body. Some variables may be not reported as unresolved, because they are declared in response or pre-request handler scripts via 'client.global.set' or 'request.variables.set' functions call.", - "markdown": "Reports variables undeclared in the current environment HTTP Client.\n\n\nExecuting requests with undeclared variables probably fail.\nConsider adding a variable to the environment or selecting an environment with this variable.\n\nInspection doesn't report variables in request bodies, because it can be a valid syntax of the body.\n\n\nSome variables may be not reported as unresolved, because they are declared in response or pre-request handler scripts via\n`client.global.set` or `request.variables.set` functions call." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpClientUnresolvedVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestRequestSeparatorYamlBodyInspection", - "shortDescription": { - "text": "Missing request separator in YAML body" - }, - "fullDescription": { - "text": "Reports possible requests in injected YAML body where request separator '###' is missing. The quick fix suggests adding the separator '###' before the request.", - "markdown": "Reports possible requests in injected YAML body where request separator `###` is missing. The quick fix suggests adding the separator `###` before the request." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpRequestRequestSeparatorYamlBodyInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpUrlsUsage", - "shortDescription": { - "text": "Link with unencrypted protocol" - }, - "fullDescription": { - "text": "Reports the links that use unencrypted protocols (such as HTTP), which can expose your data to man-in-the-middle attacks. These attacks are dangerous in general and may be especially harmful for artifact repositories. Use protocols with encryption, such as HTTPS, instead. See HTTPS: Difference from HTTP (wikipedia.org).", - "markdown": "Reports the links that use unencrypted protocols (such as HTTP), which can expose your data to man-in-the-middle attacks. These attacks\nare dangerous in general and may be especially harmful for artifact repositories. Use protocols with encryption, such as HTTPS,\ninstead.\n\nSee [HTTPS: Difference from HTTP (wikipedia.org)](https://en.wikipedia.org/wiki/HTTPS#Difference_from_HTTP)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpUrlsUsage", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 55, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpClientDuplicateImportInspection", - "shortDescription": { - "text": "Duplicate import" - }, - "fullDescription": { - "text": "Highlights already defined import. Suggests removing duplicated import definition.", - "markdown": "Highlights already defined import. Suggests removing duplicated import definition." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HttpClientDuplicateImportInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HttpRequestJsonBodyInspection", - "shortDescription": { - "text": "Variable should be double-quoted" - }, - "fullDescription": { - "text": "Reports variables which should be double-quoted in json body. The quick fix suggests wrap variable with double quotes '\"{{variable}}\"'.", - "markdown": "Reports variables which should be double-quoted in json body. The quick fix suggests wrap variable with double quotes `\"{{variable}}\"`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HttpRequestJsonBodyInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTTP Client", - "index": 4, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.plugins.postcss", - "version": "251.25776", - "rules": [ - { - "id": "PostCssCustomSelector", - "shortDescription": { - "text": "Invalid custom selector" - }, - "fullDescription": { - "text": "Reports a syntax error in PostCSS Custom Selector. Example: '@custom-selector :--heading h1, h2, h3;'", - "markdown": "Reports a syntax error in [PostCSS Custom Selector](https://github.com/postcss/postcss-custom-selectors).\n\nExample:\n\n\n @custom-selector :--heading h1, h2, h3;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssCustomSelector", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssUnresolvedModuleValueReference", - "shortDescription": { - "text": "Unresolved CSS module value" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a CSS Module Value ('@value' declaration). Example: '@value foo from unknown;'", - "markdown": "Reports an unresolved reference to a [CSS Module Value](https://github.com/css-modules/postcss-modules-values) (`@value` declaration).\n\nExample:\n\n\n @value foo from unknown;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssUnresolvedModuleValueReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssNesting", - "shortDescription": { - "text": "Invalid nested rule" - }, - "fullDescription": { - "text": "Reports a nested style rule whose syntax doesn't comply with the PostCSS Nested or the PostCSS Nesting specification. Example: '.phone {\n &_title {}\n}'", - "markdown": "Reports a nested style rule whose syntax doesn't comply with the [PostCSS Nested](https://github.com/postcss/postcss-nested) or the [PostCSS Nesting](https://github.com/csstools/postcss-nesting) specification.\n\nExample:\n\n\n .phone {\n &_title {}\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PostCssNesting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssCustomMedia", - "shortDescription": { - "text": "Invalid custom media" - }, - "fullDescription": { - "text": "Reports a syntax error in a PostCSS Custom Media query. Example: '@custom-media --small-viewport (max-width: 30em);'", - "markdown": "Reports a syntax error in a [PostCSS Custom Media](https://github.com/postcss/postcss-custom-media) query.\n\nExample:\n\n\n @custom-media --small-viewport (max-width: 30em);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssCustomMedia", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PostCssMediaRange", - "shortDescription": { - "text": "Invalid media query range" - }, - "fullDescription": { - "text": "Checks range context syntax, which may alternatively be used for media features with a 'range' type. Example: '@media screen and (500px <= width <= 1200px) {}'", - "markdown": "Checks [range context](https://github.com/postcss/postcss-media-minmax) syntax, which may alternatively be used for media features with a 'range' type.\n\nExample:\n\n\n @media screen and (500px <= width <= 1200px) {}\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "PostCssMediaRange", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "PostCSS", - "index": 5, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.sass", - "version": "251.25776", - "rules": [ - { - "id": "SassScssUnresolvedMixin", - "shortDescription": { - "text": "Unresolved mixin" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS mixin reference. Example: '* {\n @include unknown-mixin;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS mixin](https://sass-lang.com/documentation/at-rules/mixin) reference.\n\n**Example:**\n\n\n * {\n @include unknown-mixin;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedMixin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Sass_SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssResolvedByNameOnly", - "shortDescription": { - "text": "Missing import" - }, - "fullDescription": { - "text": "Reports a reference to a variable, mixin, or function that is declared in another file but this file isn't explicitly imported in the current file. Example: '* {\n margin: $var-in-other-file;\n}'", - "markdown": "Reports a reference to a variable, mixin, or function that is declared in another file but this file isn't explicitly [imported](https://sass-lang.com/documentation/at-rules/import) in the current file.\n\n**Example:**\n\n\n * {\n margin: $var-in-other-file;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "SassScssResolvedByNameOnly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Sass_SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssUnresolvedPlaceholderSelector", - "shortDescription": { - "text": "Unresolved placeholder selector" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS placeholder selector reference. Example: '* {\n @extend %unknown-placeholder-selector;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS placeholder selector](https://sass-lang.com/documentation/variables) reference.\n\n**Example:**\n\n\n * {\n @extend %unknown-placeholder-selector;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedPlaceholderSelector", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Sass_SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SassScssUnresolvedVariable", - "shortDescription": { - "text": "Unresolved variable" - }, - "fullDescription": { - "text": "Reports an unresolved Sass/SCSS variable reference. Example: '* {\n margin: $unknown-var;\n}'", - "markdown": "Reports an unresolved [Sass/SCSS variable](https://sass-lang.com/documentation/variables) reference.\n\n**Example:**\n\n\n * {\n margin: $unknown-var;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SassScssUnresolvedVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Sass_SCSS", - "index": 6, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.jetbrains.sh", - "version": "251.25776", - "rules": [ - { - "id": "ShellCheck", - "shortDescription": { - "text": "ShellCheck" - }, - "fullDescription": { - "text": "Reports shell script bugs detected by the integrated ShellCheck static analysis tool.", - "markdown": "Reports shell script bugs detected by the integrated [ShellCheck](https://github.com/koalaman/shellcheck) static analysis tool." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "ShellCheck", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "Shell script", - "index": 7, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "Karma", - "version": "251.25776", - "rules": [ - { - "id": "KarmaConfigFile", - "shortDescription": { - "text": "Invalid Karma configuration file" - }, - "fullDescription": { - "text": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, 'karma.conf.js'.", - "markdown": "Reports a potential error in a file path ('basePath', 'files') for a Karma configuration file, for example, `karma.conf.js`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "KarmaConfigFile", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Unit testing", - "index": 8, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.modules.json", - "version": "251.25776", - "rules": [ - { - "id": "JsonSchemaDeprecation", - "shortDescription": { - "text": "Deprecated JSON property" - }, - "fullDescription": { - "text": "Reports a deprecated property in a JSON file. Note that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'.", - "markdown": "Reports a deprecated property in a JSON file. \nNote that deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard extension 'deprecationMessage'." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "JsonSchemaDeprecation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonSchemaRefReference", - "shortDescription": { - "text": "Unresolved '$ref' and '$schema' references" - }, - "fullDescription": { - "text": "Reports an unresolved '$ref' or '$schema' path in a JSON schema.", - "markdown": "Reports an unresolved `$ref` or `$schema` path in a JSON schema. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonSchemaRefReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Json5StandardCompliance", - "shortDescription": { - "text": "Compliance with JSON5 standard" - }, - "fullDescription": { - "text": "Reports inconsistency with the language specification in a JSON5 file.", - "markdown": "Reports inconsistency with [the language specification](http://json5.org) in a JSON5 file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "Json5StandardCompliance", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonDuplicatePropertyKeys", - "shortDescription": { - "text": "Duplicate keys in object literals" - }, - "fullDescription": { - "text": "Reports a duplicate key in an object literal.", - "markdown": "Reports a duplicate key in an object literal." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonDuplicatePropertyKeys", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonSchemaCompliance", - "shortDescription": { - "text": "Compliance with JSON schema" - }, - "fullDescription": { - "text": "Reports inconsistence between a JSON file and the JSON schema that is assigned to it.", - "markdown": "Reports inconsistence between a JSON file and the [JSON schema](https://json-schema.org) that is assigned to it. " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonSchemaCompliance", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonStandardCompliance", - "shortDescription": { - "text": "Compliance with JSON standard" - }, - "fullDescription": { - "text": "Reports the following discrepancies of a JSON file with the language specification: A line or block comment (configurable). Multiple top-level values (expect for JSON Lines files, configurable for others). A trailing comma in an object or array (configurable). A single quoted string. A property key is a not a double quoted strings. A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable).", - "markdown": "Reports the following discrepancies of a JSON file with [the language specification](https://tools.ietf.org/html/rfc7159):\n\n* A line or block comment (configurable).\n* Multiple top-level values (expect for JSON Lines files, configurable for others).\n* A trailing comma in an object or array (configurable).\n* A single quoted string.\n* A property key is a not a double quoted strings.\n* A NaN or Infinity/-Infinity numeric value as a floating point literal (configurable)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "JsonStandardCompliance", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JSON and JSON5", - "index": 9, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.database", - "version": "251.25776", - "rules": [ - { - "id": "MongoJSSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that can cause side effects while the data source is in read-only mode. For more information about enabling read-only mode, see Enable read-only mode for a connection in the IDE documentation. The Disable read-only mode quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", - "markdown": "Reports statements that can cause side effects while the data source is in read-only mode.\n\nFor more information about enabling read-only mode, see\n[Enable\nread-only mode for a connection in the IDE documentation](https://www.jetbrains.com/help/datagrip/configuring-database-connections.html#enable-read-only-mode-for-a-connection).\n\nThe **Disable read-only mode** quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlLoadDataPathInspection", - "shortDescription": { - "text": "LOAD statement path" - }, - "fullDescription": { - "text": "Reports paths that start with the tilde character in LOAD statements. Example (MySQL): 'CREATE TABLE table_name (id int);\nLOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\nINTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\nIGNORE 1 LINES;' Instead of the tilde character, use a full path to the file.", - "markdown": "Reports paths that start with the tilde character in LOAD statements.\n\nExample (MySQL):\n\n CREATE TABLE table_name (id int);\n LOAD DATA LOCAL INFILE '~/Documents/some_file.txt'\n INTO TABLE table_name FIELDS TERMINATED BY ',' LINES TERMINATED BY '\\n'\n IGNORE 1 LINES;\n\nInstead of the tilde character, use a full path to the file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MysqlLoadDataPath", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that may cause side effects while the data source is in read-only mode. The quick-fix turns off the read-only mode for the respective data source. Example: 'db.my_collection.insertOne()'", - "markdown": "Reports statements that may cause side effects while the data source is in read-only mode.\n\nThe quick-fix turns off the read-only mode for the respective data source.\n\nExample:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlSpaceAfterFunctionNameInspection", - "shortDescription": { - "text": "Whitespace between the function name and the open parenthesis" - }, - "fullDescription": { - "text": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default. Example (MySQL): 'SELECT MAX (qty) FROM orders;'", - "markdown": "Reports any whitespace in a function call between the function name and the open parenthesis, which is not supported by default.\n\nExample (MySQL):\n\n SELECT MAX (qty) FROM orders;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "MysqlSpaceAfterFunctionName", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlJoinCountInspection", - "shortDescription": { - "text": "Excessive JOIN count" - }, - "fullDescription": { - "text": "Reports queries with excessive number of JOINS. Using too many joins is generally not recommended for performance reasons. 'SELECT * FROM a inner join b using(id) inner join c using (id) inner join d using (id) inner join e using (id)'", - "markdown": "Reports queries with excessive number of JOINS.\n\nUsing too many joins is generally\nnot recommended for performance reasons.\n\n SELECT * FROM a inner join b using(id) inner join c using (id) inner join d using (id) inner join e using (id)\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlJoinCount", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMissingReturnInspection", - "shortDescription": { - "text": "Missing return statement" - }, - "fullDescription": { - "text": "Reports functions that have no RETURN statements. Example (Oracle): 'CREATE FUNCTION foo RETURN int AS\nBEGIN\nEND;' The 'foo' function must return the integer value but the function body returns nothing. To fix the error, add a RETURN statement (for example, 'return 1;'). 'CREATE FUNCTION foo RETURN int AS\nBEGIN\n RETURN 1;\nEND;'", - "markdown": "Reports functions that have no RETURN statements.\n\nExample (Oracle):\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n END;\n\nThe `foo` function must return the integer value but the function body returns nothing. To fix the error,\nadd a RETURN statement (for example, `return 1;`).\n\n CREATE FUNCTION foo RETURN int AS\n BEGIN\n RETURN 1;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlMissingReturn", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedSubqueryItemInspection", - "shortDescription": { - "text": "Unused subquery item" - }, - "fullDescription": { - "text": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression. Example (PostgreSQL): 'CREATE TABLE for_subquery(id INT);\nSELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;' We reference 'a' and 'q' aliases from a subquery. But the 'b' alias and the 'id' column are not referenced in the outer SELECT statement. Therefore, 'b' and 'id' are grayed out.", - "markdown": "Reports columns, aliases, and other subquery items that are not referenced in the outer query expression.\n\nExample (PostgreSQL):\n\n CREATE TABLE for_subquery(id INT);\n SELECT a, q FROM (SELECT 1 AS a, 10 AS b, 2 + 3 AS q, id\n FROM for_subquery) x;\n\nWe reference `a` and `q` aliases from a subquery. But the `b` alias and the `id` column are\nnot referenced in the outer SELECT statement. Therefore, `b` and `id` are grayed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnused", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCaseVsIfInspection", - "shortDescription": { - "text": "Using CASE instead of conditional function and vice versa" - }, - "fullDescription": { - "text": "Reports situations when CASE and IF are interchangeable. Example (MySQL): 'SELECT CASE\nWHEN C1 IS NULL THEN 1\nELSE 0\nEND\nFROM dual;' To keep your code short, you can replace the CASE structure with IF. You can do that by applying the Replace with 'IF' call intention action. The example code will look as follows: 'SELECT IF(C1 IS NULL, 1, 0)\nFROM dual;' To revert IF to CASE, click IF and apply the Replace with CASE expression intention action.", - "markdown": "Reports situations when CASE and IF are interchangeable.\n\nExample (MySQL):\n\n SELECT CASE\n WHEN C1 IS NULL THEN 1\n ELSE 0\n END\n FROM dual;\n\nTo keep your code short, you can replace the CASE structure with IF. You can do that by applying the **Replace with 'IF' call**\nintention action. The example code will look as follows:\n\n SELECT IF(C1 IS NULL, 1, 0)\n FROM dual;\n\nTo revert IF to CASE, click IF and apply the **Replace with CASE expression** intention action." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCaseVsIf", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlShouldBeInGroupByInspection", - "shortDescription": { - "text": "Column should be in group by clause" - }, - "fullDescription": { - "text": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call. Example (Microsoft SQL Server): 'CREATE TABLE t1 (a INT, b INT);\nSELECT a, b FROM t1 GROUP BY a;' If you run the SELECT query, you will receive an error because Microsoft SQL Server expects the 'b' column in GROUP BY or used inside an aggregate function. The following two examples will fix the error. 'SELECT a, b FROM t1 GROUP BY a, b;\nSELECT a, max(b) max_b FROM t1 GROUP BY a;'", - "markdown": "Reports columns that are not in the GROUP BY clause or inside an aggregate function call.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t1 (a INT, b INT);\n SELECT a, b FROM t1 GROUP BY a;\n\nIf you run the SELECT query, you will receive an error because Microsoft SQL Server expects the `b` column in GROUP BY or used\ninside an aggregate function. The following two examples will fix the error.\n\n SELECT a, b FROM t1 GROUP BY a, b;\n SELECT a, max(b) max_b FROM t1 GROUP BY a;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlShouldBeInGroupBy", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAutoIncrementDuplicateInspection", - "shortDescription": { - "text": "Auto-increment duplicate" - }, - "fullDescription": { - "text": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key. Example (MySQL): 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n);' The AUTO_INCREMENT constraint for 'c2' will be highlighted as 'c1' already has this constraint. To fix the warning, you can make 'id' a primary key and delete AUTO_INCREMENT for 'c2'. 'CREATE TABLE my_table\n(\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n);'", - "markdown": "Reports tables that contain two columns with an automatic increment. In MySQL, Microsoft SQL Server, and Db2 dialects, a table can have only one field with a auto-increment option, and this field must be a key.\n\nExample (MySQL):\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT,\n c2 INT AUTO_INCREMENT,\n );\n\nThe AUTO_INCREMENT constraint for `c2` will be highlighted as `c1` already has this constraint. To fix the warning,\nyou can make `id` a primary key and delete AUTO_INCREMENT for `c2`.\n\n CREATE TABLE my_table\n (\n id INT AUTO_INCREMENT PRIMARY KEY,\n c2 INT,\n );\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAutoIncrementDuplicate", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlStringLengthExceededInspection", - "shortDescription": { - "text": "Implicit string truncation" - }, - "fullDescription": { - "text": "Reports variables that exceed the defined length in characters. Example (Microsoft SQL Server): 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;' The 'myVarExceeded' variable is defined as 'VARCHAR(5)' but both assigned values (''abcde12345'' and ''123456789'') exceed this limitation. You can truncate assigned values or increase the defined length. To increase the length, use the Increase type length quick-fix. After the quick-fix is applied: 'CREATE PROCEDURE test() AS\nBEGIN\nDECLARE myVarOk VARCHAR(5) = 'abcde';\nDECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\nSET myVarOk = 'xyz';\nSET myVarExceeded = '123456789';\nEND;'", - "markdown": "Reports variables that exceed the defined length in characters.\n\nExample (Microsoft SQL Server):\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(5) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n\nThe `myVarExceeded` variable is defined as `VARCHAR(5)` but both assigned values (`'abcde12345'` and\n`'123456789'`) exceed this limitation. You can truncate assigned values or increase the defined length.\nTo increase the length, use the **Increase type length** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE PROCEDURE test() AS\n BEGIN\n DECLARE myVarOk VARCHAR(5) = 'abcde';\n DECLARE myVarExceeded VARCHAR(10) = 'abcde12345';\n\n SET myVarOk = 'xyz';\n SET myVarExceeded = '123456789';\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlStringLengthExceeded", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlSideEffectsInspection", - "shortDescription": { - "text": "Statement with side effects" - }, - "fullDescription": { - "text": "Reports statements that might lead to modification of a database during a read-only connection. To enable read-only mode for a connection, right-click a data source in the Database tool window (View | Tool Windows | Database) and select Properties. In the Data Sources and Drivers dialog, click the Options tab and select the Read-only checkbox. Example (MySQL): 'CREATE TABLE foo(a INT);\nINSERT INTO foo VALUES (1);' As 'CREATE TABLE' and 'INSERT INTO' statements lead to a database modification, these statements will be highlighted in read-only connection mode.", - "markdown": "Reports statements that might lead to modification of a database during a read-only connection.\n\nTo enable read-only mode for a\nconnection,\nright-click a data source in the **Database** tool window (**View \\| Tool Windows \\| Database** ) and select **Properties** .\nIn the **Data Sources and Drivers** dialog, click the **Options** tab and select the **Read-only** checkbox.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT);\n INSERT INTO foo VALUES (1);\n\nAs `CREATE TABLE` and `INSERT INTO` statements lead to a database modification, these statements will be highlighted\nin read-only connection mode." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlSideEffects", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDtInspection", - "shortDescription": { - "text": "Ill-formed date/time literals" - }, - "fullDescription": { - "text": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2. Example (MySQL): 'SELECT TIME '10 -12:13:14' FROM dual;\nSELECT TIME ' 12 : 13 : 14 ' FROM dual;\nSELECT TIME '12 13 14' FROM dual;\nSELECT TIME '12-13-14' FROM dual;\nSELECT TIME '12.13.14' FROM dual;\nSELECT TIME '12:13:' FROM dual;\nSELECT TIME '12:13' FROM dual;\nSELECT TIME '12:' FROM dual;' In this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted. For more information about date and time literals in MySQL, see Date and Time Literals at dev.mysql.com. The following date and type literals are valid for MySQL. 'SELECT TIME '12:13:14' FROM dual;\nSELECT TIME '12:13:14.555' FROM dual;\nSELECT TIME '12:13:14.' FROM dual;\nSELECT TIME '-12:13:14' FROM dual;\nSELECT TIME '10 12:13:14' FROM dual;\nSELECT TIME '-10 12:13:14' FROM dual;'", - "markdown": "Reports errors in date and time literals. This inspection is available in MySQL, Oracle, Db2, and H2.\n\nExample (MySQL):\n\n SELECT TIME '10 -12:13:14' FROM dual;\n SELECT TIME ' 12 : 13 : 14 ' FROM dual;\n SELECT TIME '12 13 14' FROM dual;\n SELECT TIME '12-13-14' FROM dual;\n SELECT TIME '12.13.14' FROM dual;\n SELECT TIME '12:13:' FROM dual;\n SELECT TIME '12:13' FROM dual;\n SELECT TIME '12:' FROM dual;\n\nIn this example, dates ignore the MySQL standard for date and time literals. Therefore, they will be highlighted.\nFor more information about date and time literals in MySQL, see [Date and Time Literals at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-literals.html).\n\nThe following date and type literals are valid for MySQL.\n\n SELECT TIME '12:13:14' FROM dual;\n SELECT TIME '12:13:14.555' FROM dual;\n SELECT TIME '12:13:14.' FROM dual;\n SELECT TIME '-12:13:14' FROM dual;\n SELECT TIME '10 12:13:14' FROM dual;\n SELECT TIME '-10 12:13:14' FROM dual;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDateTime", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlIllegalCursorStateInspection", - "shortDescription": { - "text": "Illegal cursor state" - }, - "fullDescription": { - "text": "Reports illegal cursor states inside SQL routines. A routine has CLOSE or FETCH statements but a cursor might be closed. A routine has the OPEN statement but a cursor might be opened. Example (Microsoft SQL Server): 'CREATE TABLE t(col INT);\n\nCREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;' According to CLOSE (Transact-SQL) at docs.microsoft.com, CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are already closed. So, we need to open the cursor to fix the warning. 'CREATE PROCEDURE foo() AS\nBEGIN\nDECLARE my_cursor CURSOR FOR SELECT * FROM t;\nDECLARE a INT;\nOPEN my_cursor;\nFETCH my_cursor INTO a;\nCLOSE my_cursor;\nEND;'", - "markdown": "Reports illegal cursor states inside SQL routines.\n\n* A routine has CLOSE or FETCH statements but a cursor might be closed.\n* A routine has the OPEN statement but a cursor might be opened.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE t(col INT);\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n\nAccording to [CLOSE (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/close-transact-sql), CLOSE must be issued on an open cursor, and CLOSE is not allowed on cursors that have only been declared or are\nalready closed. So, we need to open the cursor to fix the warning.\n\n CREATE PROCEDURE foo() AS\n BEGIN\n DECLARE my_cursor CURSOR FOR SELECT * FROM t;\n DECLARE a INT;\n OPEN my_cursor;\n FETCH my_cursor INTO a;\n CLOSE my_cursor;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlIllegalCursorState", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlJoinWithoutOnInspection", - "shortDescription": { - "text": "Unsafe 'join' clause in 'delete' statement" - }, - "fullDescription": { - "text": "Reports missing conditional checks for statements that might modify the whole database. For example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops contents of the entire table. Example (MySQL): 'CREATE TABLE foo (a INT,b INT,c INT);\nCREATE TABLE bar (a INT,b INT,c INT);\n\nDELETE table1 FROM foo table1 INNER JOIN bar table2;'", - "markdown": "Reports missing conditional checks for statements that might modify the whole database.\n\nFor example, usages of JOIN clauses inside DELETE statements without ON or WHERE. Without conditional checks on JOIN, DELETE drops\ncontents of the entire table.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT,b INT,c INT);\n CREATE TABLE bar (a INT,b INT,c INT);\n\n DELETE table1 FROM foo table1 INNER JOIN bar table2;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlJoinWithoutOn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDropIndexedColumnInspection", - "shortDescription": { - "text": "Index is dependent on column" - }, - "fullDescription": { - "text": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE. Example (Microsoft SQL Server): 'CREATE TABLE test_index\n(\ncol INT NOT NULL,\ncol2 INT NOT NULL,\ncol3 INT NOT NULL UNIQUE,\ncol4 VARCHAR(200)\n);\n\nCREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\nALTER TABLE test_index\nDROP COLUMN col;' You cannot delete the 'col' column because it is in the indexed table. To delete the column, you need to delete the 'aaaa' index first (for example, DROP INDEX aaaa).", - "markdown": "Reports cases when you try to drop columns from indexed tables. This inspection is available in Microsoft SQL Server and Sybase ASE.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE test_index\n (\n col INT NOT NULL,\n col2 INT NOT NULL,\n col3 INT NOT NULL UNIQUE,\n col4 VARCHAR(200)\n );\n\n CREATE UNIQUE INDEX aaaa ON test_index (col, col2);\n\n ALTER TABLE test_index\n DROP COLUMN col;\n\nYou cannot delete the `col` column because it is in the indexed table. To delete the column, you need to delete the\n`aaaa` index first (for example, DROP INDEX aaaa)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDropIndexedColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCheckUsingColumnsInspection", - "shortDescription": { - "text": "Check using clause columns" - }, - "fullDescription": { - "text": "Reports columns in the USING clause that does not exist in both tables. Example (MySQL): 'CREATE TABLE t1 (i INT, j INT);\nCREATE TABLE t2 (k INT, l INT);\nSELECT * FROM t1 JOIN t2 USING (j);' In USING clauses, a column name must be present in both tables, and the SELECT query will automatically join those tables by using the given column name. As we do not have the 'j' column in 't2', we can rewrite the query using ON. The ON clause can join tables where the column names do not match in both tables. 'SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;'", - "markdown": "Reports columns in the USING clause that does not exist in both tables.\n\nExample (MySQL):\n\n CREATE TABLE t1 (i INT, j INT);\n CREATE TABLE t2 (k INT, l INT);\n SELECT * FROM t1 JOIN t2 USING (j);\n\nIn USING clauses, a column name must be present in both tables, and the SELECT query will automatically join\nthose tables by using the given column name. As we do not have the `j` column in `t2`, we can\nrewrite the query using ON. The ON clause can join tables where the column names do not match in both tables.\n\n SELECT * FROM t1 JOIN t2 ON t1.j = t2.l;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCheckUsingColumns", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertValuesInspection", - "shortDescription": { - "text": "VALUES clause cardinality" - }, - "fullDescription": { - "text": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\n\nINSERT INTO foo VALUES (1,2,3,4)' The 'foo' table has three columns but in the INSERT INTO statement we pass four.", - "markdown": "Reports situations when a number of parameters in VALUES does not match a number of columns in a target table.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n\n INSERT INTO foo VALUES (1,2,3,4)\n\nThe `foo` table has three columns but in the INSERT INTO statement we pass four." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertValues", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDialectInspection", - "shortDescription": { - "text": "SQL dialect detection" - }, - "fullDescription": { - "text": "Reports situations when a dialect is not assigned to an SQL file. For example, when you open a new SQL file without assigning a dialect to it, you see a notification where the best matching dialect is advised. Click the Use link to use the advised dialect. Alternatively, click the Change dialect to link to select the other dialect.", - "markdown": "Reports situations when a dialect is not assigned to an SQL file.\n\nFor example, when you open a new SQL file without assigning a dialect\nto it, you see a notification where the best matching dialect is advised. Click the **Use \\** link to use the advised\ndialect. Alternatively, click the **Change dialect to** link to select the other dialect." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDialectInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantElseNullInspection", - "shortDescription": { - "text": "Redundant ELSE NULL clause" - }, - "fullDescription": { - "text": "Reports redundant ELSE NULL clauses. Example (MySQL): 'SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;' The 'ELSE NULL' part will never be executed and may be omitted.", - "markdown": "Reports redundant ELSE NULL clauses.\n\nExample (MySQL):\n\n SELECT CASE WHEN 2 > 1 THEN 'OK' ELSE NULL END AS alias FROM foo;\n\nThe `ELSE NULL` part will never be executed and may be omitted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantElseNull", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCallNotationInspection", - "shortDescription": { - "text": "Using of named and positional arguments" - }, - "fullDescription": { - "text": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2. Example (In PostgreSQL): 'CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n$$\nBEGIN\n RETURN a + b + c;\nEND\n$$;\nSELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\nSELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\nSELECT foo(b => 2, 1, 3);'", - "markdown": "Reports calls in which positional arguments go after the named ones. Works in PostgreSQL, Oracle, and Db2.\n\nExample (In PostgreSQL):\n\n CREATE FUNCTION foo(a int, b int, c int) RETURNS int\n LANGUAGE plpgsql AS\n $$\n BEGIN\n RETURN a + b + c;\n END\n $$;\n SELECT foo(a => 1, b => 2, c => 3);\n -- `3` goes after the named argument\n SELECT foo(1, b => 2, 3);\n -- `1` and `3` go after the named argument\n SELECT foo(b => 2, 1, 3);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlCallNotation", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MysqlParsingInspection", - "shortDescription": { - "text": "Unsupported syntax in pre-8.0 versions" - }, - "fullDescription": { - "text": "Reports invalid usages of UNION in queries. The inspection works in MySQL versions that are earlier than 8.0. Example (MySQL): 'SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;'", - "markdown": "Reports invalid usages of UNION in queries.\n\nThe inspection works in MySQL versions that are earlier than 8.0.\n\nExample (MySQL):\n\n\n SELECT * FROM (SELECT 1 UNION (SELECT 1 UNION SELECT 2)) a;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MysqlParsing", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "MySQL", - "index": 13, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtDeprecationInspection", - "shortDescription": { - "text": "Deprecated element" - }, - "fullDescription": { - "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", - "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDuplicateColumnInspection", - "shortDescription": { - "text": "Duplicating column name in SELECT" - }, - "fullDescription": { - "text": "Reports duplicated names of column aliases in SELECT lists. Example (Sybase ASE): 'CREATE TABLE t1 (a TEXT, b INT, c INT);\n\nSELECT a AS x, b AS x FROM t1;' The 'x' alias name is used for 'a' and 'b' columns. These assignments are highlighted as errors because you cannot use identical alias names for columns in Sybase ASE.", - "markdown": "Reports duplicated names of column aliases in SELECT lists.\n\nExample (Sybase ASE):\n\n CREATE TABLE t1 (a TEXT, b INT, c INT);\n\n SELECT a AS x, b AS x FROM t1;\n\nThe `x` alias name is used for `a` and `b` columns. These assignments are highlighted as errors because\nyou cannot use identical alias names for columns in Sybase ASE." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDuplicateColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlShadowingAliasInspection", - "shortDescription": { - "text": "Column is shadowed by alias" - }, - "fullDescription": { - "text": "Reports SELECT aliases with names that match column names in the FROM clause. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT);\nSELECT a b, c FROM foo;' The 'a' column uses the 'b' alias but the 'b' name is also used by the column from the 'foo' table.", - "markdown": "Reports SELECT aliases with names that match column names in the FROM clause.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT);\n SELECT a b, c FROM foo;\n\nThe `a` column uses the `b` alias but the `b` name is also used by the column from the `foo`\ntable." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlShadowingAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSDeprecationInspection", - "shortDescription": { - "text": "Deprecated element" - }, - "fullDescription": { - "text": "Reports usages of deprecated methods in MongoDB and JavaScript code. The quick-fix replaces deprecated methods with recommended alternatives. Example: 'db.my_collection.insert()' After the quick-fix is applied: 'db.my_collection.insertOne()'", - "markdown": "Reports usages of deprecated methods in MongoDB and JavaScript code.\n\nThe quick-fix replaces deprecated methods with recommended alternatives.\n\nExample:\n\n db.my_collection.insert()\n\nAfter the quick-fix is applied:\n\n db.my_collection.insertOne()\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSDeprecation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTypeInspection", - "shortDescription": { - "text": "Types compatibility" - }, - "fullDescription": { - "text": "Reports type-related errors.", - "markdown": "Reports type-related errors." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnreachableCodeInspection", - "shortDescription": { - "text": "Unreachable code" - }, - "fullDescription": { - "text": "Reports unreachable statements inside SQL routines. Example (Microsoft SQL Server): 'CREATE FUNCTION foo() RETURNS INT AS\nBEGIN\n THROW;\n RETURN 1;\nEND;' In Microsoft SQL Server, the 'THROW' statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH construct. Therefore, the 'RETURN 1;' part will never be executed.", - "markdown": "Reports unreachable statements inside SQL routines.\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo() RETURNS INT AS\n BEGIN\n THROW;\n RETURN 1;\n END;\n\nIn Microsoft SQL Server, the `THROW` statement raises an exception and transfers execution to the CATCH block of the TRY...CATCH\nconstruct. Therefore, the `RETURN 1;` part will never be executed." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnreachable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnicodeStringLiteralInspection", - "shortDescription": { - "text": "Unicode usage in SQL" - }, - "fullDescription": { - "text": "Reports string literals that use national characters without the 'N' prefix. Without the N prefix, the string is converted to the default code page of the database. This default code page may not recognize certain characters. For more information, see nchar and nvarchar (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL Server): 'SELECT 'abcde' AS a;\nSELECT N'abcde' AS b;\nSELECT 'абвгд' AS c;\nSELECT N'абвгд' AS d;' The 'SELECT 'абвгд' AS c;' does not have the 'N' prefix, the ''абвгд'' part will be highlighted.", - "markdown": "Reports string literals that use national characters without the `N` prefix.\n\nWithout the N prefix, the string is converted to the default\ncode page of the database. This default code page may not recognize certain characters. For more information, see\n[nchar and nvarchar\n(Transact-SQL)\nat docs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql).\n\nExample (Microsoft SQL Server):\n\n SELECT 'abcde' AS a;\n SELECT N'abcde' AS b;\n SELECT 'абвгд' AS c;\n SELECT N'абвгд' AS d;\n\nThe `SELECT 'абвгд' AS c;` does not have the `N` prefix, the `'абвгд'` part will be highlighted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnicodeStringLiteral", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlSingleSessionModeInspection", - "shortDescription": { - "text": "Create a temporary table without a single session mode" - }, - "fullDescription": { - "text": "Reports temporary tables creation not in the single-session mode. Example (PostgreSQL): 'CREATE TEMPORARY TABLE foo(a INT, b INT);'", - "markdown": "Reports temporary tables creation not in the single-session mode.\n\nExample (PostgreSQL):\n\n CREATE TEMPORARY TABLE foo(a INT, b INT);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlSingleSessionMode", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlNoDataSourceInspection", - "shortDescription": { - "text": "No data sources configured" - }, - "fullDescription": { - "text": "Reports the absence of data sources in the Database tool window (View | Tool Windows | Database).", - "markdown": "Reports the absence of data sources in the **Database** tool window (**View \\| Tool Windows \\| Database**)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlNoDataSourceInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedVariableInspection", - "shortDescription": { - "text": "Unused variable" - }, - "fullDescription": { - "text": "Reports unused arguments, variables, or parameters. Example (PostgreSQL): 'CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n$$\nBEGIN\n RETURN PARAMUSED;\nEND\n$$ LANGUAGE plpgsql;' The 'PARAMUNUSED' parameter is not used in the function and might be deleted.", - "markdown": "Reports unused arguments, variables, or parameters.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION foo(PARAMUSED INT, PARAMUNUSED INT) RETURNS INT AS\n $$\n BEGIN\n RETURN PARAMUSED;\n END\n $$ LANGUAGE plpgsql;\n\nThe `PARAMUNUSED` parameter is not used in the function and might be deleted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnused", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlResolveInspection", - "shortDescription": { - "text": "Unresolved reference" - }, - "fullDescription": { - "text": "Reports unresolved SQL references. Example (MySQL): 'CREATE TABLE users(id INT, name VARCHAR(40));\nCREATE TABLE admins(id INT, col1 INT);\n\nSELECT users.id, admins.id FROM admins WHERE admins.id > 1;' The 'users.id' column is unresolved because the 'users' table is missing in the FROM clause.", - "markdown": "Reports unresolved SQL references.\n\nExample (MySQL):\n\n CREATE TABLE users(id INT, name VARCHAR(40));\n CREATE TABLE admins(id INT, col1 INT);\n\n SELECT users.id, admins.id FROM admins WHERE admins.id > 1;\n\nThe `users.id` column is unresolved because the `users` table is missing in the FROM clause." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlResolve", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PgSelectFromProcedureInspection", - "shortDescription": { - "text": "Postgres: Select from procedure call" - }, - "fullDescription": { - "text": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, 'AS t1(s VARCHAR)'). This requirement does not apply to scalar functions. Example (PostgreSQL): 'CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\nSELECT 1;\n$$ LANGUAGE sql;\nSELECT * FROM produce_a_table() AS s (c1 INT);\nSELECT * FROM produce_a_table() AS s (c1);\nSELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;' The 'AS s (c1 INT)' has a typed alias, while 'AS s (c1)' and 'AS t1' do not. In this case, the second call of 'produce_a_table()' and 'DBLINK()' will be highlighted.", - "markdown": "Reports situations when you make SELECT from a function or a DBLINK without an alias with a type (for example, `AS t1(s VARCHAR)`).\n\nThis requirement does not apply to scalar functions.\n\nExample (PostgreSQL):\n\n CREATE FUNCTION produce_a_table() RETURNS RECORD AS $$\n SELECT 1;\n $$ LANGUAGE sql;\n SELECT * FROM produce_a_table() AS s (c1 INT);\n SELECT * FROM produce_a_table() AS s (c1);\n SELECT * FROM DBLINK('dbname=mydb', 'SELECT proname, prosrc FROM pg_proc') AS t1;\n\nThe `AS s (c1 INT)` has a typed alias, while `AS s (c1)` and `AS t1` do not.\nIn this case, the second call of `produce_a_table()` and `DBLINK()` will be highlighted." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PgSelectFromProcedure", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "PostgreSQL", - "index": 57, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCurrentSchemaInspection", - "shortDescription": { - "text": "Current console schema introspected" - }, - "fullDescription": { - "text": "Reports schemas and databases in the current session that are not introspected. For example, this warning might occur when you try to create a table in the schema that is not introspected. Introspection is a method of inspecting a data source. When you perform introspection, structural information in the data source is inspected to detect tables, columns, functions, and other elements with their attributes.", - "markdown": "Reports schemas and databases in the current session that are not introspected.\n\nFor example, this warning might occur when you try to create a table in the schema that is not introspected.\n\nIntrospection is a method of inspecting a data source. When you perform introspection, structural information in the data source is\ninspected to detect tables, columns, functions, and other elements with their attributes." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCurrentSchemaInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMisleadingReferenceInspection", - "shortDescription": { - "text": "Misleading references" - }, - "fullDescription": { - "text": "Reports ambiguous references in SQL code. For example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected results due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority. Example (PostgreSQL): 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\nDECLARE\n b INT;\nBEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;' In PostgreSQL, you can use the '#variable_conflict' directives to explicitly specify a correct reference. For example, use '#variable_conflict use_column' to refer to a column name, or '#variable_conflict use_variable' to refer to a parameter. 'CREATE TABLE foo\n(\n id INT,\n name VARCHAR(5)\n);\nCREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n$$\n #variable_conflict use_column\nDECLARE\n b INT;\nBEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\nEND;\n$$ LANGUAGE plpgsql;'", - "markdown": "Reports ambiguous references in SQL code.\n\nFor example, when a name refer to both a table column and a routine parameter. The execution of such code might lead to errors or unexpected\nresults due to counter-intuitive resolution logic. Usually, names with a more local scope have higher priority.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n DECLARE\n b INT;\n BEGIN\n -- `name` is ambiguous as it is used as a column name and a parameter\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n\nIn PostgreSQL, you can use the `#variable_conflict` directives to explicitly specify a correct reference. For example,\nuse `#variable_conflict use_column` to refer to a column name, or `#variable_conflict use_variable` to refer to a\nparameter.\n\n CREATE TABLE foo\n (\n id INT,\n name VARCHAR(5)\n );\n CREATE FUNCTION func(name VARCHAR(5)) RETURNS INT AS\n $$\n #variable_conflict use_column\n DECLARE\n b INT;\n BEGIN\n SELECT COUNT(*) INTO b FROM foo t WHERE t.name = name;\n RETURN b;\n END;\n $$ LANGUAGE plpgsql;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMisleadingReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertIntoGeneratedColumnInspection", - "shortDescription": { - "text": "Insertion into generated columns" - }, - "fullDescription": { - "text": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written. Example (PostgreSQL): 'CREATE TABLE foo\n(\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n);\nINSERT INTO foo(col1, col2) VALUES (1, 2);'\n You cannot insert '2' into the 'col2' column because this column is generated. For this script to work, you can change '2' to DEFAULT. 'INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);'", - "markdown": "Reports INSERT statements that assign values to generated columns. Generated columns can be read, but their values can not be directly written.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo\n (\n col1 INT,\n col2 INT GENERATED ALWAYS AS (col1 + 1) STORED\n );\n INSERT INTO foo(col1, col2) VALUES (1, 2);\n\nYou cannot insert `2` into the `col2` column because this column is generated.\nFor this script to work, you can change `2` to DEFAULT.\n`INSERT INTO foo(col1, col2) VALUES (1, DEFAULT);`" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertIntoGeneratedColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantLimitInspection", - "shortDescription": { - "text": "Redundant row limiting in queries" - }, - "fullDescription": { - "text": "Reports redundant row limiting clauses like FETCH and LIMIT in queries. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);' To fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because the usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first 'N' rows and this will influence the output. 'SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\nSELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);'", - "markdown": "Reports redundant row limiting clauses like FETCH and LIMIT in queries.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo FETCH FIRST 2 ROWS ONLY);\n\nTo fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because\nthe usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first `N` rows and this will\ninfluence the output.\n\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW LIMIT 2);\n SELECT * FROM foo WHERE EXISTS(SELECT * FROM foo OFFSET 1 ROW FETCH FIRST 2 ROWS ONLY);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantLimit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlInsertNullIntoNotNullInspection", - "shortDescription": { - "text": "Insert NULL into NOT NULL column" - }, - "fullDescription": { - "text": "Reports cases when you insert NULL values into columns that accept only NOT NULL values. Example (Microsoft SQL Server): 'CREATE TABLE br2 (\nid INT NOT NULL,\ncol1 NVARCHAR (20) NOT NULL,\ncol2 NVARCHAR (20) NOT NULL,\n);\n--\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, NULL, NULL);' You cannot insert NULL values in 'col1' and 'col2' because they are defined as NOT NULL. If you run the script as is, you will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, '42' and ''bird''). INSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');", - "markdown": "Reports cases when you insert NULL values into columns that accept only NOT NULL values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE br2 (\n id INT NOT NULL,\n col1 NVARCHAR (20) NOT NULL,\n col2 NVARCHAR (20) NOT NULL,\n );\n --\n INSERT INTO br2 (id, col1, col2)\n VALUES (1, NULL, NULL);\n\nYou cannot insert NULL values in `col1` and `col2` because they are defined as NOT NULL. If you run the script as\nis,\nyou will receive an error. To fix this code, replace NULL in the VALUES part with some values (for example, `42` and\n`'bird'`).\n\n```\nINSERT INTO br2 (id, col1, col2)\nVALUES (1, 42, 'bird');\n```" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlInsertNullIntoNotNull", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDerivedTableAliasInspection", - "shortDescription": { - "text": "Each derived table should have alias" - }, - "fullDescription": { - "text": "Reports derived tables without aliases. Example (MySQL): 'CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\nCREATE TABLE table2 (id INT, age INTEGER);\n\nSELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);' According to Derived Tables at dev.mysql.com, an alias is mandatory. You can add the alias by using the Introduce alias quick-fix. After the quick-fix is applied: 'SELECT id AS ID, name, cats, age\nFROM (SELECT table1.id, name, cats, age\nFROM table1\nJOIN table2 ON table1.id = table2.id);'", - "markdown": "Reports derived tables without aliases.\n\nExample (MySQL):\n\n CREATE TABLE table1 (id INT, name VARCHAR(20), cats FLOAT);\n CREATE TABLE table2 (id INT, age INTEGER);\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n\nAccording to [Derived Tables at dev.mysql.com](https://dev.mysql.com/doc/refman/8.0/en/derived-tables.html), an alias is\nmandatory. You can add the alias by using the **Introduce alias** quick-fix.\n\nAfter the quick-fix is applied:\n\n SELECT id AS ID, name, cats, age\n FROM (SELECT table1.id, name, cats, age\n FROM table1\n JOIN table2 ON table1.id = table2.id);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDerivedTableAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MsBuiltinInspection", - "shortDescription": { - "text": "Builtin functions" - }, - "fullDescription": { - "text": "Reports truncations of string arguments in ISNULL functions. The ISNULL syntax is 'ISNULL(check_expression, replacement_value)'. According to ISNULL at docs.microsoft.com, 'replacement_value' will be truncated if 'replacement_value' is longer than 'check_expression'. Example (Microsoft SQL Server): 'DECLARE @name1 VARCHAR(2) = NULL;\nDECLARE @name2 VARCHAR(10) = 'Example';\nDECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\nSELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\nSELECT ISNULL(@name1, @name3);'", - "markdown": "Reports truncations of string arguments in ISNULL functions.\n\nThe ISNULL syntax is `ISNULL(check_expression, replacement_value)`.\n\nAccording to [ISNULL at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/functions/isnull-transact-sql), `replacement_value` will be truncated if `replacement_value` is longer than\n`check_expression`.\n\nExample (Microsoft SQL Server):\n\n DECLARE @name1 VARCHAR(2) = NULL;\n DECLARE @name2 VARCHAR(10) = 'Example';\n DECLARE @name3 VARCHAR(2) = 'Hi';\n\n -- `@name2` is VARCHAR(10) and will be truncated\n SELECT ISNULL(@name1, @name2);\n\n -- `@name3` is VARCHAR(2) as `@name1` and will not be truncated\n SELECT ISNULL(@name1, @name3);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MssqlBuiltin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL server", - "index": 58, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTriggerTransitionInspection", - "shortDescription": { - "text": "Suspicious code in triggers" - }, - "fullDescription": { - "text": "Reports incorrect usages of transition table variables in triggers. Example (HSQLDB): 'CREATE TABLE foo(a INT);\n\nCREATE TRIGGER trg\n AFTER DELETE ON foo\nBEGIN\n SELECT * FROM NEW;\nEND;\n\nCREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)' In HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous example, NEW in 'SELECT * FROM NEW;' will be highlighted as well as OLD in 'REFERENCING OLD ROW AS newrow'.", - "markdown": "Reports incorrect usages of transition table variables in triggers.\n\nExample (HSQLDB):\n\n CREATE TABLE foo(a INT);\n\n CREATE TRIGGER trg\n AFTER DELETE ON foo\n BEGIN\n SELECT * FROM NEW;\n END;\n\n CREATE TRIGGER trig AFTER INSERT ON foo\n REFERENCING OLD ROW AS newrow\n FOR EACH ROW WHEN (a > 1)\n INSERT INTO foo VALUES (1)\n\nIn HSQLDB, DELETE triggers may be used only with the OLD state while INSERT triggers may have only the NEW state. So, in the previous\nexample, NEW in `SELECT * FROM NEW;` will be highlighted as well as OLD in `REFERENCING OLD ROW AS newrow`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlTriggerTransition", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlNamedArgumentsInspection", - "shortDescription": { - "text": "Named arguments should be used" - }, - "fullDescription": { - "text": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled. For more information about the difference between named and unnamed parameters, see Binding Parameters by Name (Named Parameters) at docs.microsoft.com . Example (Microsoft SQL Server): 'CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\nBEGIN\n RETURN n + m;\nEND;\n\nCREATE PROCEDURE test AS\nBEGIN\n foo n = 1, m = 2;\n\n--- The following call misses parameter names and will be highlighted\n foo 1, 2;\nEND;' Parameters '1, 2' in the 'foo 1, 2;' call are highlighted because they miss names.", - "markdown": "Reports arguments that are used without names in routine calls. By default, this inspection is disabled.\n\nFor more information about the difference between named and unnamed parameters, see [Binding Parameters by Name (Named Parameters) at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/binding-parameters-by-name-named-parameters).\n\nExample (Microsoft SQL Server):\n\n CREATE FUNCTION foo(n INT, m INT) RETURNS INT AS\n BEGIN\n RETURN n + m;\n END;\n\n CREATE PROCEDURE test AS\n BEGIN\n foo n = 1, m = 2;\n\n --- The following call misses parameter names and will be highlighted\n foo 1, 2;\n END;\n\nParameters `1, 2` in the `foo 1, 2;` call are highlighted because they miss names." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlNamedArguments", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMultipleLimitClausesInspection", - "shortDescription": { - "text": "Multiple row limiting/offset clauses in queries" - }, - "fullDescription": { - "text": "Reports usages of multiple row limiting clauses in a single query. Example (Microsoft SQL Server): 'create table foo(a int);\nselect top 1 * from foo order by a offset 10 rows fetch next 20 rows only;' The SELECT TOP clause is used to specify that only 1 record must be returned. The FETCH clause specifies the number of rows to return after the OFFSET clause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant.", - "markdown": "Reports usages of multiple row limiting clauses in a single query.\n\nExample (Microsoft SQL Server):\n\n create table foo(a int);\n select top 1 * from foo order by a offset 10 rows fetch next 20 rows only;\n\nThe SELECT TOP clause is used to specify that only 1 record must be\nreturned. The FETCH clause specifies the number of rows to return after the OFFSET\nclause has been processed. But as we already have the SELECT TOP limiting clause, the FETCH clause might be redundant." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMultipleLimitClauses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlCaseVsCoalesceInspection", - "shortDescription": { - "text": "Using CASE instead of COALESCE function and vice versa" - }, - "fullDescription": { - "text": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: Replace with 'COALESCE' call and the opposite one Replace with CASE expression. Example (MySQL): 'SELECT\n -- this CASE may be replaced by COALESCE\n\tCASE\n\t\tWHEN C1 IS NOT NULL THEN C1\n\t\tELSE 0\n\t\tEND\nFROM dual;' In the example, the CASE statement can be replaced with 'SELECT COALESCE(C1, 0)' that produces the same output. If you prefer using CASE expressions, select the Prefer CASE expressions over COALESCE function option on the inspection page.", - "markdown": "Reports situations when CASE and COALESCE calls are interchangeable. This inspection has the following intention actions: **Replace\nwith 'COALESCE' call** and the opposite one **Replace with CASE expression** .\n\nExample (MySQL):\n\n SELECT\n -- this CASE may be replaced by COALESCE\n \tCASE\n \t\tWHEN C1 IS NOT NULL THEN C1\n \t\tELSE 0\n \t\tEND\n FROM dual;\n\nIn the example, the CASE statement can be replaced with `SELECT COALESCE(C1, 0)` that produces the same output.\n\nIf you prefer using CASE expressions, select the **Prefer CASE expressions over COALESCE function** option on\nthe inspection page." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlCaseVsCoalesce", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantAliasInspection", - "shortDescription": { - "text": "Redundant alias expressions" - }, - "fullDescription": { - "text": "Reports alias expressions that duplicate names of columns in tables and might be redundant. Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT * FROM foo foo(a, b);\nSELECT * FROM foo foo(a);\nSELECT * FROM foo foo(x);\nSELECT * FROM foo foo(x, y);' The first two aliases use the same column names as in the 'foo' table. They are considered redundant because they column names are identical.", - "markdown": "Reports alias expressions that duplicate names of columns in tables and might be redundant.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT * FROM foo foo(a, b);\n SELECT * FROM foo foo(a);\n SELECT * FROM foo foo(x);\n SELECT * FROM foo foo(x, y);\n\nThe first two aliases use the same column names as in the `foo` table. They are considered redundant because they\ncolumn names are identical." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantAlias", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlIdentifierInspection", - "shortDescription": { - "text": "Identifier should be quoted" - }, - "fullDescription": { - "text": "Reports situations when you use SQL reserved keywords as identifier names in your query. Example (Microsoft SQL Server): 'CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);' We use 'select', 'identity', and 'order' as table and column names. But they are also reserved keywords in Microsoft SQL Server. Therefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the Quote identifier quick-fix. After the quick-fix is applied: 'CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);'", - "markdown": "Reports situations when you use SQL reserved keywords as identifier names in your query.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE select (identity INT IDENTITY NOT NULL, order INT NOT NULL);\n\nWe use `select`, `identity`, and `order` as table and column names.\nBut they are also reserved keywords in Microsoft SQL Server.\nTherefore, in order to use them as object names in the query, you must quote these identifiers. To quote them, you can use the\n**Quote identifier** quick-fix.\n\nAfter the quick-fix is applied:\n\n CREATE TABLE [select] ([identity] INT IDENTITY NOT NULL, [order] INT NOT NULL);\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlIdentifier", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlTransactionStatementInTriggerInspection", - "shortDescription": { - "text": "Use of transaction management statements in triggers" - }, - "fullDescription": { - "text": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies. With COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile. The fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As COMMIT terminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception. Changes that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger. Example (Oracle): 'CREATE TABLE employee_audit\n(\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n);\n\nCREATE TABLE employees\n(\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n);\n\nCREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\nEND;\n\nCREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\nBEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\nEND;'", - "markdown": "Reports usages of transaction management statements like COMMIT or ROLLBACK in trigger bodies.\n\nWith COMMIT or ROLLBACK statements in a trigger body, the trigger will not compile.\nThe fail happens because triggers start during transactions. When the trigger starts the current transaction is still not complete. As\nCOMMIT\nterminates a transaction, both statements (COMMIT and ROLLBACK) would lead to an exception.\nChanges that are executed in a trigger should be committed (or rolled back) by the owning transaction that started the trigger.\n\nExample (Oracle):\n\n CREATE TABLE employee_audit\n (\n id INT NOT NULL,\n update_date DATE NOT NULL,\n old_name VARCHAR2(100),\n new_name VARCHAR2(100)\n );\n\n CREATE TABLE employees\n (\n id INT NOT NULL,\n name VARCHAR2(100) NOT NULL\n );\n\n CREATE OR REPLACE TRIGGER trig_commit\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n COMMIT;\n END;\n\n CREATE OR REPLACE TRIGGER trig_rollback\n AFTER UPDATE OF name\n ON employees\n FOR EACH ROW\n BEGIN\n INSERT INTO employee_audit VALUES (:old.id, SYSDATE, :old.name, :new.name);\n ROLLBACK;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlTransactionStatementInTrigger", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantCodeInCoalesceInspection", - "shortDescription": { - "text": "Redundant code in COALESCE call" - }, - "fullDescription": { - "text": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions. Example (MySQL): 'SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;' The first NOT NULL argument is '42', all other arguments will be grayed out.", - "markdown": "Reports all the arguments except for the first expression that does not evaluate to NULL in COALESCE functions.\n\nExample (MySQL):\n\n SELECT COALESCE(NULL, NULL, NULL, 42, NULL, 'string') as a;\n\nThe first NOT NULL argument is `42`, all other arguments will be grayed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantCodeInCoalesce", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlStorageInspection", - "shortDescription": { - "text": "SQL source modification detection" - }, - "fullDescription": { - "text": "Reports situations when source code of a database object has been changed. The inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an object, run statements, and perform code refactoring. Also, you can run introspection by right-clicking an object and selecting Refresh. The inspection covers the following situations: Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE. You changed the object source code, introspected the database, but source code has been already changed by someone else. The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version.", - "markdown": "Reports situations when source code of a database object has been changed.\n\nThe inspection is triggered when you perform database or object introspection. The introspection is run when you open source code of an\nobject, run statements, and perform code refactoring.\nAlso, you can run introspection by right-clicking an object and selecting **Refresh**.\n\nThe inspection covers the following situations:\n\n* Object source code was changed in the database but code in the editor was not updated. Works in PostgreSQL, Microsoft SQL Server, Oracle, and Sybase ASE.\n* You changed the object source code, introspected the database, but source code has been already changed by someone else.\n* The database introspector was updated in the IDE and you need to download new object properties that were missing in the previous introspector version." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlStorageInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MsOrderByInspection", - "shortDescription": { - "text": "ORDER BY in queries" - }, - "fullDescription": { - "text": "Reports usages when the 'ORDER BY' clause is used without 'TOP', 'OFFSET', or 'FOR XML' in views, inline functions, derived tables, subqueries, and common table expressions. For more information about usages of 'ORDER BY', see SELECT - ORDER BY Clause (Transact-SQL) at docs.microsoft.com. Example (Microsoft SQL server): 'CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\nSELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89\nORDER BY b) ALIAS;' In a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery. Alternatively, use the Delete element quick-fix to delete the ORDER BY section. After the quick-fix is applied: 'SELECT *\nFROM (SELECT a, b\nFROM foo A\nWHERE a < 89) ALIAS;'", - "markdown": "Reports usages when the `ORDER BY` clause is used without `TOP`, `OFFSET`, or `FOR XML` in views, inline functions, derived tables, subqueries, and common table expressions.\n\nFor more information about usages of `ORDER BY`, see [SELECT - ORDER BY Clause (Transact-SQL) at\ndocs.microsoft.com](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql).\n\nExample (Microsoft SQL server):\n\n CREATE TABLE foo (a INT NOT NULL, b INT NOT NULL);\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89\n ORDER BY b) ALIAS;\n\nIn a subquery, ORDER BY will be highlighted as an error. You can add TOP, OFFSET, or FOR XML to a subquery.\nAlternatively, use the **Delete element** quick-fix to delete the ORDER BY section.\n\nAfter the quick-fix is applied:\n\n SELECT *\n FROM (SELECT a, b\n FROM foo A\n WHERE a < 89) ALIAS;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "MsOrderBy", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL server", - "index": 58, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlSignatureInspection", - "shortDescription": { - "text": "Function signature" - }, - "fullDescription": { - "text": "Reports signature issues for built-in functions. The inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues. Example (MySQL): 'CREATE TABLE foo (a INT, b INT, c INT)\n\nSELECT IFNULL() FROM foo; -- error\nSELECT IFNULL(a) FROM foo; -- error\nSELECT IFNULL(a, b) FROM foo; -- OK\nSELECT IFNULL(a, b, c) FROM foo; -- error' In MySQL, the 'IFNULL()' function accepts strictly two arguments. So, only the 'SELECT IFNULL(a, b) FROM foo;' query is correct.", - "markdown": "Reports signature issues for built-in functions.\n\nThe inspection will report a wrong number of arguments, invalid keywords, wrong data types, and other issues.\n\nExample (MySQL):\n\n CREATE TABLE foo (a INT, b INT, c INT)\n\n SELECT IFNULL() FROM foo; -- error\n SELECT IFNULL(a) FROM foo; -- error\n SELECT IFNULL(a, b) FROM foo; -- OK\n SELECT IFNULL(a, b, c) FROM foo; -- error\n\nIn MySQL, the `IFNULL()` function accepts strictly two arguments. So, only the `SELECT IFNULL(a, b) FROM foo;`\nquery is correct." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlSignature", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlRedundantOrderingDirectionInspection", - "shortDescription": { - "text": "Redundant ordering direction" - }, - "fullDescription": { - "text": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses. Example (MySQL): 'CREATE TABLE foo(a INT, b INT, c INT);\nSELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;' The ORDER BY keyword sorts the records in the ascending order by default. So, the 'ASC' keyword for 'a' and 'c' columns is redundant.", - "markdown": "Reports redundant ordering directions like ASC and DESC in ORDER BY clauses.\n\nExample (MySQL):\n\n CREATE TABLE foo(a INT, b INT, c INT);\n SELECT * FROM foo ORDER BY a ASC, b DESC, c ASC;\n\nThe ORDER BY keyword sorts the records in the ascending order by default. So, the `ASC` keyword for `a` and\n`c` columns is redundant." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlRedundantOrderingDirection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlDeprecateTypeInspection", - "shortDescription": { - "text": "Deprecated type" - }, - "fullDescription": { - "text": "Reports usages of types that are deprecated and might disappear in future versions of DBMS. Reported types: LONG in Oracle (see Deprecated and Desupported Features at docs.oracle.com). TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com). Example (Oracle): 'CREATE TABLE ot.foo(\na NUMBER GENERATED BY DEFAULT AS IDENTITY,\nb LONG NOT NULL\n);'", - "markdown": "Reports usages of types that are deprecated and might disappear in future versions of DBMS.\n\nReported types:\n\n* LONG in Oracle (see [Deprecated\n and Desupported Features at docs.oracle.com](https://docs.oracle.com/cd/A91202_01/901_doc/server.901/a90120/ch4_dep.htm#6690)).\n* TEXT, NTEXT, and IMAGE in Microsoft SQL Server (see [Deprecated Database Engine Features in SQL Server 2016 at docs.microsoft.com](https://docs.microsoft.com/en-us/sql/database-engine/deprecated-database-engine-features-in-sql-server-2016?view=sql-server-ver15)).\n\nExample (Oracle):\n\n CREATE TABLE ot.foo(\n a NUMBER GENERATED BY DEFAULT AS IDENTITY,\n b LONG NOT NULL\n );\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlDeprecateType", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAggregatesInspection", - "shortDescription": { - "text": "Aggregate-related problems" - }, - "fullDescription": { - "text": "Reports invalid usages of SQL aggregate functions. The following situations are considered: Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses. 'CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\nSELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\nSELECT * FROM foo GROUP BY a ORDER BY b;' This rule does not apply when grouping is made by the primary key. 'SELECT * FROM foo GROUP BY id ORDER BY b;' Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error. 'SELECT a FROM foo WHERE MAX(b) > 0;\nSELECT a FROM foo GROUP BY MAX(a);' Nested calls of aggregate functions. 'SELECT MAX(SUM(a)) FROM foo GROUP BY a;' This rule does not apply to analytic functions. The following query is valid and correct. 'SELECT MAX(SUM(a) OVER ()) FROM foo;' Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section. 'SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;'", - "markdown": "Reports invalid usages of SQL aggregate functions.\n\nThe following situations are considered:\n\n* Columns that are used in HAVING and ORDER BY clauses but are missed in GROUP BY clauses.\n\n CREATE TABLE foo(id INT PRIMARY KEY, a INT, b INT);\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING b > 0;\n SELECT * FROM foo GROUP BY a ORDER BY b;\n\n This rule does not apply when grouping is made by the primary key.\n\n SELECT * FROM foo GROUP BY id ORDER BY b;\n\n* Aggregate functions in a wrong context. Usually, you can use aggregate functions in the following contexts: a list of expressions in\n SELECT; in HAVING and ORDER BY sections; and other dialect-specific cases. The following queries will display an error.\n\n SELECT a FROM foo WHERE MAX(b) > 0;\n SELECT a FROM foo GROUP BY MAX(a);\n\n* Nested calls of aggregate functions.\n\n SELECT MAX(SUM(a)) FROM foo GROUP BY a;\n\n This rule does not apply to analytic functions. The following query is valid and correct.\n\n SELECT MAX(SUM(a) OVER ()) FROM foo;\n\n* Usages of HAVING without aggregate functions. In this case, consider rewriting your code using the WHERE section.\n\n SELECT a, MAX(b) FROM foo GROUP BY a HAVING a > 0;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAggregates", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlConstantExpressionInspection", - "shortDescription": { - "text": "Constant expression" - }, - "fullDescription": { - "text": "Reports conditions and expressions that are always true, false or null. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nSELECT a FROM t1 WHERE 'Cat' = 'Cat';\nSELECT a FROM t1 WHERE 'Cat' = null;' The ''Cat' = 'Cat'' is always true and will be reported. The ''Cat' = null' is always null and will be reported.", - "markdown": "Reports conditions and expressions that are always true, false or null.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n SELECT a FROM t1 WHERE 'Cat' = 'Cat';\n SELECT a FROM t1 WHERE 'Cat' = null;\n\nThe `'Cat' = 'Cat'` is always true and will be reported.\n\nThe `'Cat' = null` is always null and will be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlConstantExpression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlMissingColumnAliasesInspection", - "shortDescription": { - "text": "Missing column aliases" - }, - "fullDescription": { - "text": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement). Example (PostgreSQL): 'CREATE TABLE foo(a INT, b INT);\n\nSELECT 1, a + 1 AS A2, MAX(b) AS M\nFROM foo;'", - "markdown": "Reports queries without explicit aliases in output expressions (for example, in the SELECT statement).\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT, b INT);\n\n SELECT 1, a + 1 AS A2, MAX(b) AS M\n FROM foo;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMissingColumnAliases", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAddNotNullColumnInspection", - "shortDescription": { - "text": "Adding not null column without default value" - }, - "fullDescription": { - "text": "Reports attempts to create NOT NULL columns without DEFAULT values. Example (Microsoft SQL Server): 'CREATE TABLE foo (a INT, b INT)\n\nALTER TABLE foo ADD c INT NOT NULL;' By default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values. If we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record. 'ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;' You can quickly add the DEFAULT value by using the Add DEFAULT value quick-fix.", - "markdown": "Reports attempts to create NOT NULL columns without DEFAULT values.\n\nExample (Microsoft SQL Server):\n\n CREATE TABLE foo (a INT, b INT)\n\n ALTER TABLE foo ADD c INT NOT NULL;\n\nBy default, a column holds NULL values. In the example, we use the NOT NULL constraint that enforces a column not to accept NULL values.\nIf we prohibit to use NULL values, we must set the DEFAULT value that SQL can use when we create a new record.\n\n ALTER TABLE foo ADD c INT NOT NULL DEFAULT 42;\n\nYou can quickly add the DEFAULT value by using the **Add DEFAULT value** quick-fix." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAddNotNullColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraOverloadInspection", - "shortDescription": { - "text": "Overloading errors" - }, - "fullDescription": { - "text": "Reports invalid cases of subprogram overloading in Oracle. Example (Oracle): 'DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\nBEGIN\n NULL;\nEND;' You cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a BINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading, see Restrictions on Overloading at docs.oracle.com.", - "markdown": "Reports invalid cases of subprogram overloading in Oracle.\n\nExample (Oracle):\n\n DECLARE\n SUBTYPE fff IS BINARY_INTEGER;\n SUBTYPE ggg IS NATURAL;\n PROCEDURE foo (a IN ggg) IS BEGIN NULL; END;\n PROCEDURE foo (a IN fff) IS BEGIN NULL; END;\n BEGIN\n NULL;\n END;\n\nYou cannot overload subprograms which parameters differ only in subtypes. For example, you cannot overload procedures where one accepts a\nBINARY INTEGER parameter and the other accepts a NATURAL parameter. For more information about restrictions on procedure overloading,\nsee [Restrictions on Overloading at docs.oracle.com](https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/subprograms.htm)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlOverload", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraMissingBodyInspection", - "shortDescription": { - "text": "Missing body for package/object type specification" - }, - "fullDescription": { - "text": "Reports package and object type specifications that are missing body declarations. Package specifications and object types that declare routines as well as package specifications with cursors must have body declarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are invoked in program code. Example (Oracle): 'CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\nEND;'", - "markdown": "Reports package and object type specifications that are missing body declarations.\n\nPackage specifications and object types that declare routines as well as package specifications with cursors must have body\ndeclarations where those routines and cursors are implemented. Absence of a body leads to a runtime error when routines or cursors are\ninvoked in program code.\n\nExample (Oracle):\n\n CREATE OR REPLACE PACKAGE ppp IS\n FUNCTION foo(a INT) RETURN INT;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlMissingBody", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "OraUnmatchedForwardDeclarationInspection", - "shortDescription": { - "text": "Forward declaration without definition" - }, - "fullDescription": { - "text": "Reports declarations of procedures and functions that are missing their implementation in code. In Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names of such procedures or functions that are left without implementation. Example (Oracle): 'DECLARE PROCEDURE foo(a int, b varchar2);\nBEGIN\n NULL;\nEND;' The 'foo' procedure is declared but is missing implementation. We can add the implementation to get rid of the error. 'DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\nBEGIN\n NULL;\nEND;\nBEGIN\n NULL;\nEND;'", - "markdown": "Reports declarations of procedures and functions that are missing their implementation in code.\n\nIn Oracle, you can declare a procedure or a function without its body, and write the implementation later. The inspection will report names\nof such procedures or functions that are left without implementation.\n\nExample (Oracle):\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n BEGIN\n NULL;\n END;\n\nThe `foo` procedure is declared but is missing implementation. We can add the implementation to get rid of the error.\n\n DECLARE PROCEDURE foo(a int, b varchar2);\n PROCEDURE foo(a int, b varchar2) IS\n BEGIN\n NULL;\n END;\n BEGIN\n NULL;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "SqlUnmatchedForwardDeclaration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Oracle", - "index": 63, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSExtResolveInspection", - "shortDescription": { - "text": "Resolution problems" - }, - "fullDescription": { - "text": "Reports unresolved references in MongoDB and JavaScript code.", - "markdown": "Reports unresolved references in MongoDB and JavaScript code." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSResolve", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlGotoInspection", - "shortDescription": { - "text": "Usages of GOTO statements" - }, - "fullDescription": { - "text": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop. The extensive use of GOTO statements is generally not recommended. For details, see GOTO statement in SQL procedures at ibm.com. Instead of jumping back to a previous statement using GOTO, consider using a loop. Instead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK). Example (Oracle): 'CREATE PROCEDURE test(n INT) AS\nDECLARE\n x INT;\nBEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\nEND;'", - "markdown": "Reports usages of backward GOTO statements and GOTO statements used to exit a loop.\n\nThe extensive use of GOTO statements is generally\nnot recommended. For details, see [GOTO statement in\nSQL\nprocedures at ibm.com](https://www.ibm.com/docs/no/db2/11.5?topic=procedures-goto-statement-in-sql).\n\nInstead of jumping back to a previous statement using GOTO, consider using a loop.\n\nInstead of exiting the WHILE loop with GOTO, consider using other control-of-flow statements (for example, RETURN or BREAK).\n\nExample (Oracle):\n\n CREATE PROCEDURE test(n INT) AS\n DECLARE\n x INT;\n BEGIN\n x := 0;\n GOTO a;\n <> x := 1;\n IF (n = 0) THEN\n GOTO a;\n END IF;\n WHILE TRUE\n LOOP\n GOTO b;\n END LOOP;\n <> x := 3;\n END;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlGoto", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlWithoutWhereInspection", - "shortDescription": { - "text": "Delete or update statement without where clauses" - }, - "fullDescription": { - "text": "Reports usages of DELETE or UPDATE statements without WHERE clauses. Without WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows. Example (MySQL): 'CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\nupdate t1 set a = 'Smith';\ndelete from t1;'", - "markdown": "Reports usages of DELETE or UPDATE statements without WHERE clauses.\n\nWithout WHERE clauses, DELETE drops all the data from the table, and UPDATE overwrites values for all the table rows.\n\nExample (MySQL):\n\n CREATE TABLE t1 (a TEXT, b INT, c BOOLEAN);\n update t1 set a = 'Smith';\n delete from t1;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlWithoutWhere", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Security" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlAmbiguousColumnInspection", - "shortDescription": { - "text": "Ambiguous reference" - }, - "fullDescription": { - "text": "Reports columns that have identical names but belong to different tables. Example (MySQL): 'CREATE TABLE foo(id INT PRIMARY KEY);\nCREATE TABLE bar(id INT PRIMARY KEY);\n\nSELECT foo.id, bar.id FROM foo, bar WHERE id > 0;' The 'id' column appears in 'foo' and 'bar' tables. You need to qualify the column name to make the query correct. 'SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;'", - "markdown": "Reports columns that have identical names but belong to different tables.\n\nExample (MySQL):\n\n CREATE TABLE foo(id INT PRIMARY KEY);\n CREATE TABLE bar(id INT PRIMARY KEY);\n\n SELECT foo.id, bar.id FROM foo, bar WHERE id > 0;\n\nThe `id` column appears in `foo` and `bar` tables. You need to qualify the column name to\nmake the query correct.\n\n SELECT foo.id, bar.id FROM foo, bar WHERE foo.id > 0;\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlAmbiguousColumn", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SqlUnusedCteInspection", - "shortDescription": { - "text": "Unused common table expression" - }, - "fullDescription": { - "text": "Reports unused common table expressions (CTE) inside the query. Example (PostgreSQL): 'CREATE TABLE foo(a INT);\n\nWITH a AS (SELECT 1 AS x FROM foo)\nSELECT 1 + 2 FROM foo;' By using WITH, we create a temporary named result set with the name 'a', also known as a common table expression (CTE). But we do not use this CTE later in the code. The unused CTE is greyed out.", - "markdown": "Reports unused common table expressions (CTE) inside the query.\n\nExample (PostgreSQL):\n\n CREATE TABLE foo(a INT);\n\n WITH a AS (SELECT 1 AS x FROM foo)\n SELECT 1 + 2 FROM foo;\n\nBy using WITH, we create a temporary named result set with the name `a`, also known as a common table expression (CTE). But\nwe do not use this CTE later in the code. The unused CTE is greyed out." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SqlUnusedCte", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "SQL", - "index": 29, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MongoJSResolveInspection", - "shortDescription": { - "text": "Resolution problems" - }, - "fullDescription": { - "text": "Reports unresolved references in MongoDB and JavaScript code. Example: 'db\nuse foo\n -- a reference to a non-existing collection\ndb.non_existing_collection\ndb['non_existing_collection']\ndb['non_existing_collection'].find().hasNext()' The 'non_existing_collection' collection does not exist in the database and will be reported.", - "markdown": "Reports unresolved references in MongoDB and JavaScript code.\n\nExample:\n\n db\n use foo\n -- a reference to a non-existing collection\n db.non_existing_collection\n db['non_existing_collection']\n db['non_existing_collection'].find().hasNext()\n\nThe `non_existing_collection` collection does not exist in the database and will be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "MongoJSResolve", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "MongoJS", - "index": 10, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.properties", - "version": "251.25776", - "rules": [ - { - "id": "DuplicatePropertyInspection", - "shortDescription": { - "text": "Duplicate property" - }, - "fullDescription": { - "text": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values. Example: 'property1=value;\nproperty2=value;' The Options list allows selecting the area in which the inspection should search for duplicates.", - "markdown": "Reports duplicate property keys with different values, duplicate keys, or duplicate property values.\n\nExample:\n\n\n property1=value;\n property2=value;\n\nThe **Options** list allows selecting the area in which the inspection should search for duplicates." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "DuplicatePropertyInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UseEllipsisInPropertyInspection", - "shortDescription": { - "text": "Three dot characters instead of the ellipsis" - }, - "fullDescription": { - "text": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files.", - "markdown": "Reports three \"dot\" characters which are used instead of the ellipsis character for UTF-8 properties files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UseEllipsisInPropertyInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "AlphaUnsortedPropertiesFile", - "shortDescription": { - "text": "Properties file or resource bundle is alphabetically unsorted" - }, - "fullDescription": { - "text": "Reports alphabetically unsorted resource bundles or .properties files.", - "markdown": "Reports alphabetically unsorted resource bundles or .properties files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "AlphaUnsortedPropertiesFile", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TrailingSpacesInProperty", - "shortDescription": { - "text": "Trailing spaces in property" - }, - "fullDescription": { - "text": "Reports properties whose keys or values end with a whitespace.", - "markdown": "Reports properties whose keys or values end with a whitespace." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TrailingSpacesInProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedProperty", - "shortDescription": { - "text": "Unused property" - }, - "fullDescription": { - "text": "Reports properties that are not referenced outside of the .properties file they are contained in.", - "markdown": "Reports properties that are not referenced outside of the .properties file they are contained in." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "WrongPropertyKeyValueDelimiter", - "shortDescription": { - "text": "Property key/value delimiter doesn't match code style settings" - }, - "fullDescription": { - "text": "Reports properties in which key or value delimiters do not match code style settings.", - "markdown": "Reports properties in which key or value delimiters do not match code style settings." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "WrongPropertyKeyValueDelimiter", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Properties files", - "index": 14, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij", - "version": "251.25776", - "rules": [ - { - "id": "HtmlUnknownBooleanAttribute", - "shortDescription": { - "text": "Incorrect boolean attribute" - }, - "fullDescription": { - "text": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported.", - "markdown": "Reports an HTML non-boolean attribute without a value. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownBooleanAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "DuplicatedCode", - "shortDescription": { - "text": "Duplicated code fragment" - }, - "fullDescription": { - "text": "Reports duplicated blocks of code from the selected scope: the same file or the entire project. The inspection features quick-fixes that help you to set the size of detected duplicates, navigate to repetitive code fragments, and compare them in a tool window. The inspection options allow you to select the scope of the reported duplicated fragments and set the initial size for the duplicated language constructs.", - "markdown": "Reports duplicated blocks of code from the selected scope: the same file or the entire project.\n\nThe inspection features quick-fixes that help you to set the size of detected duplicates, navigate to repetitive code fragments, and compare them in a tool window.\n\nThe inspection options allow you to select the scope of the reported duplicated fragments and set the initial size for the duplicated language constructs." - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "DuplicatedCode", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "InconsistentLineSeparators", - "shortDescription": { - "text": "Inconsistent line separators" - }, - "fullDescription": { - "text": "Reports files with line separators different from the ones that are specified in the project's settings. For example, the inspection will be triggered if you set the line separator to '\\n' in Settings | Editor | Code Style | Line separator, while the file you are editing uses '\\r\\n' as a line separator. The inspection also warns you about mixed line separators within a file.", - "markdown": "Reports files with line separators different from the ones that are specified in the project's settings.\n\nFor example, the inspection will be triggered if you set the line separator to `\\n` in\n[Settings \\| Editor \\| Code Style \\| Line separator](settings://preferences.sourceCode?Line%20separator),\nwhile the file you are editing uses `\\r\\n` as a line separator.\n\nThe inspection also warns you about mixed line separators within a file." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "InconsistentLineSeparators", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RedundantSuppression", - "shortDescription": { - "text": "Redundant suppression" - }, - "fullDescription": { - "text": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context: '@SuppressWarning' annotation, or '// noinspection' line comment, or '/** noinspection */' JavaDoc comment Example: 'public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n}'", - "markdown": "Reports usages of the following elements that can be safely removed because the inspection they affect is no longer applicable in this context:\n\n* `@SuppressWarning` annotation, or\n* `// noinspection` line comment, or\n* `/** noinspection */` JavaDoc comment\n\nExample:\n\n\n public class C {\n // symbol is already private,\n // but annotation is still around\n @SuppressWarnings({\"WeakerAccess\"})\n private boolean CONST = true;\n void f() {\n CONST = false;\n }\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RedundantSuppression", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ProblematicWhitespace", - "shortDescription": { - "text": "Problematic whitespace" - }, - "fullDescription": { - "text": "Reports the following problems: Tabs used for indentation when the code style is configured to use only spaces. Spaces used for indentation when the code style is configured to use only tabs. Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs.", - "markdown": "Reports the following problems:\n\n* Tabs used for indentation when the code style is configured to use only spaces.\n* Spaces used for indentation when the code style is configured to use only tabs.\n* Spaces used for indentation and tabs used for alignment when the code style is configured to use smart tabs." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ProblematicWhitespace", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownTarget", - "shortDescription": { - "text": "Unresolved file in a link" - }, - "fullDescription": { - "text": "Reports an unresolved file in a link.", - "markdown": "Reports an unresolved file in a link." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownTarget", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SSBasedInspection", - "shortDescription": { - "text": "Structural search inspection" - }, - "fullDescription": { - "text": "Allows configuring Structural Search/Structural Replace templates that you can apply to the file you are editing. All matches will be highlighted and marked with the template name that you have configured. If you configure the Structural Replace pattern as well, the corresponding replace option will be available as a quick-fix.", - "markdown": "Allows configuring **Structural Search/Structural Replace** templates that you can apply to the file you are editing.\n\nAll matches will be highlighted and marked with the template name that you have configured.\nIf you configure the **Structural Replace** pattern as well, the corresponding replace option will be available as a quick-fix." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "SSBasedInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Structural search", - "index": 34, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LongLine", - "shortDescription": { - "text": "Line is longer than allowed by code style" - }, - "fullDescription": { - "text": "Reports lines that are longer than the Hard wrap at parameter specified in Settings | Editor | Code Style | General.", - "markdown": "Reports lines that are longer than the **Hard wrap at** parameter specified in [Settings \\| Editor \\| Code Style \\| General](settings://preferences.sourceCode?Hard%20wrap%20at)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LongLine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlWrongRootElement", - "shortDescription": { - "text": "Wrong root element" - }, - "fullDescription": { - "text": "Reports a root tag name different from the name specified in the '' tag.", - "markdown": "Reports a root tag name different from the name specified in the `` tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlWrongRootElement", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckValidXmlInScriptTagBody", - "shortDescription": { - "text": "Malformed content of 'script' tag" - }, - "fullDescription": { - "text": "Reports contents of 'script' tags that are invalid XML. Example: '' After the quick-fix is applied: ''", - "markdown": "Reports contents of `script` tags that are invalid XML. \n\n**Example:**\n\n\n \n\nAfter the quick-fix is applied:\n\n\n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckValidXmlInScriptTagBody", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSuspiciousBackref", - "shortDescription": { - "text": "Suspicious back reference" - }, - "fullDescription": { - "text": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation. Example of a group defined after its back reference: '\\1(abc)' Example of a group and a back reference in different branches: 'a(b)c|(xy)\\1z' New in 2022.1", - "markdown": "Reports back references that will not be resolvable at runtime. This means that the back reference can never match anything. A back reference will not be resolvable when the group is defined after the back reference, or if the group is defined in a different branch of an alternation.\n\n**Example of a group defined after its back reference:**\n\n\n \\1(abc)\n\n**Example of a group and a back reference in different branches:**\n\n\n a(b)c|(xy)\\1z\n\nNew in 2022.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpSuspiciousBackref", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSingleCharAlternation", - "shortDescription": { - "text": "Single character alternation" - }, - "fullDescription": { - "text": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance. Example: 'a|b|c|d' After the quick-fix is applied: '[abcd]' New in 2017.1", - "markdown": "Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance.\n\n**Example:**\n\n\n a|b|c|d\n\nAfter the quick-fix is applied:\n\n\n [abcd]\n\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpSingleCharAlternation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownAttribute", - "shortDescription": { - "text": "Unknown attribute" - }, - "fullDescription": { - "text": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported.", - "markdown": "Reports an unknown HTML attribute. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckTagEmptyBody", - "shortDescription": { - "text": "Empty element content" - }, - "fullDescription": { - "text": "Reports XML elements without contents. Example: '\n \n ' After the quick-fix is applied: '\n \n '", - "markdown": "Reports XML elements without contents.\n\n**Example:**\n\n\n \n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckTagEmptyBody", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantEscape", - "shortDescription": { - "text": "Redundant character escape" - }, - "fullDescription": { - "text": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets '[]' of a character class. Although unescaped opening curly braces '{' outside of character classes are allowed in some dialects (JavaScript, Python, and so on), it can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters. For this reason the inspection does not report escaped opening curly braces. Example: '\\-\\;[\\.]' After the quick-fix is applied: '-;[.]' The Ignore escaped closing brackets '}' and ']' option specifies whether to report '\\}' and '\\]' outside of a character class when they are allowed to be unescaped by the RegExp dialect. New in 2017.3", - "markdown": "Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning. Many escape sequences that are necessary outside of a character class are redundant inside square brackets `[]` of a character class.\n\n\nAlthough unescaped opening curly braces `{` outside of character classes are allowed in some dialects (JavaScript, Python, and so on),\nit can cause confusion and make the pattern less portable, because there are dialects that require escaping curly braces as characters.\nFor this reason the inspection does not report escaped opening curly braces.\n\n**Example:**\n\n\n \\-\\;[\\.]\n\nAfter the quick-fix is applied:\n\n\n -;[.]\n\n\nThe **Ignore escaped closing brackets '}' and '\\]'** option specifies whether to report `\\}` and `\\]` outside of a character class\nwhen they are allowed to be unescaped by the RegExp dialect.\n\nNew in 2017.3" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRedundantEscape", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnresolvedReference", - "shortDescription": { - "text": "Unresolved reference" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a named pattern ('define') in RELAX-NG files that use XML syntax. Suggests creating the referenced 'define' element.", - "markdown": "Reports an unresolved reference to a named pattern (`define`) in RELAX-NG files that use XML syntax. Suggests creating the referenced `define` element." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "UnresolvedReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RELAX NG", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlMissingClosingTag", - "shortDescription": { - "text": "Missing closing tag" - }, - "fullDescription": { - "text": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional. Example: '\n \n

Behold!\n \n ' After the quick-fix is applied: '\n \n

Behold!

\n \n '", - "markdown": "Reports an HTML element without a closing tag. Some coding styles require that HTML elements have closing tags even where this is optional.\n\n**Example:**\n\n\n \n \n

Behold!\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n

Behold!

\n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlMissingClosingTag", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CustomRegExpInspection", - "shortDescription": { - "text": "Custom RegExp inspection" - }, - "fullDescription": { - "text": "Custom Regex Inspection", - "markdown": "Custom Regex Inspection" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CustomRegExpInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IncorrectFormatting", - "shortDescription": { - "text": "Incorrect formatting" - }, - "fullDescription": { - "text": "Reports formatting issues that appear if your code doesn't follow your project's code style settings. This inspection is not compatible with languages that require third-party formatters for code formatting, for example, Go or C with CLangFormat enabled.", - "markdown": "Reports formatting issues that appear if your code doesn't\nfollow your project's code style settings.\n\n\nThis inspection is not compatible with languages that require\nthird-party formatters for code formatting, for example, Go or\nC with CLangFormat enabled." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "IncorrectFormatting", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlExtraClosingTag", - "shortDescription": { - "text": "Redundant closing tag" - }, - "fullDescription": { - "text": "Reports redundant closing tags on empty elements, for example, 'img' or 'br'. Example: '\n \n

\n \n ' After the quick-fix is applied: '\n \n
\n \n '", - "markdown": "Reports redundant closing tags on empty elements, for example, `img` or `br`.\n\n**Example:**\n\n\n \n \n

\n \n \n\nAfter the quick-fix is applied:\n\n\n \n \n
\n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlExtraClosingTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownAnchorTarget", - "shortDescription": { - "text": "Unresolved fragment in a link" - }, - "fullDescription": { - "text": "Reports an unresolved last part of an URL after the '#' sign.", - "markdown": "Reports an unresolved last part of an URL after the `#` sign." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownAnchorTarget", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpUnexpectedAnchor", - "shortDescription": { - "text": "Begin or end anchor in unexpected position" - }, - "fullDescription": { - "text": "Reports '^' or '\\A' anchors not at the beginning of the pattern and '$', '\\Z' or '\\z' anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the '^' and '$' anchors, most likely the literal character was meant and the escape forgotten. Example: '(Price $10)' New in 2018.1", - "markdown": "Reports `^` or `\\A` anchors not at the beginning of the pattern and `$`, `\\Z` or `\\z` anchors not at the end of the pattern. In the wrong position these RegExp anchors prevent the pattern from matching anything. In case of the `^` and `$` anchors, most likely the literal character was meant and the escape forgotten.\n\n**Example:**\n\n\n (Price $10)\n\n\nNew in 2018.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpUnexpectedAnchor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "SpellCheckingInspection", - "shortDescription": { - "text": "Typo" - }, - "fullDescription": { - "text": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click.", - "markdown": "Reports typos and misspellings in your code, comments, and literals and fixes them with one click." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "SpellCheckingInspection", - "ideaSeverity": "TYPO", - "qodanaSeverity": "Low", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckXmlFileWithXercesValidator", - "shortDescription": { - "text": "Failed external validation" - }, - "fullDescription": { - "text": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator.", - "markdown": "Reports a discrepancy in an XML file with the specified DTD or schema detected by the Xerces validator." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckXmlFileWithXercesValidator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlUnknownTag", - "shortDescription": { - "text": "Unknown tag" - }, - "fullDescription": { - "text": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported.", - "markdown": "Reports an unknown HTML tag. Suggests configuring tags that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlUnknownTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpEscapedMetaCharacter", - "shortDescription": { - "text": "Escaped meta character" - }, - "fullDescription": { - "text": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character '[', ']' and '^', because those would need additional escaping inside a character class. Example: '\\d+\\.\\d+' After the quick-fix is applied: '\\d+[.]\\d+' New in 2017.1", - "markdown": "Reports escaped meta characters. Some RegExp coding styles specify that meta characters should be placed inside a character class, to make the regular expression easier to understand. This inspection does not warn about the meta character `[`, `]` and `^`, because those would need additional escaping inside a character class.\n\n**Example:**\n\n\n \\d+\\.\\d+\n\nAfter the quick-fix is applied:\n\n\n \\d+[.]\\d+\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "RegExpEscapedMetaCharacter", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlHighlighting", - "shortDescription": { - "text": "XML highlighting" - }, - "fullDescription": { - "text": "Reports XML validation problems in the results of a batch code inspection.", - "markdown": "Reports XML validation problems in the results of a batch code inspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlHighlighting", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDuplicatedId", - "shortDescription": { - "text": "Duplicate 'id' attribute" - }, - "fullDescription": { - "text": "Reports a duplicate values of the 'id' attribute in XML and HTML.", - "markdown": "Reports a duplicate values of the `id` attribute in XML and HTML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlDuplicatedId", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpDuplicateCharacterInClass", - "shortDescription": { - "text": "Duplicate character in character class" - }, - "fullDescription": { - "text": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex. Example: '[aabc]' After the quick-fix is applied: '[abc]'", - "markdown": "Reports duplicate characters inside a RegExp character class. Duplicate characters are unnecessary and can be removed without changing the semantics of the regex.\n\n**Example:**\n\n\n [aabc]\n\nAfter the quick-fix is applied:\n\n\n [abc]\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpDuplicateCharacterInClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlInvalidId", - "shortDescription": { - "text": "Unresolved 'id' reference" - }, - "fullDescription": { - "text": "Reports the use of the 'id' that is not defined anywhere in XML and HTML.", - "markdown": "Reports the use of the `id` that is not defined anywhere in XML and HTML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlInvalidId", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlUnboundNsPrefix", - "shortDescription": { - "text": "Unbound namespace prefix" - }, - "fullDescription": { - "text": "Reports an unbound namespace prefix in XML.", - "markdown": "Reports an unbound namespace prefix in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlUnboundNsPrefix", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RequiredAttributes", - "shortDescription": { - "text": "Missing required attribute" - }, - "fullDescription": { - "text": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported.", - "markdown": "Reports a missing mandatory attribute in an XML/HTML tag. Suggests configuring attributes that should not be reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RequiredAttributes", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "ReassignedToPlainText", - "shortDescription": { - "text": "Reassigned to plain text" - }, - "fullDescription": { - "text": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically. You can dismiss this warning by removing the file type association in Settings | Editor | File Types | Text.", - "markdown": "Reports files that were explicitly re-assigned to Plain Text File Type. This association is unnecessary because the platform auto-detects text files by content automatically.\n\nYou can dismiss this warning by removing the file type association\nin **Settings \\| Editor \\| File Types \\| Text**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "ReassignedToPlainText", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlUnusedNamespaceDeclaration", - "shortDescription": { - "text": "Unused schema declaration" - }, - "fullDescription": { - "text": "Reports an unused namespace declaration or location hint in XML.", - "markdown": "Reports an unused namespace declaration or location hint in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlUnusedNamespaceDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantClassElement", - "shortDescription": { - "text": "Redundant '\\d', '[:digit:]', or '\\D' class elements" - }, - "fullDescription": { - "text": "Reports redundant '\\d' or '[:digit:]' that are used in one class with '\\w' or '[:word:]' ('\\D' with '\\W') and can be removed. Example: '[\\w\\d]' After the quick-fix is applied: '[\\w]' New in 2022.2", - "markdown": "Reports redundant `\\d` or `[:digit:]` that are used in one class with `\\w` or `[:word:]` (`\\D` with `\\W`) and can be removed.\n\n**Example:**\n\n\n [\\w\\d]\n\nAfter the quick-fix is applied:\n\n\n [\\w]\n\nNew in 2022.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "RegExpRedundantClassElement", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpSimplifiable", - "shortDescription": { - "text": "Regular expression can be simplified" - }, - "fullDescription": { - "text": "Reports regular expressions that can be simplified. Example: '[a] xx* [ah-hz]' After the quick-fix is applied: 'a x+ [ahz]' New in 2022.1", - "markdown": "Reports regular expressions that can be simplified.\n\n**Example:**\n\n\n [a] xx* [ah-hz]\n\nAfter the quick-fix is applied:\n\n\n a x+ [ahz]\n\nNew in 2022.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "note", - "parameters": { - "suppressToolId": "RegExpSimplifiable", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpEmptyAlternationBranch", - "shortDescription": { - "text": "Empty branch in alternation" - }, - "fullDescription": { - "text": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation. Example: '(alpha||bravo)' After the quick-fix is applied: '(alpha|bravo)' New in 2017.2", - "markdown": "Reports empty branches in a RegExp alternation. An empty branch will only match the empty string, and in most cases that is not what is desired. This inspection will not report a single empty branch at the start or the end of an alternation.\n\n**Example:**\n\n\n (alpha||bravo)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo)\n\nNew in 2017.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpEmptyAlternationBranch", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "Annotator", - "shortDescription": { - "text": "Annotator" - }, - "fullDescription": { - "text": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection: Option \"Report syntax errors\": report parser-related issues. Option \"Report issues from language-specific annotators\": report issues found by annotators configured for the relevant language. See Custom Language Support: Annotators for details. Option \"Report other highlighting problems\": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See Custom Language Support: Highlighting for details.", - "markdown": "Reports issues essential to this file (e.g., syntax errors) in the result of a batch code inspection run. These issues are usually always highlighted in the editor and can't be configured, unlike inspections. These options control the scope of checks performed by this inspection:\n\n* Option \"**Report syntax errors**\": report parser-related issues.\n* Option \"**Report issues from language-specific annotators** \": report issues found by annotators configured for the relevant language. See [Custom Language Support: Annotators](https://plugins.jetbrains.com/docs/intellij/annotator.html) for details.\n* Option \"**Report other highlighting problems** \": report issues specific to the language of the current file (e.g., type mismatches or unreported exceptions). See [Custom Language Support: Highlighting](https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html#semantic-highlighting) for details." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "Annotator", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlPathReference", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference in XML.", - "markdown": "Reports an unresolved file reference in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlPathReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpUnnecessaryNonCapturingGroup", - "shortDescription": { - "text": "Unnecessary non-capturing group" - }, - "fullDescription": { - "text": "Reports unnecessary non-capturing groups, which have no influence on the match result. Example: 'Everybody be cool, (?:this) is a robbery!' After the quick-fix is applied: 'Everybody be cool, this is a robbery!' New in 2021.1", - "markdown": "Reports unnecessary non-capturing groups, which have no influence on the match result.\n\n**Example:**\n\n\n Everybody be cool, (?:this) is a robbery!\n\nAfter the quick-fix is applied:\n\n\n Everybody be cool, this is a robbery!\n\nNew in 2021.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpUnnecessaryNonCapturingGroup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "TodoComment", - "shortDescription": { - "text": "TODO comment" - }, - "fullDescription": { - "text": "Reports TODO comments in your code. You can configure the format for TODO comments in Settings | Editor | TODO. Enable the Only warn on TODO comments without any details option to only warn on empty TODO comments, that don't provide any description on the task that should be done. Disable to report all TODO comments.", - "markdown": "Reports **TODO** comments in your code.\n\nYou can configure the format for **TODO** comments in [Settings \\| Editor \\| TODO](settings://preferences.toDoOptions).\n\nEnable the **Only warn on TODO comments without any details** option to only warn on empty TODO comments, that\ndon't provide any description on the task that should be done. Disable to report all TODO comments." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "TodoComment", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDeprecatedElement", - "shortDescription": { - "text": "Deprecated symbol" - }, - "fullDescription": { - "text": "Reports a deprecated XML element or attribute. Symbols can be marked by XML comment or documentation tag with text 'deprecated'.", - "markdown": "Reports a deprecated XML element or attribute.\n\nSymbols can be marked by XML comment or documentation tag with text 'deprecated'." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlDeprecatedElement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRedundantNestedCharacterClass", - "shortDescription": { - "text": "Redundant nested character class" - }, - "fullDescription": { - "text": "Reports unnecessary nested character classes. Example: '[a-c[x-z]]' After the quick-fix is applied: '[a-cx-z]' New in 2020.2", - "markdown": "Reports unnecessary nested character classes.\n\n**Example:**\n\n\n [a-c[x-z]]\n\nAfter the quick-fix is applied:\n\n\n [a-cx-z]\n\nNew in 2020.2" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRedundantNestedCharacterClass", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlWrongAttributeValue", - "shortDescription": { - "text": "Wrong attribute value" - }, - "fullDescription": { - "text": "Reports an incorrect HTML attribute value.", - "markdown": "Reports an incorrect HTML attribute value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlWrongAttributeValue", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlDefaultAttributeValue", - "shortDescription": { - "text": "Redundant attribute with default value" - }, - "fullDescription": { - "text": "Reports a redundant assignment of the default value to an XML attribute.", - "markdown": "Reports a redundant assignment of the default value to an XML attribute." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "XmlDefaultAttributeValue", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpOctalEscape", - "shortDescription": { - "text": "Octal escape" - }, - "fullDescription": { - "text": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion. Example: '\\07' After the quick-fix is applied: '\\x07' New in 2017.1", - "markdown": "Reports octal escapes, which are easily confused with back references. Use hexadecimal escapes to avoid confusion.\n\n**Example:**\n\n\n \\07\n\nAfter the quick-fix is applied:\n\n\n \\x07\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "RegExpOctalEscape", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "UnusedDefine", - "shortDescription": { - "text": "Unused define" - }, - "fullDescription": { - "text": "Reports an unused named pattern ('define') in a RELAX-NG file (XML or Compact Syntax). 'define' elements that are used through an include in another file are ignored.", - "markdown": "Reports an unused named pattern (`define`) in a RELAX-NG file (XML or Compact Syntax). `define` elements that are used through an include in another file are ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "UnusedDefine", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RELAX NG", - "index": 47, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "EmptyDirectory", - "shortDescription": { - "text": "Empty directory" - }, - "fullDescription": { - "text": "Reports empty directories. Available only from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name and isn't reported in the editor. Use the Only report empty directories located under a source folder option to have only directories under source roots reported.", - "markdown": "Reports empty directories.\n\nAvailable only from **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name** and isn't reported in the editor.\n\nUse the **Only report empty directories located under a source folder** option to have only directories under source\nroots reported." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "EmptyDirectory", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpAnonymousGroup", - "shortDescription": { - "text": "Anonymous capturing group or numeric back reference" - }, - "fullDescription": { - "text": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. '(?:xxx)' instead of '(xxx)'. Example: '(\\d\\d\\d\\d)\\1' A better regex pattern could look like this: '(?\\d\\d\\d\\d)\\k' New in 2017.2", - "markdown": "Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. `(?:xxx)` instead of `(xxx)`.\n\n**Example:**\n\n\n (\\d\\d\\d\\d)\\1\n\nA better regex pattern could look like this:\n\n\n (?\\d\\d\\d\\d)\\k\n\nNew in 2017.2" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpAnonymousGroup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckDtdRefs", - "shortDescription": { - "text": "Unresolved DTD reference" - }, - "fullDescription": { - "text": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files.", - "markdown": "Reports inconsistency in a DTD-specific reference, for example, in a reference to an XML entity or to a DTD element declaration. Works in DTD an XML files." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CheckDtdRefs", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NonAsciiCharacters", - "shortDescription": { - "text": "Non-ASCII characters" - }, - "fullDescription": { - "text": "Reports code elements that use non-ASCII symbols in an unusual context. Example: Non-ASCII characters used in identifiers, strings, or comments. Identifiers written in different languages, such as 'myСollection' with the letter 'C' written in Cyrillic. Comments or strings containing Unicode symbols, such as long dashes and arrows.", - "markdown": "Reports code elements that use non-ASCII symbols in an unusual context.\n\nExample:\n\n* Non-ASCII characters used in identifiers, strings, or comments.\n* Identifiers written in different languages, such as `my`**С**`ollection` with the letter **C** written in Cyrillic.\n* Comments or strings containing Unicode symbols, such as long dashes and arrows." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NonAsciiCharacters", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Internationalization", - "index": 64, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "XmlUnresolvedReference", - "shortDescription": { - "text": "Unresolved references" - }, - "fullDescription": { - "text": "Reports an unresolved references in XML.", - "markdown": "Reports an unresolved references in XML." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "XmlUnresolvedReference", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "XML", - "index": 39, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LossyEncoding", - "shortDescription": { - "text": "Lossy encoding" - }, - "fullDescription": { - "text": "Reports characters that cannot be displayed because of the current document encoding. Examples: If you type international characters in a document with the US-ASCII charset, some characters will be lost on save. If you load a UTF-8-encoded file using the ISO-8859-1 one-byte charset, some characters will be displayed incorrectly. You can fix this by changing the file encoding either by specifying the encoding directly in the file, e.g. by editing 'encoding=' attribute in the XML prolog of XML file, or by changing the corresponding options in Settings | Editor | File Encodings.", - "markdown": "Reports characters that cannot be displayed because of the current document encoding.\n\nExamples:\n\n* If you type international characters in a document with the **US-ASCII** charset, some characters will be lost on save.\n* If you load a **UTF-8** -encoded file using the **ISO-8859-1** one-byte charset, some characters will be displayed incorrectly.\n\nYou can fix this by changing the file encoding\neither by specifying the encoding directly in the file, e.g. by editing `encoding=` attribute in the XML prolog of XML file,\nor by changing the corresponding options in **Settings \\| Editor \\| File Encodings**." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LossyEncoding", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Internationalization", - "index": 64, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpDuplicateAlternationBranch", - "shortDescription": { - "text": "Duplicate branch in alternation" - }, - "fullDescription": { - "text": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression. Example: '(alpha|bravo|charlie|alpha)' After the quick-fix is applied: '(alpha|bravo|charlie)' New in 2017.1", - "markdown": "Reports duplicate branches in a RegExp alternation. Duplicate branches slow down matching and obscure the intent of the expression.\n\n**Example:**\n\n\n (alpha|bravo|charlie|alpha)\n\nAfter the quick-fix is applied:\n\n\n (alpha|bravo|charlie)\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpDuplicateAlternationBranch", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "RegExpRepeatedSpace", - "shortDescription": { - "text": "Consecutive spaces" - }, - "fullDescription": { - "text": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier. Example: '( )' After the quick-fix is applied: '( {5})' New in 2017.1", - "markdown": "Reports multiple consecutive spaces in a RegExp. Because spaces are not visible by default, it can be hard to see how many spaces are required. The RegExp can be made more clear by replacing the consecutive spaces with a single space and a counted quantifier.\n\n**Example:**\n\n\n ( )\n\nAfter the quick-fix is applied:\n\n\n ( {5})\n\n\nNew in 2017.1" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "RegExpRepeatedSpace", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "RegExp", - "index": 43, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "IgnoreFileDuplicateEntry", - "shortDescription": { - "text": "Ignore file duplicates" - }, - "fullDescription": { - "text": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed. Example: '# Output directories\n /out/\n /target/\n /out/'", - "markdown": "Reports duplicate entries (patterns) in the ignore file (e.g. .gitignore, .hgignore). Duplicate entries in these files are redundant and can be removed.\n\nExample:\n\n\n # Output directories\n /out/\n /target/\n /out/\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "IgnoreFileDuplicateEntry", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Version control", - "index": 66, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckEmptyScriptTag", - "shortDescription": { - "text": "Empty tag" - }, - "fullDescription": { - "text": "Reports empty tags that do not work in some browsers. Example: '\n \n '", - "markdown": "Reports empty tags that do not work in some browsers.\n\n**Example:**\n\n\n \n \n \n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckEmptyScriptTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "HtmlTools", - "version": "251.25776", - "rules": [ - { - "id": "HtmlRequiredAltAttribute", - "shortDescription": { - "text": "Missing required 'alt' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'alt' attribute in a 'img' or 'applet' tag or in a 'area' element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: H24, H35, H36, H37.", - "markdown": "Reports a missing `alt` attribute in a `img` or `applet` tag or in a `area` element of an image map. Suggests adding a required attribute with a text alternative for the contents of the tag. Based on WCAG 2.0: [H24](https://www.w3.org/TR/WCAG20-TECHS/H24.html), [H35](https://www.w3.org/TR/WCAG20-TECHS/H35.html), [H36](https://www.w3.org/TR/WCAG20-TECHS/H36.html), [H37](https://www.w3.org/TR/WCAG20-TECHS/H37.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredAltAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlFormInputWithoutLabel", - "shortDescription": { - "text": "Missing associated label" - }, - "fullDescription": { - "text": "Reports a form element ('input', 'textarea', or 'select') without an associated label. Suggests creating a new label. Based on WCAG 2.0: H44.", - "markdown": "Reports a form element (`input`, `textarea`, or `select`) without an associated label. Suggests creating a new label. Based on WCAG 2.0: [H44](https://www.w3.org/TR/WCAG20-TECHS/H44.html). " - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlFormInputWithoutLabel", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredTitleAttribute", - "shortDescription": { - "text": "Missing required 'title' attribute" - }, - "fullDescription": { - "text": "Reports a missing title attribute 'frame', 'iframe', 'dl', and 'a' tags. Suggests adding a title attribute. Based on WCAG 2.0: H33, H40, and H64.", - "markdown": "Reports a missing title attribute `frame`, `iframe`, `dl`, and `a` tags. Suggests adding a title attribute. Based on WCAG 2.0: [H33](https://www.w3.org/TR/WCAG20-TECHS/H33.html), [H40](https://www.w3.org/TR/WCAG20-TECHS/H40.html), and [H64](https://www.w3.org/TR/WCAG20-TECHS/H64.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlRequiredTitleAttribute", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlDeprecatedTag", - "shortDescription": { - "text": "Obsolete tag" - }, - "fullDescription": { - "text": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag.", - "markdown": "Reports an obsolete HTML5 tag. Suggests replacing the obsolete tag with a CSS or another tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlDeprecatedTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckImageSize", - "shortDescription": { - "text": "Mismatched image size" - }, - "fullDescription": { - "text": "Reports a 'width' and 'height' attribute value of a 'img' tag that is different from the actual width and height of the referenced image.", - "markdown": "Reports a `width` and `height` attribute value of a `img` tag that is different from the actual width and height of the referenced image." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckImageSize", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Performance" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredSummaryAttribute", - "shortDescription": { - "text": "Missing required 'summary' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'summary' attribute in a 'table' tag. Suggests adding a'summary' attribute. Based on WCAG 2.0: H73.", - "markdown": "Reports a missing `summary` attribute in a `table` tag. Suggests adding a`summary` attribute. Based on WCAG 2.0: [H73](https://www.w3.org/TR/WCAG20-TECHS/H73.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlRequiredSummaryAttribute", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredLangAttribute", - "shortDescription": { - "text": "Missing required 'lang' attribute" - }, - "fullDescription": { - "text": "Reports a missing 'lang' (or 'xml:lang') attribute in a 'html' tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: H57.", - "markdown": "Reports a missing `lang` (or `xml:lang`) attribute in a `html` tag. Suggests adding a required attribute to state the default language of the document. Based on WCAG 2.0: [H57](https://www.w3.org/TR/WCAG20-TECHS/H57.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredLangAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlNonExistentInternetResource", - "shortDescription": { - "text": "Unresolved web link" - }, - "fullDescription": { - "text": "Reports an unresolved web link. Works by making network requests in the background.", - "markdown": "Reports an unresolved web link. Works by making network requests in the background." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlNonExistentInternetResource", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlRequiredTitleElement", - "shortDescription": { - "text": "Missing required 'title' element" - }, - "fullDescription": { - "text": "Reports a missing 'title' element inside a 'head' section. Suggests adding a 'title' element. The title should describe the document. Based on WCAG 2.0: H25.", - "markdown": "Reports a missing `title` element inside a `head` section. Suggests adding a `title` element. The title should describe the document. Based on WCAG 2.0: [H25](https://www.w3.org/TR/WCAG20-TECHS/H25.html)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlRequiredTitleElement", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTML/Accessibility", - "index": 24, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlDeprecatedAttribute", - "shortDescription": { - "text": "Obsolete attribute" - }, - "fullDescription": { - "text": "Reports an obsolete HTML5 attribute.", - "markdown": "Reports an obsolete HTML5 attribute." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "HtmlDeprecatedAttribute", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "HtmlPresentationalElement", - "shortDescription": { - "text": "Presentational tag" - }, - "fullDescription": { - "text": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag.", - "markdown": "Reports a presentational HTML tag. Suggests replacing the presentational tag with a CSS or another tag." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "HtmlPresentationalElement", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "HTML", - "index": 18, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.css", - "version": "251.25776", - "rules": [ - { - "id": "CssInvalidHtmlTagReference", - "shortDescription": { - "text": "Invalid type selector" - }, - "fullDescription": { - "text": "Reports a CSS type selector that matches an unknown HTML element.", - "markdown": "Reports a CSS [type selector](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors) that matches an unknown HTML element." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidHtmlTagReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidCustomPropertyAtRuleDeclaration", - "shortDescription": { - "text": "Invalid @property declaration" - }, - "fullDescription": { - "text": "Reports a missing required syntax, inherits, or initial-value property in a declaration of a custom property.", - "markdown": "Reports a missing required [syntax](https://developer.mozilla.org/en-US/docs/web/css/@property/syntax), [inherits](https://developer.mozilla.org/en-US/docs/web/css/@property/inherits), or [initial-value](https://developer.mozilla.org/en-US/docs/web/css/@property/initial-value) property in a declaration of a custom property." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidCustomPropertyAtRuleDeclaration", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidFunction", - "shortDescription": { - "text": "Invalid function" - }, - "fullDescription": { - "text": "Reports an unknown CSS function or an incorrect function parameter.", - "markdown": "Reports an unknown [CSS function](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Functions) or an incorrect function parameter." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidFunction", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssMissingSemicolon", - "shortDescription": { - "text": "Missing semicolon" - }, - "fullDescription": { - "text": "Reports a missing semicolon at the end of a declaration.", - "markdown": "Reports a missing semicolon at the end of a declaration." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssMissingSemicolon", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Code style issues", - "index": 41, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssRedundantUnit", - "shortDescription": { - "text": "Redundant measure unit" - }, - "fullDescription": { - "text": "Reports a measure unit of a zero value where units are not required by the specification. Example: 'width: 0px'", - "markdown": "Reports a measure unit of a zero value where units are not required by the specification.\n\n**Example:**\n\n width: 0px\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssRedundantUnit", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Code style issues", - "index": 41, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssMissingComma", - "shortDescription": { - "text": "Missing comma in selector list" - }, - "fullDescription": { - "text": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines. Example: 'input /* comma has probably been forgotten */\n.button {\n margin: 1px;\n}'", - "markdown": "Reports a multi-line selector. Most likely this means that several single-line selectors are actually intended but a comma is missing at the end of one or several lines.\n\n**Example:**\n\n\n input /* comma has probably been forgotten */\n .button {\n margin: 1px;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssMissingComma", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 48, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidPropertyValue", - "shortDescription": { - "text": "Invalid property value" - }, - "fullDescription": { - "text": "Reports an incorrect CSS property value.", - "markdown": "Reports an incorrect CSS property value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidPropertyValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssBrowserCompatibilityForProperties", - "shortDescription": { - "text": "Property is incompatible with selected browsers" - }, - "fullDescription": { - "text": "Reports a CSS property that is not supported by the specified browsers. Based on the MDN Compatibility Data.", - "markdown": "Reports a CSS property that is not supported by the specified browsers. Based on the [MDN Compatibility Data](https://github.com/mdn/browser-compat-data)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssBrowserCompatibilityForProperties", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidCustomPropertyAtRuleName", - "shortDescription": { - "text": "Invalid @property name" - }, - "fullDescription": { - "text": "Reports an invalid custom property name. Custom property name should be prefixed with two dashes. Example: '@property invalid-property-name {\n ...\n}\n\n@property --valid-property-name {\n ...\n}'", - "markdown": "Reports an invalid custom property name. Custom property name should be prefixed with two dashes.\n\n**Example:**\n\n\n @property invalid-property-name {\n ...\n }\n\n @property --valid-property-name {\n ...\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidCustomPropertyAtRuleName", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssConvertColorToHexInspection", - "shortDescription": { - "text": "Color could be replaced with #-hex" - }, - "fullDescription": { - "text": "Reports an 'rgb()', 'hsl()', or other color function. Suggests replacing a color function with an equivalent hexadecimal notation. Example: 'rgb(12, 15, 255)' After the quick-fix is applied: '#0c0fff'.", - "markdown": "Reports an `rgb()`, `hsl()`, or other color function.\n\nSuggests replacing a color function with an equivalent hexadecimal notation.\n\n**Example:**\n\n rgb(12, 15, 255)\n\nAfter the quick-fix is applied:\n\n #0c0fff.\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssConvertColorToHexInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssReplaceWithShorthandUnsafely", - "shortDescription": { - "text": "Properties may probably be replaced with a shorthand" - }, - "fullDescription": { - "text": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case. For example, 2 properties: 'outline-color' and 'outline-style' may be replaced with a single 'outline'. Such replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states. In this example, switching to the 'outline' shorthand means that 'outline-width' is also set to its initial value, which is 'medium'. This inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe). For such cases see the 'Properties may be safely replaced with a shorthand' inspection instead.", - "markdown": "Reports a set of longhand CSS properties and suggests replacing an incomplete set of longhand CSS properties with a shorthand form, which is however not 100% equivalent in this case.\n\n\nFor example, 2 properties: `outline-color` and `outline-style` may be replaced with a single `outline`.\nSuch replacement is not 100% equivalent because shorthands reset all omitted sub-values to their initial states.\nIn this example, switching to the `outline` shorthand means that `outline-width` is also set to its initial value,\nwhich is `medium`.\n\n\nThis inspection doesn't handle full sets of longhand properties (when switching to shorthand is 100% safe).\nFor such cases see the 'Properties may be safely replaced with a shorthand' inspection instead." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssReplaceWithShorthandUnsafely", - "ideaSeverity": "INFORMATION", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownUnit", - "shortDescription": { - "text": "Unknown unit" - }, - "fullDescription": { - "text": "Reports an unknown unit.", - "markdown": "Reports an unknown unit." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnknownUnit", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidMediaFeature", - "shortDescription": { - "text": "Invalid media feature" - }, - "fullDescription": { - "text": "Reports an unknown CSS media feature or an incorrect media feature value.", - "markdown": "Reports an unknown [CSS media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) or an incorrect media feature value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidMediaFeature", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssConvertColorToRgbInspection", - "shortDescription": { - "text": "Color could be replaced with rgb()" - }, - "fullDescription": { - "text": "Reports an 'hsl()' or 'hwb()' color function or a hexadecimal color notation. Suggests replacing such color value with an equivalent 'rgb()' or 'rgba()' color function. Example: '#0c0fff' After the quick-fix is applied: 'rgb(12, 15, 255)'.", - "markdown": "Reports an `hsl()` or `hwb()` color function or a hexadecimal color notation.\n\nSuggests replacing such color value with an equivalent `rgb()` or `rgba()` color function.\n\n**Example:**\n\n #0c0fff\n\nAfter the quick-fix is applied:\n\n rgb(12, 15, 255).\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssConvertColorToRgbInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnusedSymbol", - "shortDescription": { - "text": "Unused selector" - }, - "fullDescription": { - "text": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML. Note that complete inspection results are available only when running it via Code | Inspect Code or Code | Analyze Code | Run Inspection by Name. Due to performance reasons, style sheet files are not inspected on the fly.", - "markdown": "Reports a CSS class or an element IDs that appears in selectors but is not used in HTML.\n\n\nNote that complete inspection results are available only when running it via **Code \\| Inspect Code** or\n**Code \\| Analyze Code \\| Run Inspection by Name**.\nDue to performance reasons, style sheet files are not inspected on the fly." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssUnusedSymbol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssDeprecatedValue", - "shortDescription": { - "text": "Deprecated value" - }, - "fullDescription": { - "text": "Reports a deprecated CSS value. Suggests replacing the deprecated value with its valid equivalent.", - "markdown": "Reports a deprecated CSS value. Suggests replacing the deprecated value with its valid equivalent." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssDeprecatedValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNonIntegerLengthInPixels", - "shortDescription": { - "text": "Non-integer length in pixels" - }, - "fullDescription": { - "text": "Reports a non-integer length in pixels. Example: 'width: 3.14px'", - "markdown": "Reports a non-integer length in pixels.\n\n**Example:**\n\n width: 3.14px\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssNonIntegerLengthInPixels", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 48, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidImport", - "shortDescription": { - "text": "Misplaced @import" - }, - "fullDescription": { - "text": "Reports a misplaced '@import' statement. According to the specification, an '@import' rule must be defined at the top of the stylesheet, before any other at-rule (except '@charset' and '@layer') and style declarations, or it will be ignored.", - "markdown": "Reports a misplaced `@import` statement.\n\n\nAccording to the [specification](https://developer.mozilla.org/en-US/docs/Web/CSS/@import),\nan `@import` rule must be defined at the top of the stylesheet, before any other at-rule\n(except `@charset` and `@layer`) and style declarations, or it will be ignored." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidImport", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidAtRule", - "shortDescription": { - "text": "Unknown at-rule" - }, - "fullDescription": { - "text": "Reports an unknown CSS at-rule.", - "markdown": "Reports an unknown [CSS at-rule](https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidAtRule", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnresolvedCustomProperty", - "shortDescription": { - "text": "Unresolved custom property" - }, - "fullDescription": { - "text": "Reports an unresolved reference to a custom property among the arguments of the 'var()' function.", - "markdown": "Reports an unresolved reference to a [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) among the arguments of the `var()` function." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnresolvedCustomProperty", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssOverwrittenProperties", - "shortDescription": { - "text": "Overwritten property" - }, - "fullDescription": { - "text": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties. Example: '.foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n}'", - "markdown": "Reports a duplicated CSS property within a ruleset. Respects shorthand properties.\n\n**Example:**\n\n\n .foo {\n margin-bottom: 1px;\n margin-bottom: 1px; /* duplicates margin-bottom */\n margin: 0; /* overrides margin-bottom */\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssOverwrittenProperties", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownTarget", - "shortDescription": { - "text": "Unresolved file reference" - }, - "fullDescription": { - "text": "Reports an unresolved file reference, for example, an incorrect path in an '@import' statement.", - "markdown": "Reports an unresolved file reference, for example, an incorrect path in an `@import` statement." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnknownTarget", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNegativeValue", - "shortDescription": { - "text": "Negative property value" - }, - "fullDescription": { - "text": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height.", - "markdown": "Reports a negative value of a CSS property that is not expected to be less than zero, for example, object width or height." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssNegativeValue", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssNoGenericFontName", - "shortDescription": { - "text": "Missing generic font family name" - }, - "fullDescription": { - "text": "Verifies that the 'font-family' property contains a generic font family name as a fallback alternative. Generic font family names are: 'serif', 'sans-serif', 'cursive', 'fantasy', and 'monospace'.", - "markdown": "Verifies that the [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) property contains a generic font family name as a fallback alternative.\n\n\nGeneric font family names are: `serif`, `sans-serif`, `cursive`, `fantasy`,\nand `monospace`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssNoGenericFontName", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Probable bugs", - "index": 48, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnresolvedClassInComposesRule", - "shortDescription": { - "text": "Unresolved class in 'composes' rule" - }, - "fullDescription": { - "text": "Reports a CSS class reference in the 'composes' rule that cannot be resolved to any valid target. Example: '.className {/* ... */}\n\n .otherClassName {\n composes: className;\n }'", - "markdown": "Reports a CSS class reference in the ['composes'](https://github.com/css-modules/css-modules#composition) rule that cannot be resolved to any valid target.\n\n**Example:**\n\n\n .className {/* ... */}\n\n .otherClassName {\n composes: className;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssUnresolvedClassInComposesRule", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidCharsetRule", - "shortDescription": { - "text": "Misplaced or incorrect @charset" - }, - "fullDescription": { - "text": "Reports a misplaced '@charset' at-rule or an incorrect charset value.", - "markdown": "Reports a misplaced `@charset` at-rule or an incorrect charset value." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidCharsetRule", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssReplaceWithShorthandSafely", - "shortDescription": { - "text": "Properties may be safely replaced with a shorthand" - }, - "fullDescription": { - "text": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form. For example, 4 properties: 'padding-top', 'padding-right', 'padding-bottom', and 'padding-left' can be safely replaced with a single 'padding' property. Note that this inspection doesn't show up if the set of longhand properties is incomplete (e.g. only 3 'padding-xxx' properties in a ruleset) because switching to a shorthand may change the result. For such cases consider the 'Properties may probably be replaced with a shorthand' inspection.", - "markdown": "Reports a set of longhand properties. Suggests replacing a complete set of longhand CSS properties with an equivalent shorthand form.\n\n\nFor example, 4 properties: `padding-top`, `padding-right`, `padding-bottom`, and\n`padding-left`\ncan be safely replaced with a single `padding` property.\n\n\nNote that this inspection doesn't show up if the set of longhand properties is incomplete\n(e.g. only 3 `padding-xxx` properties in a ruleset)\nbecause switching to a shorthand may change the result.\nFor such cases consider the 'Properties may probably be replaced with a shorthand'\ninspection." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "CssReplaceWithShorthandSafely", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS", - "index": 30, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssUnknownProperty", - "shortDescription": { - "text": "Unknown property" - }, - "fullDescription": { - "text": "Reports an unknown CSS property or a property used in a wrong context. Add the unknown property to the 'Custom CSS properties' list to skip validation.", - "markdown": "Reports an unknown CSS property or a property used in a wrong context.\n\nAdd the unknown property to the 'Custom CSS properties' list to skip validation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssUnknownProperty", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidPseudoSelector", - "shortDescription": { - "text": "Invalid pseudo-selector" - }, - "fullDescription": { - "text": "Reports an incorrect CSS pseudo-class pseudo-element.", - "markdown": "Reports an incorrect CSS [pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) [pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "CssInvalidPseudoSelector", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CssInvalidNestedSelector", - "shortDescription": { - "text": "Invalid nested selector" - }, - "fullDescription": { - "text": "Reports a nested selector starting with an identifier or a functional notation.", - "markdown": "Reports a nested selector starting with an identifier or a functional notation." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CssInvalidNestedSelector", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "CSS/Invalid elements", - "index": 31, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.plugins.dependencyAnalysis", - "version": "251.25776", - "rules": [ - { - "id": "CheckThirdPartySoftwareList", - "shortDescription": { - "text": "Check third party software list" - }, - "fullDescription": { - "text": "Check project for possible problems: user's third party software list does not match the collected project metadata", - "markdown": "Check project for possible problems: user's third party software list does not match the collected project metadata" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckThirdPartySoftwareList", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckDependencyLicenses", - "shortDescription": { - "text": "Check dependency licenses" - }, - "fullDescription": { - "text": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues", - "markdown": "Check dependencies licenses for possible problems: missing or prohibited licenses, or other compliance issues" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CheckDependencyLicenses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CheckModuleLicenses", - "shortDescription": { - "text": "Check module licenses" - }, - "fullDescription": { - "text": "Check module licenses for possible problems: missing licenses or other compliance issues", - "markdown": "Check module licenses for possible problems: missing licenses or other compliance issues" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CheckModuleLicenses", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Dependency analysis", - "index": 35, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.yaml", - "version": "251.25776", - "rules": [ - { - "id": "YAMLSchemaValidation", - "shortDescription": { - "text": "Validation by JSON Schema" - }, - "fullDescription": { - "text": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified. Scheme example: '{\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeNumberProperty: hello world'", - "markdown": "Reports inconsistencies between a YAML file and a JSON Schema if the schema is specified.\n\n**Scheme example:**\n\n\n {\n \"properties\": {\n \"SomeNumberProperty\": {\n \"type\": \"number\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeNumberProperty: hello world\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLSchemaValidation", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLIncompatibleTypes", - "shortDescription": { - "text": "Suspicious type mismatch" - }, - "fullDescription": { - "text": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions. Example: 'myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings'", - "markdown": "Reports a mismatch between a scalar value type in YAML file and types of the values in the similar positions.\n\n**Example:**\n\n\n myElements:\n - value1\n - value2\n - false # <- reported, because it is a boolean value, while other values are strings\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLIncompatibleTypes", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLUnresolvedAlias", - "shortDescription": { - "text": "Unresolved alias" - }, - "fullDescription": { - "text": "Reports unresolved aliases in YAML files. Example: 'some_key: *unknown_alias'", - "markdown": "Reports unresolved aliases in YAML files.\n\n**Example:**\n\n\n some_key: *unknown_alias\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLUnresolvedAlias", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLSchemaDeprecation", - "shortDescription": { - "text": "Deprecated YAML key" - }, - "fullDescription": { - "text": "Reports deprecated keys in YAML files. Deprecation is checked only if there exists a JSON schema associated with the corresponding YAML file. Note that the deprecation mechanism is not defined in the JSON Schema specification yet, and this inspection uses a non-standard 'deprecationMessage' extension. Scheme deprecation example: '{\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }' The following is an example with the corresponding warning: 'SomeDeprecatedProperty: some value'", - "markdown": "Reports deprecated keys in YAML files.\n\nDeprecation is checked only if there exists a JSON schema associated with the corresponding YAML file.\n\nNote that the deprecation mechanism is not defined in the JSON Schema specification yet,\nand this inspection uses a non-standard `deprecationMessage` extension.\n\n**Scheme deprecation example:**\n\n\n {\n \"properties\": {\n \"SomeDeprecatedProperty\": {\n \"deprecationMessage\": \"Baz\",\n \"description\": \"Foo bar\"\n }\n }\n }\n\n**The following is an example with the corresponding warning:**\n\n\n SomeDeprecatedProperty: some value\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "YAMLSchemaDeprecation", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLRecursiveAlias", - "shortDescription": { - "text": "Recursive alias" - }, - "fullDescription": { - "text": "Reports recursion in YAML aliases. Alias can't be recursive and be used inside the data referenced by a corresponding anchor. Example: 'some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor'", - "markdown": "Reports recursion in YAML aliases.\n\nAlias can't be recursive and be used inside the data referenced by a corresponding anchor.\n\n**Example:**\n\n\n some_key: &some_anchor\n sub_key1: value1\n sub_key2: *some_anchor\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLRecursiveAlias", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLDuplicatedKeys", - "shortDescription": { - "text": "Duplicated YAML keys" - }, - "fullDescription": { - "text": "Reports duplicated keys in YAML files. Example: 'same_key: some value\n same_key: another value'", - "markdown": "Reports duplicated keys in YAML files.\n\n**Example:**\n\n\n same_key: some value\n same_key: another value\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "error", - "parameters": { - "suppressToolId": "YAMLDuplicatedKeys", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "YAMLUnusedAnchor", - "shortDescription": { - "text": "Unused anchor" - }, - "fullDescription": { - "text": "Reports unused anchors. Example: 'some_key: &some_anchor\n key1: value1'", - "markdown": "Reports unused anchors.\n\n**Example:**\n\n\n some_key: &some_anchor\n key1: value1\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "YAMLUnusedAnchor", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "YAML", - "index": 36, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.qodana", - "version": "251.25776", - "rules": [ - { - "id": "PyCoverageInspection", - "shortDescription": { - "text": "Check Python source code coverage" - }, - "fullDescription": { - "text": "Reports methods, classes and files whose coverage is below a certain threshold.", - "markdown": "Reports methods, classes and files whose coverage is below a certain threshold." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyCoverageInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Code Coverage", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsCoverageInspection", - "shortDescription": { - "text": "Check JavaScript and TypeScript source code coverage" - }, - "fullDescription": { - "text": "Reports methods, classes and files whose coverage is below a certain threshold.", - "markdown": "Reports methods, classes and files whose coverage is below a certain threshold." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsCoverageInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Code Coverage", - "index": 38, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "CyclomaticComplexityInspection", - "shortDescription": { - "text": "Code metrics" - }, - "fullDescription": { - "text": "Calculates cyclomatic complexity.", - "markdown": "Calculates cyclomatic complexity." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "CyclomaticComplexityInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Qodana", - "index": 56, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "Pythonid", - "version": "251.25776", - "rules": [ - { - "id": "CythonUsageBeforeDeclarationInspection", - "shortDescription": { - "text": "Cython variable is used before its declaration" - }, - "fullDescription": { - "text": "Reports Cython variables being referenced before declaration. Example: 'cdef int c_x\n\nprint(c_x, c_y) # Variable 'c_y' is used before its declaration\n\ncdef int c_y = 0'", - "markdown": "Reports Cython variables being referenced before declaration.\n\n**Example:**\n\n\n cdef int c_x\n\n print(c_x, c_y) # Variable 'c_y' is used before its declaration\n\n cdef int c_y = 0\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "CythonUsageBeforeDeclaration", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Python", - "index": 3, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyramidSetupInspection", - "shortDescription": { - "text": "Project is not installed for development" - }, - "fullDescription": { - "text": "Reports cases when no 'python setup.py develop' command was executed for the Pyramid project. You need to execute this command to install the newly created project for development.", - "markdown": "Reports cases when no `python setup.py develop` command was executed for the Pyramid project.\n\nYou need to execute this command to install the newly created project for development." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "PyramidSetup", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Pyramid", - "index": 62, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.less", - "version": "251.25776", - "rules": [ - { - "id": "LessUnresolvedMixin", - "shortDescription": { - "text": "Unresolved mixin" - }, - "fullDescription": { - "text": "Reports a reference to a Less mixin that is not resolved. Example: '* {\n .unknown-mixin();\n}'", - "markdown": "Reports a reference to a [Less mixin](http://lesscss.org/features/#mixins-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n .unknown-mixin();\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LessUnresolvedMixin", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LessUnresolvedVariable", - "shortDescription": { - "text": "Unresolved variable" - }, - "fullDescription": { - "text": "Reports a reference to a Less variable that is not resolved. Example: '* {\n margin: @unknown-var;\n}'", - "markdown": "Reports a reference to a [Less variable](http://lesscss.org/features/#variables-feature) that is not resolved.\n\n**Example:**\n\n\n * {\n margin: @unknown-var;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "LessUnresolvedVariable", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "LessResolvedByNameOnly", - "shortDescription": { - "text": "Missing import" - }, - "fullDescription": { - "text": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly imported in the current file. Example: '* {\n margin: @var-in-other-file;\n}'", - "markdown": "Reports a reference to a variable or mixin that is declared in another file, which is not explicitly [imported](http://lesscss.org/features/#import-atrules-feature) in the current file.\n\n**Example:**\n\n\n * {\n margin: @var-in-other-file;\n }\n" - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "LessResolvedByNameOnly", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Less", - "index": 42, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.intellij.intelliLang", - "version": "251.25776", - "rules": [ - { - "id": "InjectedReferences", - "shortDescription": { - "text": "Injected references" - }, - "fullDescription": { - "text": "Reports unresolved references injected by Language Injections. Example: '@Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist'", - "markdown": "Reports unresolved references injected by [Language Injections](https://www.jetbrains.com/help/idea/using-language-injections.html).\n\nExample:\n\n\n @Language(\"file-reference\")\n String fileName = \"/home/user/nonexistent.file\"; // highlighted if file doesn't exist\n" - }, - "defaultConfiguration": { - "enabled": true, - "level": "error", - "parameters": { - "suppressToolId": "InjectedReferences", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "General", - "index": 23, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.plugins.vue", - "version": "251.25776", - "rules": [ - { - "id": "VueDataFunction", - "shortDescription": { - "text": "Data function" - }, - "fullDescription": { - "text": "Reports a Vue component data property that is not a function. Suggests wrapping an object literal with a function. When defining a component, 'data' must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for 'data', that very object will be shared by reference across all instances created! With a 'data' function, every time a new instance is created we can simply call it to return a fresh copy of the initial data.", - "markdown": "Reports a Vue component [data](https://vuejs.org/v2/api/#data) property that is not a function. Suggests wrapping an object literal with a function.\n\nWhen defining a component, `data` must be declared as a function that returns the initial data object, because the same definition will be used for creating numerous instances. If a plain object is still used for `data`, that very object will be shared by reference across all instances created! With a `data` function, every time a new instance is created we can simply call it to return a fresh copy of the initial data." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDataFunction", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueUnrecognizedSlot", - "shortDescription": { - "text": "Unrecognized slot" - }, - "fullDescription": { - "text": "Reports an unrecognized Vue slot.", - "markdown": "Reports an unrecognized Vue slot." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "VueUnrecognizedSlot", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueMissingComponentImportInspection", - "shortDescription": { - "text": "Missing component import" - }, - "fullDescription": { - "text": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import.", - "markdown": "Reports Vue components, which require to be imported in Vue templates. It provides a quick fix to add the missing import." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueMissingComponentImportInspection", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueUnrecognizedDirective", - "shortDescription": { - "text": "Unrecognized directive" - }, - "fullDescription": { - "text": "Reports an unrecognized Vue directive.", - "markdown": "Reports an unrecognized Vue directive." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueUnrecognizedDirective", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueDuplicateTag", - "shortDescription": { - "text": "Duplicate template/script tag" - }, - "fullDescription": { - "text": "Reports multiple usages of the 'template' or 'script' tag in a Vue file. Vue Component specification indicates that each '*.vue' file can contain at most one 'template' or 'script' block at a time.", - "markdown": "Reports multiple usages of the `template` or `script` tag in a Vue file.\n\n[Vue Component specification](https://vue-loader.vuejs.org/spec.html) indicates that each `*.vue` file can contain at most one `template` or `script` block at a time." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDuplicateTag", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "VueDeprecatedSymbol", - "shortDescription": { - "text": "Deprecated symbol" - }, - "fullDescription": { - "text": "Reports a deprecated Vue symbol.", - "markdown": "Reports a deprecated Vue symbol." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "VueDeprecatedSymbol", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "Vue", - "index": 44, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.jetbrains.security.package-checker", - "version": "251.25776", - "rules": [ - { - "id": "VulnerableLibrariesLocal", - "shortDescription": { - "text": "Vulnerable declared dependency" - }, - "fullDescription": { - "text": "Reports vulnerabilities in Gradle, Maven, NPM and PyPI dependencies declared in your project. A full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries. Fixing the reported problems helps prevent your software from being compromised by an attacker. To solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability. The quick-fixes available may suggest updating to a safe version or visiting the website to learn more about a particular vulnerability.", - "markdown": "Reports vulnerabilities in Gradle, Maven, NPM and PyPI dependencies declared in your project.\nA full list of Gradle and Maven dependencies is shown in the Project tool window under External Libraries.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nTo solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability.\n\nThe quick-fixes available may suggest updating to a safe version or visiting the website to learn more about a particular vulnerability." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "VulnerableLibrariesLocal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 55, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "MaliciousLibrariesLocal", - "shortDescription": { - "text": "Malicious dependency" - }, - "fullDescription": { - "text": "Reports malicious NPM and PyPI dependencies declared in your project. Fixing the reported problems helps prevent your software from being compromised by an attacker. Remove a malicious package to solve a problem.", - "markdown": "Reports malicious NPM and PyPI dependencies declared in your project.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nRemove a malicious package to solve a problem." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "MaliciousLibrariesLocal", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 55, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "PyVulnerableApiCodeInspection", - "shortDescription": { - "text": "Vulnerable API usage" - }, - "fullDescription": { - "text": "Reports usages of Vulnerable APIs of imported dependencies. Fixing the reported problems helps prevent your software from being compromised by an attacker. To solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability.", - "markdown": "Reports usages of Vulnerable APIs of imported dependencies.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nTo solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "PyVulnerableApiCode", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Python/Security", - "index": 60, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "NpmVulnerableApiCode", - "shortDescription": { - "text": "Vulnerable API usage" - }, - "fullDescription": { - "text": "Reports usages of Vulnerable APIs of imported dependencies. Fixing the reported problems helps prevent your software from being compromised by an attacker. To solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability.", - "markdown": "Reports usages of Vulnerable APIs of imported dependencies.\n\nFixing the reported problems helps prevent your software from being compromised by an attacker.\n\nTo solve a problem, you can update to a version where the vulnerability is fixed (if available) or switch to a dependency that doesn't have the vulnerability." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "NpmVulnerableApiCode", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/Security", - "index": 61, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "intellij.webpack", - "version": "251.25776", - "rules": [ - { - "id": "WebpackConfigHighlighting", - "shortDescription": { - "text": "Webpack config compliance with JSON Schema" - }, - "fullDescription": { - "text": "Validates options in webpack config files (which name should start with `webpack`, e.g. `webpack.config.js`) against webpack options schema. Disable this inspection to turn off validation and code completion inside the configuration object.", - "markdown": "Validates options in webpack config files (which name should start with \\`webpack\\`, e.g. \\`webpack.config.js\\`) against [webpack options schema](https://github.com/webpack/webpack/blob/master/schemas/WebpackOptions.json). \n\nDisable this inspection to turn off validation and code completion inside the configuration object." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "WebpackConfigHighlighting", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "JavaScript and TypeScript/General", - "index": 11, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.jsonpath", - "version": "251.25776", - "rules": [ - { - "id": "JsonPathEvaluateUnknownKey", - "shortDescription": { - "text": "Unknown property key used for JSONPath evaluate expression" - }, - "fullDescription": { - "text": "Reports a key in a JSONPath expression that is missing in the source JSON document to evaluate.", - "markdown": "Reports a key in a JSONPath expression that is missing in the source JSON document to evaluate." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonPathEvaluateUnknownKey", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Reliability" - } - }, - "relationships": [ - { - "target": { - "id": "JSONPath", - "index": 59, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonPathUnknownFunction", - "shortDescription": { - "text": "Unknown JSONPath function" - }, - "fullDescription": { - "text": "Reports an unknown name in a JSONPath function call instead of known standard function names: 'concat', 'keys', 'length', 'min', 'max', 'avg', 'stddev', 'sum'.", - "markdown": "Reports an unknown name in a JSONPath function call instead of known standard function names: `concat`, `keys`, `length`, `min`, `max`, `avg`, `stddev`, `sum`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonPathUnknownFunction", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JSONPath", - "index": 59, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "JsonPathUnknownOperator", - "shortDescription": { - "text": "Unknown JSONPath operator" - }, - "fullDescription": { - "text": "Reports an unknown operator on a JSONPath expression instead of one of the standard ones: 'in', 'nin', 'subsetof', 'anyof', 'noneof', 'size', 'empty', 'contains'.", - "markdown": "Reports an unknown operator on a JSONPath expression instead of one of the standard ones: `in`, `nin`, `subsetof`, `anyof`, `noneof`, `size`, `empty`, `contains`." - }, - "defaultConfiguration": { - "enabled": false, - "level": "warning", - "parameters": { - "suppressToolId": "JsonPathUnknownOperator", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "JSONPath", - "index": 59, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "com.intellij.hardcodedPasswords", - "version": "251.25776", - "rules": [ - { - "id": "HardcodedPasswords", - "shortDescription": { - "text": "Hardcoded passwords" - }, - "fullDescription": { - "text": "Detects potential security tokens or passwords in comments using entropy analysis and regular expressions. This inspection utilizes entropy analysis and regular expressions to scan the codebase for strings that resemble security tokens or passwords. It highlights these findings, helping developers identify and secure potential vulnerabilities. The inspection's effectiveness relies on the patterns defined in its configuration, making it adaptable to different coding environments and requirements. '// Example of a regular expression pattern used for detection:\n/[0-9]+:AA[0-9A-Za-z\\-_]{33}/' Text after this comment will only be shown in the settings of the inspection.", - "markdown": "Detects potential security tokens or passwords in comments using entropy analysis and regular expressions.\n\n\nThis inspection utilizes entropy analysis and regular expressions to scan the codebase for strings that resemble security tokens or\npasswords. It highlights these findings, helping developers identify and secure potential vulnerabilities. The inspection's effectiveness\nrelies on the patterns defined in its configuration, making it adaptable to different coding environments and requirements.\n\n\n // Example of a regular expression pattern used for detection:\n /[0-9]+:AA[0-9A-Za-z\\-_]{33}/\n\nText after this comment will only be shown in the settings of the inspection." - }, - "defaultConfiguration": { - "enabled": true, - "level": "error", - "parameters": { - "suppressToolId": "HardcodedPasswords", - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "codeQualityCategory": "Unspecified" - } - }, - "relationships": [ - { - "target": { - "id": "Security", - "index": 55, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "tanvd.grazi", - "version": "251.25776", - "rules": [ - { - "id": "LanguageDetectionInspection", - "shortDescription": { - "text": "Natural language detection" - }, - "fullDescription": { - "text": "Detects natural languages and suggests enabling corresponding grammar and spelling checks.", - "markdown": "Detects natural languages and suggests enabling corresponding grammar and spelling checks." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "LanguageDetectionInspection", - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - }, - { - "id": "GrazieInspection", - "shortDescription": { - "text": "Grammar" - }, - "fullDescription": { - "text": "Reports grammar mistakes in your text. You can configure the inspection in Settings | Editor | Natural Languages | Grammar and Style.", - "markdown": "Reports grammar mistakes in your text. You can configure the inspection in [Settings \\| Editor \\| Natural Languages \\| Grammar and Style](settings://reference.settingsdialog.project.grazie)." - }, - "defaultConfiguration": { - "enabled": false, - "level": "note", - "parameters": { - "suppressToolId": "GrazieInspection", - "ideaSeverity": "GRAMMAR_ERROR", - "qodanaSeverity": "Info", - "codeQualityCategory": "Code Style" - } - }, - "relationships": [ - { - "target": { - "id": "Proofreading", - "index": 54, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - }, - { - "name": "org.toml.lang", - "version": "251.25776", - "rules": [ - { - "id": "TomlUnresolvedReference", - "shortDescription": { - "text": "Unresolved reference" - }, - "fullDescription": { - "text": "Reports unresolved references in TOML files.", - "markdown": "Reports unresolved references in TOML files." - }, - "defaultConfiguration": { - "enabled": true, - "level": "warning", - "parameters": { - "suppressToolId": "TomlUnresolvedReference", - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "codeQualityCategory": "Sanity" - } - }, - "relationships": [ - { - "target": { - "id": "TOML", - "index": 65, - "toolComponent": { - "name": "QDPY" - } - }, - "kinds": [ - "superset" - ] - } - ] - } - ], - "language": "en-US", - "contents": [ - "localizedData", - "nonLocalizedData" - ], - "isComprehensive": false - } - ] - }, - "invocations": [ - { - "startTimeUtc": "2025-05-05T14:34:25.073248364Z", - "exitCode": 0, - "toolExecutionNotifications": [ - { - "message": { - "text": "Analysis by sanity inspection \"An invalid interpreter\" was suspended due to high number of problems." - }, - "level": "error", - "timeUtc": "2025-05-05T14:34:42.131319835Z", - "properties": { - "qodanaKind": "sanityFailure" - } - } - ], - "executionSuccessful": true - } - ], - "language": "en-US", - "versionControlProvenance": [ - { - "repositoryUri": "https://github.com/zitadel/client-python.git", - "revisionId": "d9c3818c9200f2de93ec60c470826c3c23de0be9", - "branch": "main", - "properties": { - "repoUrl": "https://github.com/zitadel/client-python.git", - "lastAuthorName": "Mridang Agarwalla", - "vcsType": "Git", - "lastAuthorEmail": "mridang.agarwalla@gmail.com" - } - } - ], - "results": [ - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Parameters to 'Generic[...]' must all be type variables", - "markdown": "Parameters to 'Generic\\[...\\]' must all be type variables" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_response.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 10, - "startColumn": 38, - "charOffset": 211, - "charLength": 1, - "snippet": { - "text": "T" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 8, - "startColumn": 1, - "charOffset": 172, - "charLength": 75, - "snippet": { - "text": "\n\nclass ApiResponse(BaseModel, Generic[T]):\n \"\"\"\n API response object" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "6b64feb88e337949", - "equalIndicator/v1": "503364ca77334fd23366438c915aee4b4f2cec00548c7a4bd7bd04325475156f" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyClassHasNoInitInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "spec/auth/using_private_key_spec.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 27, - "startColumn": 7, - "charOffset": 607, - "charLength": 21, - "snippet": { - "text": "TestUsePrivateKeySpec" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 25, - "startColumn": 1, - "charOffset": 599, - "charLength": 100, - "snippet": { - "text": "\n\nclass TestUsePrivateKeySpec:\n \"\"\"\n SettingsService Integration Tests (Private Key Assertion)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "b2a72660d94b3e17", - "equalIndicator/v1": "1420519cabead261c3636fc2c4aa9bd18e0032d816ee8fe250a08fb2d51acdb5" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyClassHasNoInitInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "spec/check_session_service_spec.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 68, - "startColumn": 7, - "charOffset": 2127, - "charLength": 33, - "snippet": { - "text": "TestSessionServiceSanityCheckSpec" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 66, - "startColumn": 1, - "charOffset": 2119, - "charLength": 87, - "snippet": { - "text": "\n\nclass TestSessionServiceSanityCheckSpec:\n \"\"\"\n SessionService Integration Tests" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "97a036c836216f8a", - "equalIndicator/v1": "2f23f80ad98690a674b6e3642e4dfda054f8a3e83d6052210207f10f74251037" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyClassHasNoInitInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "spec/check_user_service_spec.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 61, - "startColumn": 7, - "charOffset": 1957, - "charLength": 30, - "snippet": { - "text": "TestUserServiceSanityCheckSpec" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 59, - "startColumn": 1, - "charOffset": 1949, - "charLength": 81, - "snippet": { - "text": "\n\nclass TestUserServiceSanityCheckSpec:\n \"\"\"\n UserService Integration Tests" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "82e3428bd3bce7e5", - "equalIndicator/v1": "bada4f69a51c51d96afbdf1fb0f45299f850f5efbc15c689950aa06cf4d90572" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyClassHasNoInitInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "spec/auth/using_client_credentials_spec.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 36, - "startColumn": 7, - "charOffset": 955, - "charLength": 28, - "snippet": { - "text": "TestUseClientCredentialsSpec" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 34, - "startColumn": 1, - "charOffset": 947, - "charLength": 104, - "snippet": { - "text": "\n\nclass TestUseClientCredentialsSpec:\n \"\"\"\n SettingsService Integration Tests (Client Credentials)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "10ee24fefc8e46d3", - "equalIndicator/v1": "cc8dfdea2993114042383be863df679d944c49048b02e582d45321cf18dac5ba" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyClassHasNoInitInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Class has no __init__ method", - "markdown": "Class has no __init__ method" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "spec/auth/using_access_token_spec.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 27, - "startColumn": 7, - "charOffset": 670, - "charLength": 22, - "snippet": { - "text": "TestUseAccessTokenSpec" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 25, - "startColumn": 1, - "charOffset": 662, - "charLength": 101, - "snippet": { - "text": "\n\nclass TestUseAccessTokenSpec:\n \"\"\"\n SettingsService Integration Tests (Personal Access Token)" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "324c1cabc3c05cd8", - "equalIndicator/v1": "de7dc6ca029dc6e9800bce25992d7e77d0033096363a199ca1d899d1555e14c5" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'debug' coverage is below the threshold 50%", - "markdown": "Method `debug` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/configuration.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 140, - "startColumn": 9, - "charOffset": 4602, - "charLength": 5, - "snippet": { - "text": "debug" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 140, - "startColumn": 1, - "charOffset": 4594, - "charLength": 41, - "snippet": { - "text": " def debug(self, value: bool) -> None:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "aaf431e80611a569", - "equalIndicator/v1": "12cac2cc31c4e908a405933ef13622f0cbe45690bf6603cf1a5e965ab4d42e14" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'parameters_to_tuples' coverage is below the threshold 50%", - "markdown": "Method `parameters_to_tuples` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 392, - "startColumn": 9, - "charOffset": 14583, - "charLength": 20, - "snippet": { - "text": "parameters_to_tuples" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 392, - "startColumn": 1, - "charOffset": 14575, - "charLength": 57, - "snippet": { - "text": " def parameters_to_tuples(params, collection_formats):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "3fbccd293197ebd7", - "equalIndicator/v1": "339719701f263d1522ba4bb4c3690bd7b370c2291c1e747700548d673168be61" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'files_parameters' coverage is below the threshold 50%", - "markdown": "Method `files_parameters` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 462, - "startColumn": 9, - "charOffset": 17623, - "charLength": 16, - "snippet": { - "text": "files_parameters" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 462, - "startColumn": 1, - "charOffset": 17615, - "charLength": 25, - "snippet": { - "text": " def files_parameters(" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "a55d885315c11433", - "equalIndicator/v1": "4ca9b6b1023f527fe88b487bab1e5e584d06185118944632b4c204933fbaa561" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'request' coverage is below the threshold 50%", - "markdown": "Method `request` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/rest.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 54, - "startColumn": 9, - "charOffset": 1947, - "charLength": 7, - "snippet": { - "text": "request" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 54, - "startColumn": 1, - "charOffset": 1939, - "charLength": 41, - "snippet": { - "text": " def request( # noqa C901 too complex" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "6273da8363ca216a", - "equalIndicator/v1": "780a974d09517fd72ef70735a744802b3b6e472b8648857c8b4f0bebfc3db5f8" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'parameters_to_url_query' coverage is below the threshold 50%", - "markdown": "Method `parameters_to_url_query` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 424, - "startColumn": 9, - "charOffset": 15973, - "charLength": 23, - "snippet": { - "text": "parameters_to_url_query" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 424, - "startColumn": 1, - "charOffset": 15965, - "charLength": 85, - "snippet": { - "text": " def parameters_to_url_query(params, collection_formats): # noqa C901 too complex" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "3c349e86f3733fcd", - "equalIndicator/v1": "7d341ceb9f5a6416c937b227a528e9922a929e56b8429f0317b95fc3e43cf830" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method 'deserialize' coverage is below the threshold 50%", - "markdown": "Method `deserialize` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 308, - "startColumn": 9, - "charOffset": 11434, - "charLength": 11, - "snippet": { - "text": "deserialize" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 308, - "startColumn": 1, - "charOffset": 11426, - "charLength": 95, - "snippet": { - "text": " def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "0107eb1cfbfb0af1", - "equalIndicator/v1": "7f14aa914c0b6d3518810c3d7d93f94f5b59470e6ce58ee603424743b71b446a" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deserialize_primitive' coverage is below the threshold 50%", - "markdown": "Method `__deserialize_primitive` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 560, - "startColumn": 9, - "charOffset": 20818, - "charLength": 23, - "snippet": { - "text": "__deserialize_primitive" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 560, - "startColumn": 1, - "charOffset": 20810, - "charLength": 45, - "snippet": { - "text": " def __deserialize_primitive(data, klass):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "7d63e9cc2282260c", - "equalIndicator/v1": "9666939c829ebb57535a11cf4577ba225b21e9ff6ab4a399d8bea313fd2f17ac" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deserialize_datetime' coverage is below the threshold 50%", - "markdown": "Method `__deserialize_datetime` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 604, - "startColumn": 9, - "charOffset": 21932, - "charLength": 22, - "snippet": { - "text": "__deserialize_datetime" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 604, - "startColumn": 1, - "charOffset": 21924, - "charLength": 39, - "snippet": { - "text": " def __deserialize_datetime(string):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "8d18cd61d054d200", - "equalIndicator/v1": "bc53829a666a09d280ddd2944fa033d0fc0e1c55729092525bf57269552705f1" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deserialize_enum' coverage is below the threshold 50%", - "markdown": "Method `__deserialize_enum` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 622, - "startColumn": 9, - "charOffset": 22451, - "charLength": 18, - "snippet": { - "text": "__deserialize_enum" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 622, - "startColumn": 1, - "charOffset": 22443, - "charLength": 40, - "snippet": { - "text": " def __deserialize_enum(data, klass):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "2775fdc79b1f7240", - "equalIndicator/v1": "e8804a3b636bd66e59e2be801a909da50cea639be229bb9d64b8b6192c4c33dd" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deserialize_date' coverage is below the threshold 50%", - "markdown": "Method `__deserialize_date` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 588, - "startColumn": 9, - "charOffset": 21480, - "charLength": 18, - "snippet": { - "text": "__deserialize_date" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 588, - "startColumn": 1, - "charOffset": 21472, - "charLength": 35, - "snippet": { - "text": " def __deserialize_date(string):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "117be42dd81c2858", - "equalIndicator/v1": "f222b921335f38913a5749d762265f55844690ce90756493b1555c05be129974" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deepcopy__' coverage is below the threshold 50%", - "markdown": "Method `__deepcopy__` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/configuration.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 84, - "startColumn": 9, - "charOffset": 2746, - "charLength": 12, - "snippet": { - "text": "__deepcopy__" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 84, - "startColumn": 1, - "charOffset": 2738, - "charLength": 57, - "snippet": { - "text": " def __deepcopy__(self, memo: Dict[int, Any]) -> Self:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "9bb266eb77e64cd5", - "equalIndicator/v1": "f8df86fd9617bceca04493f7e990fb79ce516659044882866b30b853859490e8" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyCoverageInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "Method '__deserialize_file' coverage is below the threshold 50%", - "markdown": "Method `__deserialize_file` coverage is below the threshold 50%" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 529, - "startColumn": 9, - "charOffset": 19798, - "charLength": 18, - "snippet": { - "text": "__deserialize_file" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 529, - "startColumn": 1, - "charOffset": 19790, - "charLength": 37, - "snippet": { - "text": " def __deserialize_file(response):" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "17e414c20fc331e4", - "equalIndicator/v1": "fee013031f5ce8f9d457dbd709ae1fa19abdd0a2ec1ad1bad4d943cda000ae65" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyTypeHintsInspection", - "kind": "fail", - "level": "error", - "message": { - "text": "Parameters to 'Generic[...]' must all be type variables", - "markdown": "Parameters to 'Generic\\[...\\]' must all be type variables" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/auth/oauth_authenticator.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 82, - "startColumn": 46, - "charOffset": 2930, - "charLength": 1, - "snippet": { - "text": "T" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 80, - "startColumn": 1, - "charOffset": 2847, - "charLength": 170, - "snippet": { - "text": "\n# noinspection PyTypeHintsInspection\nclass OAuthAuthenticatorBuilder(ABC, Generic[T]):\n \"\"\"\n Abstract builder class for constructing OAuth authenticator instances." - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "58a884da750c9e74", - "equalIndicator/v1": "625ceade16e07b4e394062ca46cec554ae8d80d12cdf6d799b2d4776fb3e3073" - }, - "baselineState": "unchanged", - "properties": { - "ideaSeverity": "ERROR", - "qodanaSeverity": "Critical", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnreachableCodeInspection", - "kind": "fail", - "level": "warning", - "message": { - "text": "This code is unreachable", - "markdown": "This code is unreachable" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 248, - "startColumn": 13, - "charOffset": 9003, - "charLength": 405, - "snippet": { - "text": "if not 200 <= response_data.status <= 299:\n raise ApiError(response_data.status, response_data.getheaders(), return_data)\n else:\n return ApiResponse(\n status_code=response_data.status,\n data=return_data,\n headers=response_data.getheaders(),\n raw_data=response_data.data,\n )" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 246, - "startColumn": 1, - "charOffset": 8883, - "charLength": 545, - "snippet": { - "text": " return_data = self.deserialize(response_text, response_type, content_type)\n finally:\n if not 200 <= response_data.status <= 299:\n raise ApiError(response_data.status, response_data.getheaders(), return_data)\n else:\n return ApiResponse(\n status_code=response_data.status,\n data=return_data,\n headers=response_data.getheaders(),\n raw_data=response_data.data,\n )\n\n @no_type_check" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "79df07ca20f78caa", - "equalIndicator/v1": "bb9ca6cb91a024987e7d86a8898433fbe78554ea15205b2880538c9eb36526d2" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WARNING", - "qodanaSeverity": "High", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - }, - { - "ruleId": "PyUnusedLocalInspection", - "kind": "fail", - "level": "note", - "message": { - "text": "Local variable 'response_text' value is not used", - "markdown": "Local variable 'response_text' value is not used" - }, - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "uri": "zitadel_client/api_client.py", - "uriBaseId": "SRCROOT" - }, - "region": { - "startLine": 232, - "startColumn": 9, - "charOffset": 8210, - "charLength": 13, - "snippet": { - "text": "response_text" - }, - "sourceLanguage": "Python" - }, - "contextRegion": { - "startLine": 230, - "startColumn": 1, - "charOffset": 8165, - "charLength": 105, - "snippet": { - "text": "\n # deserialize response data\n response_text = None\n return_data = None\n try:" - }, - "sourceLanguage": "Python" - } - }, - "logicalLocations": [ - { - "fullyQualifiedName": "project", - "kind": "module" - } - ] - } - ], - "partialFingerprints": { - "equalIndicator/v2": "067542ec1421c3cf", - "equalIndicator/v1": "b458de9facf89b98521ce8c3f295e386c102f6d0f4d2a5eebeb3054d06bd8692" - }, - "baselineState": "new", - "properties": { - "ideaSeverity": "WEAK WARNING", - "qodanaSeverity": "Moderate", - "problemType": "REGULAR", - "tags": [ - "Python" - ] - } - } - ], - "automationDetails": { - "id": "project/qodana/2025-05-05", - "guid": "512df014-c26a-42f2-b916-0f846fd1efec", - "properties": { - "jobUrl": "https://github.com/zitadel/client-python/actions/runs/14838768416", - "analysisKind": "regular" - } - }, - "newlineSequences": [ - "\r\n", - "\n" - ], - "properties": { - "coverage": { - "totalCoverage": 73, - "totalLines": 766, - "totalCoveredLines": 566 - }, - "configProfile": "recommended", - "deviceId": "200820300000000-4b13-f2f0-d4d1-9d562b998c1c", - "qodanaNewResultSummary": { - "moderate": 6, - "high": 13, - "total": 19 - } - } - } - ] -} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1ae196e1..c0fdbc3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,4 +21,4 @@ RUN uv sync --frozen --no-dev --all-extras COPY . . RUN uv sync --frozen --no-dev --all-extras -CMD ["uv", "run", "python"] +CMD ["uv", "run", "--no-sync", "python"] diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3255aaa8 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +# Self-contained SDK (re)generation for this client repo. +# +# make generate # regenerate from the OpenAPI spec, then prune orphans +# +# Regeneration overwrites every generator-owned file and then deletes any +# tracked file the generator no longer produces — EXCEPT the keep-list in +# .openapi-generator-ignore (bespoke auth, tests, identity, house tooling), +# which the generator skips and `prune` spares. + +GENERATOR ?= python-plus +IMAGE ?= openapi-generator-plus:enhanced +SPEC_DIR ?= ../sdk/spec +VERSION ?= v4.11.0 +NORMALIZER ?= NORMALIZER_CLASS=io.github.mridang.codegen.AdvancedOpenAPINormalizer,GARBAGE_COLLECT_COMPONENTS=1,STRIP_PARAMS=Connect-Protocol-Version|Connect-Timeout-Ms,CLEAN_EMPTY_REQUEST_BODIES=Tag,ONLY_ALLOW_JSON=1 + +REPO := $(notdir $(CURDIR)) + +.PHONY: generate prune format + +generate: + docker run --rm \ + -v "$(CURDIR):/sdk/out" \ + -v "$(abspath $(SPEC_DIR)):/sdk/spec:ro" \ + -v "$(CURDIR)/proc.yml:/sdk/proc.yml:ro" \ + --user "$$(id -u):$$(id -g)" \ + $(IMAGE) generate \ + --input-spec=/sdk/spec/client/$(VERSION)/index.json \ + --generator-name=$(GENERATOR) \ + --output=/sdk/out \ + --git-user-id=zitadel --git-repo-id=$(REPO) --git-host=github.com \ + --config=/sdk/proc.yml \ + --openapi-normalizer "$(NORMALIZER)" + @$(MAKE) --no-print-directory prune + @$(MAKE) --no-print-directory format + +prune: + @test -f .openapi-generator/FILES || { echo "prune: no FILES manifest, skipping"; exit 0; } + @tmp=$$(mktemp -d); \ + git ls-files | sort > "$$tmp/tracked"; \ + sed 's#^\./##' .openapi-generator/FILES | sort -u > "$$tmp/generated"; \ + awk 'NR==FNR { gen[tolower($$0)]=1; next } !(tolower($$0) in gen)' \ + "$$tmp/generated" "$$tmp/tracked" > "$$tmp/orphans"; \ + git -c core.excludesFile="$(CURDIR)/.openapi-generator-ignore" \ + check-ignore --no-index --stdin < "$$tmp/orphans" 2>/dev/null | sort -u > "$$tmp/keep" || true; \ + comm -23 "$$tmp/orphans" "$$tmp/keep" > "$$tmp/delete"; \ + echo "prune: deleting $$(wc -l < "$$tmp/delete" | tr -d ' ') orphaned files the generator no longer produces"; \ + xargs -r rm -f < "$$tmp/delete"; \ + rm -rf "$$tmp" + +# Format the freshly generated tree so `generate` is self-contained and a +# subsequent format-check is a no-op. Run via uv so the pinned ruff is used. +format: + # Strip the unused imports the generated model import-block emits before + # formatting, matching the generator's own formatter step. Without this a + # regenerated tree fails `make lint` (ruff F401/F811) even though the code + # is otherwise correct. + uv run ruff check --select F401,F811 --fix --exit-zero --quiet . + uv run ruff format . diff --git a/README.md b/README.md index f663ecc4..caf7f323 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Ensure you have Python 3 or higher installed. You also need Install the SDK by running one of the following commands: ```bash -pip install zitadel_client +pip install zitadel-client ``` ## Authentication Methods @@ -71,31 +71,41 @@ JSON file. This process creates a secure token. **Example:** ```python -import zitadel_client as zitadel -from zitadel_client.exceptions import ApiError +import asyncio + +from zitadel_client import Zitadel +from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator +from zitadel_client.errors import ApiException from zitadel_client.models import ( UserServiceAddHumanUserRequest, UserServiceSetHumanEmail, UserServiceSetHumanProfile, ) -zitadel = zitadel.Zitadel.with_private_key("https://example.us1.zitadel.cloud", "path/to/jwt-key.json") - -try: - request = UserServiceAddHumanUserRequest( - username="john.doe", - profile=UserServiceSetHumanProfile( - givenName="John", - familyName="Doe" - ), - email=UserServiceSetHumanEmail( - email="john@doe.com" - ), - ) - response = zitadel.users.add_human_user(request) - print("User created:", response) -except ApiError as e: - print("Error:", e) +zitadel = Zitadel.with_authenticator( + WebTokenAuthenticator.from_json("https://example.us1.zitadel.cloud", "path/to/jwt-key.json") +) + + +async def main(): + try: + request = UserServiceAddHumanUserRequest( + username="john.doe", + profile=UserServiceSetHumanProfile( + given_name="John", + family_name="Doe" + ), + email=UserServiceSetHumanEmail( + email="john@doe.com" + ), + ) + response = await zitadel.user_service.add_human_user(request) + print("User created:", response) + except ApiException as e: + print("Error:", e) + + +asyncio.run(main()) ``` #### 2. Client Credentials Grant @@ -117,31 +127,45 @@ which is then used to authenticate. **Example:** ```python -import zitadel_client as zitadel -from zitadel_client.exceptions import ApiError +import asyncio + +from zitadel_client import Zitadel +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) +from zitadel_client.errors import ApiException from zitadel_client.models import ( UserServiceAddHumanUserRequest, UserServiceSetHumanEmail, UserServiceSetHumanProfile, ) -zitadel = zitadel.Zitadel.with_client_credentials("https://example.us1.zitadel.cloud", "id", "secret") - -try: - request = UserServiceAddHumanUserRequest( - username="john.doe", - profile=UserServiceSetHumanProfile( - givenName="John", - familyName="Doe" - ), - email=UserServiceSetHumanEmail( - email="john@doe.com" - ), - ) - response = zitadel.users.add_human_user(request) - print("User created:", response) -except ApiError as e: - print("Error:", e) +zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + "https://example.us1.zitadel.cloud", "id", "secret" + ).build() +) + + +async def main(): + try: + request = UserServiceAddHumanUserRequest( + username="john.doe", + profile=UserServiceSetHumanProfile( + given_name="John", + family_name="Doe" + ), + email=UserServiceSetHumanEmail( + email="john@doe.com" + ), + ) + response = await zitadel.user_service.add_human_user(request) + print("User created:", response) + except ApiException as e: + print("Error:", e) + + +asyncio.run(main()) ``` #### 3. Personal Access Tokens (PATs) @@ -163,31 +187,43 @@ authenticate without exchanging credentials every time. **Example:** ```python -import zitadel_client as zitadel -from zitadel_client.exceptions import ApiError +import asyncio + +from zitadel_client import Zitadel +from zitadel_client.auth.personal_access_token_authenticator import ( + PersonalAccessTokenAuthenticator, +) +from zitadel_client.errors import ApiException from zitadel_client.models import ( UserServiceAddHumanUserRequest, UserServiceSetHumanEmail, UserServiceSetHumanProfile, ) -zitadel = zitadel.Zitadel.with_access_token("https://example.us1.zitadel.cloud", "token") - -try: - request = UserServiceAddHumanUserRequest( - username="john.doe", - profile=UserServiceSetHumanProfile( - givenName="John", - familyName="Doe" - ), - email=UserServiceSetHumanEmail( - email="john@doe.com" - ), - ) - response = zitadel.users.add_human_user(request) - print("User created:", response) -except ApiError as e: - print("Error:", e) +zitadel = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator("https://example.us1.zitadel.cloud", "token") +) + + +async def main(): + try: + request = UserServiceAddHumanUserRequest( + username="john.doe", + profile=UserServiceSetHumanProfile( + given_name="John", + family_name="Doe" + ), + email=UserServiceSetHumanEmail( + email="john@doe.com" + ), + ) + response = await zitadel.user_service.add_human_user(request) + print("User created:", response) + except ApiException as e: + print("Error:", e) + + +asyncio.run(main()) ``` --- @@ -208,13 +244,18 @@ disable TLS verification entirely: ```python from zitadel_client import Zitadel, TransportOptions +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) -options = TransportOptions(insecure=True) +options = TransportOptions(verify_ssl=False) -zitadel = Zitadel.with_client_credentials( - "https://your-instance.zitadel.cloud", - "client-id", - "client-secret", +zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + "https://your-instance.zitadel.cloud", + "client-id", + "client-secret", + ).build(), transport_options=options, ) ``` @@ -226,13 +267,18 @@ provide the path to the CA certificate in PEM format: ```python from zitadel_client import Zitadel, TransportOptions +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) options = TransportOptions(ca_cert_path="/path/to/ca.pem") -zitadel = Zitadel.with_client_credentials( - "https://your-instance.zitadel.cloud", - "client-id", - "client-secret", +zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + "https://your-instance.zitadel.cloud", + "client-id", + "client-secret", + ).build(), transport_options=options, ) ``` @@ -244,13 +290,18 @@ custom routing or tracing headers: ```python from zitadel_client import Zitadel, TransportOptions +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) options = TransportOptions(default_headers={"X-Custom-Header": "my-value"}) -zitadel = Zitadel.with_client_credentials( - "https://your-instance.zitadel.cloud", - "client-id", - "client-secret", +zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + "https://your-instance.zitadel.cloud", + "client-id", + "client-secret", + ).build(), transport_options=options, ) ``` @@ -263,13 +314,18 @@ directly in the URL: ```python from zitadel_client import Zitadel, TransportOptions +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) -options = TransportOptions(proxy_url="http://user:pass@proxy:8080") +options = TransportOptions(proxy="http://user:pass@proxy:8080") -zitadel = Zitadel.with_client_credentials( - "https://your-instance.zitadel.cloud", - "client-id", - "client-secret", +zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + "https://your-instance.zitadel.cloud", + "client-id", + "client-secret", + ).build(), transport_options=options, ) ``` diff --git a/SKILLS.md b/SKILLS.md new file mode 100644 index 00000000..9c3fc1fe --- /dev/null +++ b/SKILLS.md @@ -0,0 +1,143 @@ +# Zitadel SDK - AI Agent Reference + +## Installation + +```bash +pip install zitadel_client +``` + +## Quick Start + +```python +from zitadel_client.zitadel import Zitadel + +client = Zitadel.with_token("https://api.example.com", "your-token") +``` + +## Authentication + +All authentication is handled via `Authenticator` implementations passed to the client constructor. + +### Bearer Token + +```python +from zitadel_client.auth.bearer_authenticator import BearerAuthenticator + +authenticator = BearerAuthenticator("https://api.example.com", "your-token") +client = Zitadel(authenticator) +``` + +## Servers + +If the OpenAPI spec defines multiple servers, the generated `zitadel_client.servers` module exposes each as a `ServerConfiguration` (e.g., `SERVER_0`, `SERVER_1`, ...) plus an `ALL` list. Pass the desired server's URL to the client: + +```python +from zitadel_client.servers import SERVER_0 + +client = Zitadel.with_token(SERVER_0.get_url(), "your-token") +``` + +## Testing + +The `Authenticator` protocol is the seam for tests: substitute a fake authenticator that returns a known header map, and assert your code calls the API the way you expect. + +```python +from zitadel_client.auth.authenticator import Authenticator + +class FakeAuthenticator(Authenticator): + def get_host(self) -> str: + return "https://api.example.com" + + def get_auth_headers(self) -> dict[str, str]: + return {"Authorization": "Bearer test-token"} + +client = Zitadel(FakeAuthenticator()) +``` + +## Error Handling + +All API errors derive from `ApiException`. The error hierarchy is: + +- `ApiException` (base) + - `ClientException` (4xx) + - `BadRequestException` (400) + - `UnauthorizedException` (401) + - `ForbiddenException` (403) + - `NotFoundException` (404) + - `ConflictException` (409) + - `UnprocessableEntityException` (422) + - `ServerException` (5xx) + - `InternalServerErrorException` (500) + - `NetworkException` (no HTTP response, status 0) + - `NetworkTimeoutException` (the request timed out, status 0) + +```python +from zitadel_client.errors import ( + NotFoundException, + ClientException, + ServerException, + ApiException, +) + +async def main(): + try: + result = await client.action_service.activate_public_key(...) + except NotFoundException as e: + print(f"Not found: {e}") + except ClientException as e: + print(f"Client error {e.status_code}: {e}") + except ServerException as e: + print(f"Server error: {e}") + except ApiException as e: + print(f"API error: {e}") +``` + +## Configuration + +### Custom Transport Options + +```python +from zitadel_client.transport_options import TransportOptions + +transport = ( + TransportOptions.builder() + .proxy("http://proxy:3128") + .timeout(5000) + .build() +) + +client = Zitadel(authenticator, transport) +``` + +## API Methods + +Each API group is exposed as a typed attribute on the client (e.g., `client.action_service`). API classes have methods that correspond to OpenAPI operations, accepting typed request parameters and returning typed response models. + +All API methods are asynchronous; await them. + +## Models + +Models are generated as pydantic models in `zitadel_client.models`. + +```python +from zitadel_client.models.action_service_activate_public_key_request import ActionServiceActivatePublicKeyRequest + +model = ActionServiceActivatePublicKeyRequest() +``` + +## Binary / File Uploads + +File upload parameters are typed as `bytes`. Binary response bodies are returned as `bytes`. + +## Comment Style + +Never place a comment on the same line as code. Use `#` comments; `"""` docstrings are fine. + +```good +# This explains the logic +x = 1 +``` + +```bad +x = 1 # This explains the logic +``` diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..98c939b5 --- /dev/null +++ b/conftest.py @@ -0,0 +1,171 @@ +import importlib.util +import os +import time + +import pytest + +# Every dependency an emitted test imports is listed, with the test that needs +# it, in .openapi-generator/DEV-DEPENDENCIES. A client keep-lists its own +# pyproject.toml, so a dependency the generator started using is missing there +# until someone copies it across -- and the whole suite then dies at collection +# with an ImportError from whichever module happened to be imported first. +# Probing here turns that into one message that names the file to reconcile +# against. The distributions below are imported inside the fixtures rather than +# at module scope so this check runs before the failure it is reporting on. +DEV_DEPENDENCIES = ".openapi-generator/DEV-DEPENDENCIES" + +_REQUIRED_TEST_DISTRIBUTIONS = { + "docker": "docker", + "opentelemetry.sdk.trace": "opentelemetry-sdk", + "pytest_asyncio": "pytest-asyncio", + "pytest_cov": "pytest-cov", + "testcontainers": "testcontainers", +} + + +def _is_installed(module): + # find_spec imports the parent package of a dotted name, so it raises + # rather than returning None when the parent is the part that is missing. + try: + return importlib.util.find_spec(module) is not None + except (ImportError, ValueError): + return False + + +def _assert_test_dependencies_installed(): + missing = sorted( + distribution + for module, distribution in _REQUIRED_TEST_DISTRIBUTIONS.items() + if not _is_installed(module) + ) + if missing: + raise RuntimeError( + "Missing test dependencies: " + + ", ".join(missing) + + ". Every dependency the generated tests import is listed in " + + DEV_DEPENDENCIES + + "; add the missing entries to this project's dependency manifest " + "and reinstall." + ) + + +_assert_test_dependencies_installed() + + +@pytest.fixture(scope="session") +def chasm_container(proxy_network): + from testcontainers.core.container import DockerContainer + from testcontainers.core.wait_strategies import LogMessageWaitStrategy + + host_app_path = os.environ.get("HOST_APP_PATH", os.getcwd()) + spec_path = os.path.join(host_app_path, "test", "fixtures", "openapi.yaml") + cert_path = os.path.join(host_app_path, "test", "fixtures", "certs", "server.pem") + key_path = os.path.join( + host_app_path, "test", "fixtures", "certs", "server-key.pem" + ) + + container = ( + DockerContainer("mridang/chasm:1.3.0") + .with_exposed_ports(4010, 8443) + .with_volume_mapping(spec_path, "/tmp/openapi.yaml", "ro") + .with_volume_mapping(cert_path, "/certs/cert.pem", "ro") + .with_volume_mapping(key_path, "/certs/key.pem", "ro") + .with_command( + "mock /tmp/openapi.yaml --host 0.0.0.0 " + "--tls-cert /certs/cert.pem --tls-key /certs/key.pem --tls-port 8443" + ) + .waiting_for(LogMessageWaitStrategy("Listening on")) + ) + container.start() + proxy_network.connect(container.get_wrapped_container().id, aliases=["chasm"]) + yield container + container.stop() + + +@pytest.fixture(scope="session") +def api_base_url(chasm_container): + host = chasm_container.get_container_host_ip() + port = chasm_container.get_exposed_port(4010) + return f"http://{host}:{port}" + + +@pytest.fixture(scope="session") +def chasm_http_url(chasm_container): + host = chasm_container.get_container_host_ip() + port = chasm_container.get_exposed_port(4010) + return f"http://{host}:{port}" + + +@pytest.fixture(scope="session") +def chasm_https_url(chasm_container): + host = chasm_container.get_container_host_ip() + port = chasm_container.get_exposed_port(8443) + return f"https://{host}:{port}" + + +@pytest.fixture(scope="session") +def chasm_internal_http_url(): + return "http://chasm:4010" + + +@pytest.fixture(scope="session") +def chasm_internal_https_url(): + return "https://chasm:8443" + + +@pytest.fixture(scope="session") +def proxy_network(): + import docker + + client = docker.from_env() + network = client.networks.create("proxy-test-network") + yield network + network.remove() + + +@pytest.fixture(scope="session") +def squid_container(proxy_network): + from testcontainers.core.container import DockerContainer + + host_app_path = os.environ.get("HOST_APP_PATH", os.getcwd()) + squid_conf_path = os.path.join( + host_app_path, "test", "fixtures", "proxy", "squid.conf" + ) + + # ubuntu/squid declares VOLUME /var/log/squid and VOLUME /var/spool/squid, + # so every proxy container Docker creates leaves two anonymous volumes + # behind after the suite stops it. Mounting both as tmpfs keeps the + # container writable without allocating a volume. mode=1777 because squid + # drops to the unprivileged `proxy` user before it opens its logs. + container = ( + DockerContainer("ubuntu/squid:6.10-24.10_beta") + .with_exposed_ports(3128, 3129) + .with_volume_mapping(squid_conf_path, "/etc/squid/squid.conf", "ro") + .with_tmpfs_mount("/var/log/squid", "rw,mode=1777") + .with_tmpfs_mount("/var/spool/squid", "rw,mode=1777") + ) + container.start() + proxy_network.connect(container.get_wrapped_container().id) + time.sleep(3) + yield container + container.stop() + + +@pytest.fixture(scope="session") +def proxy_url(squid_container): + host = squid_container.get_container_host_ip() + port = squid_container.get_exposed_port(3128) + return f"http://{host}:{port}" + + +@pytest.fixture(scope="session") +def proxy_auth_host_port(squid_container): + """host:port of the fixture proxy port that requires Basic credentials.""" + host = squid_container.get_container_host_ip() + port = squid_container.get_exposed_port(3129) + return f"{host}:{port}" + + +@pytest.fixture(scope="session") +def ca_cert_path(): + return os.path.join(os.getcwd(), "test", "fixtures", "certs", "ca.pem") diff --git a/devbox.json b/devbox.json index 3147a50f..f7247e16 100644 --- a/devbox.json +++ b/devbox.json @@ -2,15 +2,14 @@ "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.7/.schema/devbox.schema.json", "packages": [ "uv@latest", - "lefthook@latest", - "python310@latest" + "python313@latest", + "github:mridang/nixpkgs#qodana" ], "env": { "UV_CACHE_DIR": "$PWD/.uv" }, "shell": { "init_hook": [ - "lefthook install", "uv sync --all-extras --group dev" ], "scripts": { @@ -22,7 +21,7 @@ ], "check": [ "uv run ruff check .", - "uv run ty check" + "uv run mypy zitadel_client test spec" ], "replit": [ "docker build --tag python-repl --file Dockerfile .", diff --git a/devbox.lock b/devbox.lock index b31f2840..5ae76f24 100644 --- a/devbox.lock +++ b/devbox.lock @@ -1,108 +1,60 @@ { "lockfile_version": "1", "packages": { - "lefthook@latest": { - "last_modified": "2025-12-09T08:49:39Z", - "resolved": "github:NixOS/nixpkgs/677fbe97984e7af3175b6c121f3c39ee5c8d62c9#lefthook", - "source": "devbox-search", - "version": "2.0.7", - "systems": { - "aarch64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/7abrixpmc3jy90ckm090qlvw04038h2g-lefthook-2.0.7", - "default": true - } - ], - "store_path": "/nix/store/7abrixpmc3jy90ckm090qlvw04038h2g-lefthook-2.0.7" - }, - "aarch64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/sighx46zkcvc6mhv2pb55yic2aqmzjig-lefthook-2.0.7", - "default": true - } - ], - "store_path": "/nix/store/sighx46zkcvc6mhv2pb55yic2aqmzjig-lefthook-2.0.7" - }, - "x86_64-darwin": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/0y2ni7hvwx5rsqhnh4j57imb8lcy03gm-lefthook-2.0.7", - "default": true - } - ], - "store_path": "/nix/store/0y2ni7hvwx5rsqhnh4j57imb8lcy03gm-lefthook-2.0.7" - }, - "x86_64-linux": { - "outputs": [ - { - "name": "out", - "path": "/nix/store/f1sn8v6nbhfxc7c33lxh4xyhzah0b30d-lefthook-2.0.7", - "default": true - } - ], - "store_path": "/nix/store/f1sn8v6nbhfxc7c33lxh4xyhzah0b30d-lefthook-2.0.7" - } - } - }, - "python310@latest": { - "last_modified": "2025-11-23T21:50:36Z", + "python313@latest": { + "last_modified": "2025-05-16T20:19:48Z", "plugin_version": "0.0.3", - "resolved": "github:NixOS/nixpkgs/ee09932cedcef15aaf476f9343d1dea2cb77e261#python310", + "resolved": "github:NixOS/nixpkgs/12a55407652e04dcf2309436eb06fef0d3713ef3#python313", "source": "devbox-search", - "version": "3.10.19", + "version": "3.13.3", "systems": { "aarch64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/db2rr68gyw519rmh4zvv28r8p9sxaa7a-python3-3.10.19", + "path": "/nix/store/1a8xg8l3m67hxinxzzcsak9736qm9vsf-python3-3.13.3", "default": true } ], - "store_path": "/nix/store/db2rr68gyw519rmh4zvv28r8p9sxaa7a-python3-3.10.19" + "store_path": "/nix/store/1a8xg8l3m67hxinxzzcsak9736qm9vsf-python3-3.13.3" }, "aarch64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/9sa0k69qycnas1x1zlcc6dihfzfhicz5-python3-3.10.19", + "path": "/nix/store/yy0xvc2rydhrs0h1v8d7r3sql347xzz5-python3-3.13.3", "default": true }, { "name": "debug", - "path": "/nix/store/7ymfhc5502s1d64lv72yh4zpaaph5p4a-python3-3.10.19-debug" + "path": "/nix/store/42bxfqfrh8cwspl7szr0cw8739xv8qlq-python3-3.13.3-debug" } ], - "store_path": "/nix/store/9sa0k69qycnas1x1zlcc6dihfzfhicz5-python3-3.10.19" + "store_path": "/nix/store/yy0xvc2rydhrs0h1v8d7r3sql347xzz5-python3-3.13.3" }, "x86_64-darwin": { "outputs": [ { "name": "out", - "path": "/nix/store/pwvfcg4v8jzxykkysiw03xvsymi612ni-python3-3.10.19", + "path": "/nix/store/gbrigjhghz9v2p0zf9b2fnvs0g0yx7q4-python3-3.13.3", "default": true } ], - "store_path": "/nix/store/pwvfcg4v8jzxykkysiw03xvsymi612ni-python3-3.10.19" + "store_path": "/nix/store/gbrigjhghz9v2p0zf9b2fnvs0g0yx7q4-python3-3.13.3" }, "x86_64-linux": { "outputs": [ { "name": "out", - "path": "/nix/store/y497kak0610kfdvswb0pjiaf5yq4d8zk-python3-3.10.19", + "path": "/nix/store/2mab9iiwhcqwk75qwvp3zv0bvbiaq6cs-python3-3.13.3", "default": true }, { "name": "debug", - "path": "/nix/store/35g79gg5z6gqd8w0q1fvqkxaxvvxp3d2-python3-3.10.19-debug" + "path": "/nix/store/9z6k8ijl2md0y2n95yprbjj4vxbfsi15-python3-3.13.3-debug" } ], - "store_path": "/nix/store/y497kak0610kfdvswb0pjiaf5yq4d8zk-python3-3.10.19" + "store_path": "/nix/store/2mab9iiwhcqwk75qwvp3zv0bvbiaq6cs-python3-3.13.3" } } }, diff --git a/etc/docker-compose.yaml b/etc/docker-compose.yaml index de7731a3..e6aefeb4 100644 --- a/etc/docker-compose.yaml +++ b/etc/docker-compose.yaml @@ -1,3 +1,4 @@ +name: zitadel-python services: db: image: postgres:17-alpine @@ -69,7 +70,7 @@ services: - './example-zitadel-secrets.yaml:/example-zitadel-secrets.yaml:ro' - './zitadel_output:/var/zitadel_output:rw' ports: - - "8099:8080" + - "8080" healthcheck: test: [ "CMD", "/app/zitadel", "ready", diff --git a/proc.yml b/proc.yml new file mode 100644 index 00000000..619b22fc --- /dev/null +++ b/proc.yml @@ -0,0 +1,10 @@ +generatorName: python-plus +clientClassName: Zitadel +repoName: git@github.com:zitadel/client-python.git +disallowAdditionalPropertiesIfNotPresent: false +generateUnitTests: true +packageName: zitadel_client +projectName: zitadel-client +packageVersion: 0.0.1 +licenseId: Apache-2.0 +errorPrefix: Zitadel diff --git a/pyproject.toml b/pyproject.toml index d7d0c7ab..b688a12d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,45 +1,36 @@ [project] -name = "zitadel_client" -description = "Official Zitadel SDK for Python. Authenticate and access Zitadel's authentication and management APIs in Python." -license = { text = "Apache-2.0" } -readme = "README.md" -requires-python = ">=3.10" -authors = [ - { name = "Mridang Agarwalla", email = "mridang@zitadel.com" } -] -version = "4.1.9" -keywords = ["sdk", "iam", "client-lib", "client-library", "sdk-python", "zitadel", "zitadel-sdk"] -classifiers = [ - "Topic :: Software Development :: Libraries" -] +name = "zitadel-client" +version = "0.0.1" +description = "The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform." +license = "Apache-2.0" +requires-python = ">=3.13" dependencies = [ - "urllib3>=1.25.3,<3.0.0", - "python-dateutil>=2.8.2", - "pydantic>=2", - "typing-extensions>=4.7.1", - "authlib>=1.3.2,<2.0.0", - "requests>=2.32.4,<3.0.0", + "urllib3>=2.1.0,<3.0.0", + "python_dateutil>=2.8.2", + "isodate>=0.6.1", + "pydantic[email]>=2,<3", + "brotli>=1.0.0", + "zstandard>=0.19.0", + "PyJWT[crypto]>=2.0.0", ] -[project.urls] -homepage = "https://zitadel.com/" -repository = "https://github.com/zitadel/client-python" -documentation = "https://github.com/zitadel/client-python" -"Bug Tracker" = "https://github.com/zitadel/client-python/issues" - [dependency-groups] dev = [ - "cryptography>=46.0.6,<51.0.0", - "pytest>=7.2.1", - "pytest-cov>=2.8.1", - "tox>=3.9.0", - "types-python-dateutil>=2.8.19.14", - "testcontainers>=4.14.0,<5.0.0", - "python-dotenv==1.2.2", - "ruff>=0.12.4", - "sphinx==7.4.7", - "fawltydeps==0.19.0", - "ty>=0.0.4", + "pytest>=7.0.0", + "pytest-asyncio>=0.21.0", + "mypy>=1,<3", + "ruff>=0.15,<0.16", + "types-python-dateutil>=2.8.0", + "types-requests>=2.28.0", + "types-urllib3>=1.26.0", + "pytest-cov>=4.0.0", + "opentelemetry-sdk>=1.20.0", + "sphinx>=7,<10", + "furo>=2024.1.29", + "cryptography>=46.0.6,<51.0.0", + "testcontainers>=4.14.0,<5.0.0", + "python-dotenv>=1.2.2", + "fawltydeps>=0.20,<0.21", ] [build-system] @@ -52,62 +43,54 @@ include = ["zitadel_client*"] [tool.setuptools.package-data] zitadel_client = ["py.typed"] -[tool.setuptools] -include-package-data = true +[tool.ruff.lint.per-file-ignores] +# Two schemas that reference each other (A has a B, B has an A) generate two +# modules that import each other, so the model imports have to follow the +# class definition or the cycle fails at import time. +"zitadel_client/models/*.py" = ["E402"] +# The typed subclasses import the root exception from this module, so their +# re-export can only follow the class definition. +"zitadel_client/errors/__init__.py" = ["E402"] -[tool.tox] -envlist = ["py310", "py311", "py312"] +[tool.fawltydeps] +# FawltyDeps maps imports to declared deps statically; the entries below are +# the cases that mapping cannot see, so they are declared here rather than +# silenced inline. +ignore_unused = [ + # Tooling and stub-only deps that are run/consumed, never imported. + "fawltydeps", + "mypy", + "ruff", + "pytest-cov", + "pytest-asyncio", + "sphinx", + "furo", + "types-python-dateutil", + "types-requests", + "types-urllib3", + # Declared runtime deps used dynamically or behind optional shims, so no + # static import is visible (isodate date parsing, brotli/zstandard codec + # fallbacks selected at runtime). + "isodate", + "brotli", + "zstandard", +] +ignore_undeclared = [ + # Pulled in by testcontainers for the integration suite (conftest.py). + "docker", + # Optional tracing integration imported behind a try/except shim. + "opentelemetry", +] [tool.pytest.ini_options] cache_dir = ".pytest" testpaths = ["test", "spec"] python_files = "test_*.py *_spec.py" -addopts = [ - "--cov=zitadel_client", - "--cov-report=html:build/coverage/html", - "--cov-report=xml:build/coverage/clover.xml", - "--cov-report=term", -] -junit_family = "legacy" - -[tool.coverage.run] -data_file = "build/coverage/.coverage" -omit = [ - "zitadel_client/api/*", - "zitadel_client/models/*" -] - -[tool.ruff] -cache-dir = ".ruff" -line-length = 130 -fix = true -target-version = "py310" -exclude = [ - "zitadel_client/api/*", - "zitadel_client/models/*" -] - -[tool.ruff.lint] -select = ["E", "F", "I", "B", "C", "N", "Q", "S", "T"] -extend-select = ["A"] -ignore = ["S101"] # Ignore assert statements - -[tool.fawltydeps] -ignore_unused = [ - "fawltydeps", - "pytest-cov", - "ruff", - "sphinx", - "tox", - "requests", - "ty" -] - -[tool.ty.environment] -python-version = "3.10" -root = ["."] +asyncio_mode = "auto" +addopts = "--cov=zitadel_client --cov-report=xml:.out/coverage.xml --cov-report=term-missing --junitxml=.out/reports/junit.xml" -[tool.ty.src] -respect-ignore-files = true -include = ["zitadel_client"] -exclude = ["zitadel_client/api/**", "zitadel_client/models/**"] +# brotli and testcontainers ship no type information, so mypy cannot follow +# them. Named here rather than silenced with an inline comment at each import. +[[tool.mypy.overrides]] +module = ["brotli", "testcontainers.*"] +ignore_missing_imports = true diff --git a/qodana.yaml b/qodana.yaml index 3a0a82e4..9a76293c 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -8,5 +8,51 @@ exclude: paths: - zitadel_client/api - zitadel_client/models + # Test code legitimately uses fixture/helper classes without __init__, + # descriptive non-PEP8 method names, and reaches into protected members + # to assert internals. Those IDE inspections are not meaningful on tests. + - test + - spec + - conftest.py + # IntelliJ-only structural nags that ruff/mypy (the SDK's actual linters) do + # not flag and that are valid on generated code: + # - utility/config classes (HeaderSelector, ValueSerializer, Configuration, + # TransportOptions, ApiResponse, ...) intentionally have no __init__. + - name: PyClassHasNoInitInspection + # - helper methods that do not reference self are fine; making them + # @staticmethod is a style preference, not a correctness fix. + - name: PyMethodMayBeStaticInspection + # - HttpAwareAuthenticator is an intentional intermediate abstract base whose + # concrete subclasses implement the abstract methods. + - name: PyAbstractClassInspection + # - some generated method parameters are part of the uniform public signature + # contract even when a given serialization path does not read them. + - name: PyUnusedLocalInspection + # - cross-method structural duplication is inherent to generated code. + - name: DuplicatedCode + # Qodana's type-hint inspection misreports valid generic code: it rejects + # `Generic[T]` / `cast(Optional[T], ...)` where `T` is a module-level + # TypeVar (api_result.py, oauth_authenticator.py, object_serializer.py). + # These are correct, mypy-clean type hints, so the reports are false + # positives. + - name: PyTypeHintsInspection + # "Password in URL" fires on a documentation comment that spells out a + # `http://user:pass@host` example to explain urllib3 proxy-auth behaviour + # (default_api_client.py). It is not a real credential. + - name: HardcodedPasswords + # Qodana 2026.1's unused-imports inspection misflags the optional-dependency + # idiom in default_api_client.py: `brotli`/`zstandard` are imported inside a + # `try/except ImportError` and captured into module-level `_brotli`/`_zstandard` + # sentinels (pre-initialised to None above the try). The inspection demands the + # name also be bound in the except branch, which is unnecessary here. The + # imports are used, so the report is a false positive. + - name: PyUnusedImportsInspection + paths: + - zitadel_client/default_api_client.py + # Code coverage is not a metric we gate on, and the bulk of the SDK is + # generated code that is untested by design. Qodana does not support + # path-scoped coverage exclusion (only full-inspection / .NET attribute + # excludes), so the coverage inspection is disabled outright. + - name: PyCoverageInspection -linter: jetbrains/qodana-python:2025.1 +linter: jetbrains/qodana-python:2026.1 diff --git a/spec/auth/using_access_token_spec.py b/spec/auth/using_access_token_spec.py index 16fc37f1..69238e26 100644 --- a/spec/auth/using_access_token_spec.py +++ b/spec/auth/using_access_token_spec.py @@ -2,9 +2,12 @@ import pytest -import zitadel_client as zitadel from spec.base_spec import docker_compose as docker_compose -from zitadel_client.exceptions import ZitadelError +from zitadel_client.auth.personal_access_token_authenticator import ( + PersonalAccessTokenAuthenticator, +) +from zitadel_client.errors.unauthorized_exception import UnauthorizedException +from zitadel_client.zitadel import Zitadel class TestUseAccessTokenSpec: @@ -15,24 +18,33 @@ class TestUseAccessTokenSpec: endpoint works when authenticating via a Personal Access Token: 1. Retrieve general settings successfully with a valid token - 2. Expect an ApiException when using an invalid token + 2. Expect an UnauthorizedException when using an invalid token Each test instantiates a new client to ensure a clean, stateless call. """ - def test_retrieves_general_settings_with_valid_token(self, docker_compose: Dict[str, str]) -> None: # noqa F811 + async def test_retrieves_general_settings_with_valid_token( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 """Retrieves general settings successfully with a valid access token.""" - client = zitadel.Zitadel.with_access_token( - docker_compose["base_url"], - docker_compose["auth_token"], + client = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator( + docker_compose["base_url"], + docker_compose["auth_token"], + ) ) - client.settings.get_general_settings() - - def test_raises_api_exception_with_invalid_token(self, docker_compose: Dict[str, str]) -> None: # noqa F811 - """Raises ApiException when using an invalid access token.""" - client = zitadel.Zitadel.with_access_token( - docker_compose["base_url"], - "invalid", + await client.settings_service.get_general_settings({}) + + async def test_raises_api_exception_with_invalid_token( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 + """Raises UnauthorizedException when using an invalid access token.""" + client = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator( + docker_compose["base_url"], + "invalid", + ) ) - with pytest.raises(ZitadelError): - client.settings.get_general_settings() + with pytest.raises(UnauthorizedException) as excinfo: + await client.settings_service.get_general_settings({}) + assert type(excinfo.value) is UnauthorizedException diff --git a/spec/auth/using_client_credentials_spec.py b/spec/auth/using_client_credentials_spec.py index 012ebd79..ccdc07a1 100644 --- a/spec/auth/using_client_credentials_spec.py +++ b/spec/auth/using_client_credentials_spec.py @@ -4,9 +4,12 @@ import pytest import urllib3 -import zitadel_client as zitadel from spec.base_spec import docker_compose as docker_compose -from zitadel_client.exceptions import ZitadelError +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) +from zitadel_client.errors.oauth2_server_exception import OAuth2ServerException +from zitadel_client.zitadel import Zitadel class TestUseClientCredentialsSpec: @@ -17,26 +20,32 @@ class TestUseClientCredentialsSpec: endpoint works when authenticating via Client Credentials: 1. Retrieve general settings successfully with valid credentials - 2. Expect an ApiException when using invalid credentials + 2. Expect an OAuth2ServerException when using invalid credentials Each test instantiates a new client to ensure a clean, stateless call. """ @staticmethod - def generate_user_secret(token: str, login_name: str = "api-user") -> Dict[str, str]: + def generate_user_secret( + token: str, base_url: str, login_name: str = "api-user" + ) -> Dict[str, str]: http = urllib3.PoolManager() user_id_response = http.request( "GET", - "http://localhost:8099/management/v1/global/users/_by_login_name", + f"{base_url}/management/v1/global/users/_by_login_name", fields={"loginName": login_name}, headers={"Authorization": f"Bearer {token}", "Accept": "application/json"}, ) if user_id_response.status < 400: - user_response_map: Dict[str, Any] = json.loads(user_id_response.data.decode("utf-8")) + user_response_map: Dict[str, Any] = json.loads( + user_id_response.data.decode("utf-8") + ) user_payload: Any = user_response_map.get("user") - user_id: Any = user_payload.get("id") if isinstance(user_payload, dict) else None + user_id: Any = ( + user_payload.get("id") if isinstance(user_payload, dict) else None + ) if isinstance(user_id, str) and user_id: put_headers = { @@ -47,45 +56,74 @@ def generate_user_secret(token: str, login_name: str = "api-user") -> Dict[str, encoded_body = json.dumps({}).encode("utf-8") secret_response = http.request( - "PUT", f"http://localhost:8099/management/v1/users/{user_id}/secret", headers=put_headers, body=encoded_body + "PUT", + f"{base_url}/management/v1/users/{user_id}/secret", + headers=put_headers, + body=encoded_body, ) if secret_response.status < 400: - secret_data: Dict[str, Any] = json.loads(secret_response.data.decode("utf-8")) + secret_data: Dict[str, Any] = json.loads( + secret_response.data.decode("utf-8") + ) client_id: Any = secret_data.get("clientId") client_secret: Any = secret_data.get("clientSecret") - if isinstance(client_id, str) and client_id and isinstance(client_secret, str) and client_secret: + if ( + isinstance(client_id, str) + and client_id + and isinstance(client_secret, str) + and client_secret + ): return {"client_id": client_id, "client_secret": client_secret} else: print(secret_data) # noqa T201 - raise ValueError("API response for secret is missing 'clientId' or 'clientSecret'.") + raise ValueError( + "API response for secret is missing 'clientId' or 'clientSecret'." + ) else: error_body = secret_response.data.decode("utf-8") - raise Exception(f"API call to generate secret failed for user ID: '{user_id}'. Response: {error_body}") + raise Exception( + f"API call to generate secret failed for user ID: '{user_id}'. Response: {error_body}" + ) else: print(user_response_map) # noqa T201 - raise ValueError(f"Could not parse a valid user ID from API response for login name: '{login_name}'.") + raise ValueError( + f"Could not parse a valid user ID from API response for login name: '{login_name}'." + ) else: error_body = user_id_response.data.decode("utf-8") - raise Exception(f"API call to retrieve user failed for login name: '{login_name}'. Response: {error_body}") + raise Exception( + f"API call to retrieve user failed for login name: '{login_name}'. Response: {error_body}" + ) - def test_retrieves_general_settings_with_valid_client_credentials(self, docker_compose: Dict[str, str]) -> None: # noqa F811 + async def test_retrieves_general_settings_with_valid_client_credentials( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 """Retrieves general settings successfully with valid client credentials.""" - credentials = self.generate_user_secret(docker_compose["auth_token"]) - client = zitadel.Zitadel.with_client_credentials( - docker_compose["base_url"], - credentials["client_id"], - credentials["client_secret"], + credentials = self.generate_user_secret( + docker_compose["auth_token"], docker_compose["base_url"] + ) + client = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + docker_compose["base_url"], + credentials["client_id"], + credentials["client_secret"], + ).build() ) - client.settings.get_general_settings() - - def test_raises_api_exception_with_invalid_client_credentials(self, docker_compose: Dict[str, str]) -> None: # noqa F811 - """Raises ApiException when using invalid client credentials.""" - client = zitadel.Zitadel.with_client_credentials( - docker_compose["base_url"], - "invalid", - "invalid", + await client.settings_service.get_general_settings({}) + + async def test_raises_api_exception_with_invalid_client_credentials( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 + """Raises OAuth2ServerException when using invalid client credentials.""" + client = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + docker_compose["base_url"], + "invalid", + "invalid", + ).build() ) - with pytest.raises(ZitadelError): - client.settings.get_general_settings() + with pytest.raises(OAuth2ServerException) as excinfo: + await client.settings_service.get_general_settings({}) + assert type(excinfo.value) is OAuth2ServerException diff --git a/spec/auth/using_private_key_spec.py b/spec/auth/using_private_key_spec.py index 2915d4fc..be0a2ecb 100644 --- a/spec/auth/using_private_key_spec.py +++ b/spec/auth/using_private_key_spec.py @@ -1,10 +1,17 @@ from typing import Dict import pytest +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives.serialization import ( + Encoding, + NoEncryption, + PrivateFormat, +) -import zitadel_client as zitadel from spec.base_spec import docker_compose as docker_compose -from zitadel_client import ZitadelError +from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator +from zitadel_client.errors.oauth2_server_exception import OAuth2ServerException +from zitadel_client.zitadel import Zitadel class TestUsePrivateKeySpec: @@ -15,24 +22,38 @@ class TestUsePrivateKeySpec: endpoint works when authenticating via a private key assertion: 1. Retrieve general settings successfully with a valid private key - 2. Expect an ApiException when using an invalid private key path + 2. Expect an OAuth2ServerException when signing with an unknown key Each test instantiates a new client to ensure a clean, stateless call. """ - def test_retrieves_general_settings_with_valid_private_key(self, docker_compose: Dict[str, str]) -> None: # noqa F811 + async def test_retrieves_general_settings_with_valid_private_key( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 """Retrieves general settings successfully with a valid private key.""" - client = zitadel.Zitadel.with_private_key( - docker_compose["base_url"], - docker_compose["jwt_key"], + client = Zitadel.with_authenticator( + WebTokenAuthenticator.from_json( + docker_compose["base_url"], + docker_compose["jwt_key"], + ) ) - client.settings.get_general_settings() - - def test_raises_api_exception_with_invalid_private_key(self, docker_compose: Dict[str, str]) -> None: # noqa F811 - """Raises ApiException when using an invalid private key path.""" - client = zitadel.Zitadel.with_private_key( - "https://zitadel.cloud", - docker_compose["jwt_key"], + await client.settings_service.get_general_settings({}) + + async def test_raises_api_exception_with_invalid_private_key( + self, docker_compose: Dict[str, str] + ) -> None: # noqa F811 + """Raises OAuth2ServerException when signing with a key the instance does not know.""" + key = rsa.generate_private_key(public_exponent=65537, key_size=2048) + pem = key.private_bytes( + encoding=Encoding.PEM, + format=PrivateFormat.PKCS8, + encryption_algorithm=NoEncryption(), + ).decode("utf-8") + client = Zitadel.with_authenticator( + WebTokenAuthenticator.builder(docker_compose["base_url"], "invalid", pem) + .key_id("invalid") + .build() ) - with pytest.raises(ZitadelError): - client.settings.get_general_settings() + with pytest.raises(OAuth2ServerException) as excinfo: + await client.settings_service.get_general_settings({}) + assert type(excinfo.value) is OAuth2ServerException diff --git a/spec/base_spec.py b/spec/base_spec.py index ac876b09..a7753540 100644 --- a/spec/base_spec.py +++ b/spec/base_spec.py @@ -8,7 +8,9 @@ import pytest LOGGER = logging.getLogger(__name__) -COMPOSE_FILE_PATH: str = os.path.join(os.path.dirname(__file__), "..", "etc", "docker-compose.yaml") +COMPOSE_FILE_PATH: str = os.path.join( + os.path.dirname(__file__), "..", "etc", "docker-compose.yaml" +) COMPOSE_FILE_DIR: str = os.path.dirname(COMPOSE_FILE_PATH) @@ -65,7 +67,27 @@ def docker_compose() -> Generator[Dict[str, str], None, None]: jwt_key = jwt_key_path LOGGER.info(f"Loaded JWT_KEY path: {jwt_key}") - base_url: str = "http://localhost:8099" + port_command: list[str] = [ + "docker", + "compose", + "--file", + shlex.quote(COMPOSE_FILE_PATH), + "port", + "zitadel", + "8080", + ] + port_result = subprocess.run( # noqa: S603 + port_command, capture_output=True, text=True + ) + if port_result.returncode != 0 or not port_result.stdout.strip(): + port_error: str = ( + f"Failed to discover mapped port for zitadel:8080. " + f"Exit code: {port_result.returncode}\n{port_result.stderr}" + ) + raise RuntimeError(port_error) + + host_port: str = port_result.stdout.strip().rsplit(":", 1)[-1] + base_url: str = f"http://localhost:{host_port}" LOGGER.info(f"Exposed BASE_URL: {base_url}") time.sleep(20) @@ -77,11 +99,20 @@ def docker_compose() -> Generator[Dict[str, str], None, None]: } LOGGER.info("Tearing down Docker Compose stack...") - command = ["docker", "compose", "--file", shlex.quote(COMPOSE_FILE_PATH), "down", "-v"] + command = [ + "docker", + "compose", + "--file", + shlex.quote(COMPOSE_FILE_PATH), + "down", + "-v", + ] result = subprocess.run(command, capture_output=True, text=True) # noqa: S603 LOGGER.info(result.stdout) if result.returncode != 0: - LOGGER.warning(f"Failed to tear down Docker Compose stack. Exit code: {result.returncode}\n{result.stderr}") + LOGGER.warning( + f"Failed to tear down Docker Compose stack. Exit code: {result.returncode}\n{result.stderr}" + ) else: LOGGER.info("Docker Compose stack torn down.") diff --git a/spec/check_session_service_spec.py b/spec/check_session_service_spec.py index 829cc454..bd790e4f 100644 --- a/spec/check_session_service_spec.py +++ b/spec/check_session_service_spec.py @@ -1,11 +1,14 @@ import uuid -from typing import Dict, Generator +from datetime import timedelta +from typing import AsyncGenerator, Dict import pytest -import zitadel_client as zitadel from spec.base_spec import docker_compose as docker_compose -from zitadel_client.exceptions import ApiError +from zitadel_client.auth.personal_access_token_authenticator import ( + PersonalAccessTokenAuthenticator, +) +from zitadel_client.errors import ApiException from zitadel_client.models import ( SessionServiceChecks, SessionServiceCheckUser, @@ -20,18 +23,23 @@ UserServiceSetHumanEmail, UserServiceSetHumanProfile, ) +from zitadel_client.zitadel import Zitadel @pytest.fixture(scope="module") -def client(docker_compose: Dict[str, str]) -> zitadel.Zitadel: # noqa F811 +def client(docker_compose: Dict[str, str]) -> Zitadel: # noqa F811 """Provides a Zitadel client configured with a personal access token.""" base_url = docker_compose["base_url"] auth_token = docker_compose["auth_token"] - return zitadel.Zitadel.with_access_token(base_url, auth_token) + return Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator(base_url, auth_token) + ) @pytest.fixture -def session(client: zitadel.Zitadel) -> Generator[SessionServiceCreateSessionResponse, None, None]: +async def session( + client: Zitadel, +) -> AsyncGenerator[SessionServiceCreateSessionResponse, None]: """Creates a fresh session for each test and cleans up afterward.""" username = uuid.uuid4().hex request1 = UserServiceAddHumanUserRequest( @@ -39,23 +47,23 @@ def session(client: zitadel.Zitadel) -> Generator[SessionServiceCreateSessionRes profile=UserServiceSetHumanProfile(given_name="John", family_name="Doe"), # type: ignore[call-arg] email=UserServiceSetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@example.com"), ) - client.users.add_human_user(request1) + await client.user_service.add_human_user(request1) request = SessionServiceCreateSessionRequest( checks=SessionServiceChecks(user=SessionServiceCheckUser(loginName=username)), - lifetime="18000s", + lifetime=timedelta(seconds=18000), ) - response = client.sessions.create_session(request) + response = await client.session_service.create_session(request) yield response # Teardown delete_body = SessionServiceDeleteSessionRequest( sessionId=response.session_id if response.session_id is not None else "", ) try: - client.sessions.delete_session( + await client.session_service.delete_session( delete_body, ) - except ApiError: + except ApiException: pass @@ -76,49 +84,54 @@ class TestSessionServiceSanityCheckSpec: deleted after the test to ensure a clean state. """ - def test_retrieves_session_details_by_id( + async def test_retrieves_session_details_by_id( self, - client: zitadel.Zitadel, + client: Zitadel, session: SessionServiceCreateSessionResponse, ) -> None: """Retrieves the session details by ID.""" - request = SessionServiceGetSessionRequest(sessionId=session.session_id if session.session_id is not None else "") - response: SessionServiceGetSessionResponse = client.sessions.get_session(request) + request = SessionServiceGetSessionRequest( + sessionId=session.session_id if session.session_id is not None else "" + ) + response: SessionServiceGetSessionResponse = ( + await client.session_service.get_session(request) + ) assert response.session is not None assert response.session.id == session.session_id - def test_includes_created_session_when_listing( + async def test_includes_created_session_when_listing( self, - client: zitadel.Zitadel, + client: Zitadel, session: SessionServiceCreateSessionResponse, ) -> None: """Includes the created session when listing all sessions.""" request = SessionServiceListSessionsRequest(queries=[]) - response = client.sessions.list_sessions(request) + response = await client.session_service.list_sessions(request) assert response.sessions is not None assert session.session_id in [session.id for session in response.sessions] - def test_updates_session_lifetime_and_returns_new_token( + async def test_updates_session_lifetime_and_returns_new_token( self, - client: zitadel.Zitadel, + client: Zitadel, session: SessionServiceCreateSessionResponse, ) -> None: """Updates the session lifetime and returns a new token.""" request = SessionServiceSetSessionRequest( - sessionId=session.session_id if session.session_id is not None else "", lifetime="36000s" + sessionId=session.session_id if session.session_id is not None else "", + lifetime=timedelta(seconds=36000), ) - response = client.sessions.set_session(request) + response = await client.session_service.set_session(request) assert isinstance(response.session_token, str) - def test_raises_api_exception_for_nonexistent_session( + async def test_raises_api_exception_for_nonexistent_session( self, - client: zitadel.Zitadel, + client: Zitadel, session: SessionServiceCreateSessionResponse, ) -> None: """Raises an ApiException when retrieving a non-existent session.""" - with pytest.raises(ApiError): + with pytest.raises(ApiException): request = SessionServiceGetSessionRequest( sessionId=str(uuid.uuid4()), sessionToken=session.session_token, ) - client.sessions.get_session(request) + await client.session_service.get_session(request) diff --git a/spec/check_user_service_spec.py b/spec/check_user_service_spec.py index 14349fbf..618b960d 100644 --- a/spec/check_user_service_spec.py +++ b/spec/check_user_service_spec.py @@ -1,12 +1,14 @@ import uuid -from typing import Dict, Generator +from typing import AsyncGenerator, Dict, List, Optional import pytest -import zitadel_client as zitadel from spec.base_spec import docker_compose as docker_compose from zitadel_client import UserServiceDeleteUserRequest -from zitadel_client.exceptions import ApiError +from zitadel_client.auth.personal_access_token_authenticator import ( + PersonalAccessTokenAuthenticator, +) +from zitadel_client.errors import ApiException from zitadel_client.models import ( UserServiceAddHumanUserRequest, UserServiceAddHumanUserResponse, @@ -17,29 +19,36 @@ UserServiceSetHumanProfile, UserServiceUpdateHumanUserRequest, ) +from zitadel_client.zitadel import Zitadel @pytest.fixture(scope="module") -def client(docker_compose: Dict[str, str]) -> zitadel.Zitadel: # noqa F811 +def client(docker_compose: Dict[str, str]) -> Zitadel: # noqa F811 """Provides a Zitadel client configured with a personal access token.""" base_url = docker_compose["base_url"] auth_token = docker_compose["auth_token"] - return zitadel.Zitadel.with_access_token(base_url, auth_token) + return Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator(base_url, auth_token) + ) @pytest.fixture -def user(client: zitadel.Zitadel) -> Generator[UserServiceAddHumanUserResponse, None, None]: +async def user( + client: Zitadel, +) -> AsyncGenerator[UserServiceAddHumanUserResponse, None]: """Creates a fresh human user for each test and cleans up afterward.""" request = UserServiceAddHumanUserRequest( username=uuid.uuid4().hex, profile=UserServiceSetHumanProfile(given_name="John", family_name="Doe"), # type: ignore[call-arg] email=UserServiceSetHumanEmail(email=f"johndoe{uuid.uuid4().hex}@example.com"), ) - response = client.users.add_human_user(request) + response = await client.user_service.add_human_user(request) yield response try: - client.users.delete_user(UserServiceDeleteUserRequest(userId=response.user_id or "")) - except ApiError: + await client.user_service.delete_user( + UserServiceDeleteUserRequest(userId=response.user_id or "") + ) + except ApiException: pass @@ -60,53 +69,58 @@ class TestUserServiceSanityCheckSpec: removed after the test to ensure a clean state. """ - def test_retrieves_user_details_by_id( + async def test_retrieves_user_details_by_id( self, - client: zitadel.Zitadel, + client: Zitadel, user: UserServiceAddHumanUserResponse, ) -> None: """Retrieves the user details by ID.""" request = UserServiceGetUserByIDRequest( userId=user.user_id or "", ) - response: UserServiceGetUserByIDResponse = client.users.get_user_by_id(request) + response: UserServiceGetUserByIDResponse = ( + await client.user_service.get_user_by_id(request) + ) assert response.user.user_id == user.user_id # type: ignore[union-attr] - def test_includes_created_user_when_listing( + async def test_includes_created_user_when_listing( self, - client: zitadel.Zitadel, + client: Zitadel, user: UserServiceAddHumanUserResponse, ) -> None: """Includes the created user when listing all users.""" request = UserServiceListUsersRequest(queries=[]) - response = client.users.list_users(request) - ids = [u.user_id for u in response.result] # type: ignore + response = await client.user_service.list_users(request) + ids: List[Optional[str]] = [u.user_id for u in response.result] # type: ignore assert user.user_id in ids - def test_updates_user_email_and_reflects_in_get( + async def test_updates_user_email_and_reflects_in_get( self, - client: zitadel.Zitadel, + client: Zitadel, user: UserServiceAddHumanUserResponse, ) -> None: """Updates the user's email and verifies the change.""" request = UserServiceUpdateHumanUserRequest( - userId=user.user_id, email=UserServiceSetHumanEmail(email=f"updated{uuid.uuid4().hex}@example.com") + userId=user.user_id, + email=UserServiceSetHumanEmail( + email=f"updated{uuid.uuid4().hex}@example.com" + ), ) - client.users.update_human_user(request) - response = client.users.get_user_by_id( + await client.user_service.update_human_user(request) + response = await client.user_service.get_user_by_id( UserServiceGetUserByIDRequest( userId=user.user_id or "", ) ) assert "updated" in response.user.human.email.email # type: ignore - def test_raises_api_exception_for_nonexistent_user( + async def test_raises_api_exception_for_nonexistent_user( self, - client: zitadel.Zitadel, + client: Zitadel, ) -> None: """Raises an ApiException when retrieving a non-existent user.""" - with pytest.raises(ApiError): + with pytest.raises(ApiException): request = UserServiceGetUserByIDRequest( userId=str(uuid.uuid4()), ) - client.users.get_user_by_id(request) + await client.user_service.get_user_by_id(request) diff --git a/spec/conftest.py b/spec/conftest.py index db791ee5..ad840af9 100644 --- a/spec/conftest.py +++ b/spec/conftest.py @@ -131,7 +131,9 @@ def append_failure(self, report: TestReport) -> None: self._add_simple("skipped", "xfail-marked test passes unexpectedly") else: assert report.longrepr is not None - reprcrash: ReprFileLocation | None = getattr(report.longrepr, "reprcrash", None) + reprcrash: ReprFileLocation | None = getattr( + report.longrepr, "reprcrash", None + ) if reprcrash is not None: message = reprcrash.message else: @@ -193,7 +195,9 @@ def append_skipped(self, report: TestReport) -> None: skipreason = skipreason[9:] details = f"{filename}:{lineno}: {skipreason}" - skipped = ET.Element("skipped", type="pytest.skip", message=bin_xml_escape(skipreason)) + skipped = ET.Element( + "skipped", type="pytest.skip", message=bin_xml_escape(skipreason) + ) skipped.text = bin_xml_escape(details) self.append(skipped) self.write_captured_output(report) @@ -351,7 +355,9 @@ def __init__( # type: ignore[no-untyped-def] self.logging = logging self.log_passing_tests = log_passing_tests self.report_duration = report_duration - self.stats: dict[str, int] = dict.fromkeys(["error", "passed", "failure", "skipped"], 0) + self.stats: dict[str, int] = dict.fromkeys( + ["error", "passed", "failure", "skipped"], 0 + ) # noinspection PyUnresolvedReferences self.node_reporters: dict[tuple[str | TestReport, object], _NodeReporter] = {} self.node_reporters_ordered: list[_NodeReporter] = [] @@ -545,7 +551,11 @@ def pytest_sessionfinish(self) -> None: multiple elements grouped by test class. """ os.makedirs(self.output_dir, exist_ok=True) - ts = datetime.fromtimestamp(self.suite_start_time, timezone.utc).astimezone().isoformat() + ts = ( + datetime.fromtimestamp(self.suite_start_time, timezone.utc) + .astimezone() + .isoformat() + ) root = ET.Element("testsuites") total_tests = total_failures = total_skipped = total_errors = total_time = 0.0 diff --git a/test/auth/test_client_credentials_authenticator.py b/test/auth/test_client_credentials_authenticator.py index a1279799..2cf118b0 100644 --- a/test/auth/test_client_credentials_authenticator.py +++ b/test/auth/test_client_credentials_authenticator.py @@ -1,44 +1,240 @@ -import time -from datetime import datetime, timezone +from typing import Any, Dict, List, Optional +from unittest.mock import Mock from test.auth.test_oauth_authenticator import OAuthAuthenticatorTest +from zitadel_client.api_http_response import ApiHttpResponse from zitadel_client.auth.client_credentials_authenticator import ( ClientCredentialsAuthenticator, ) +from zitadel_client.auth.open_id import OpenId +from zitadel_client.default_api_client import DefaultApiClient +from zitadel_client.errors import ( + ApiException, + SerializationException, + ZitadelException, +) +from zitadel_client.errors.internal_server_error_exception import ( + InternalServerErrorException, +) +from zitadel_client.errors.network_exception import NetworkException +from zitadel_client.errors.not_found_exception import NotFoundException +from zitadel_client.errors.oauth2_server_exception import OAuth2ServerException +from zitadel_client.errors.oauth2_token_exception import OAuth2TokenException +from zitadel_client.transport_options import TransportOptions + +HOST = "https://zitadel.example.com" +DISCOVERY = '{"issuer":"' + HOST + '","token_endpoint":"' + HOST + '/oauth/v2/token"}' + + +class StubApiClient: + """An ApiClient that records token requests and answers with canned responses.""" + + def __init__(self, discovery: ApiHttpResponse, token: ApiHttpResponse) -> None: + self.discovery = discovery + self.token = token + self.bodies: List[str] = [] + + def send_request( + self, + method: str, + url: str, + headers: Dict[str, str], + body: Any = None, + no_redirect: bool = False, + ) -> ApiHttpResponse: + if url.endswith("/.well-known/openid-configuration"): + return self.discovery + self.bodies.append(str(body)) + return self.token + + +def response(status: int, body: str) -> ApiHttpResponse: + return ApiHttpResponse(status, body, {}) + + +def authenticator( + api_client: Any, host: Optional[str] = None +) -> ClientCredentialsAuthenticator: + auth = ClientCredentialsAuthenticator.builder( + host or HOST, "client-1", "client-secret" + ).build() + auth.set_api_client(api_client) + return auth + + +def token_authenticator(status: int, body: str) -> ClientCredentialsAuthenticator: + return authenticator( + StubApiClient(response(200, DISCOVERY), response(status, body)) + ) class ClientCredentialsAuthenticatorTest(OAuthAuthenticatorTest): """ - Test for ClientCredentialsAuthenticator to verify token refresh functionality. - Extends the base OAuthAuthenticatorTest class. + Tests for ClientCredentialsAuthenticator and the OAuth contract it shares + with every OAuth authenticator: host validation, OpenID discovery failures + and token endpoint failures. + + No contract test reaches a real host. HTTP-level cases use an in-memory + ApiClient that answers with canned responses; the transport case uses the + real DefaultApiClient against a local port nothing listens on. """ + def test_redacts_secret_in_repr(self) -> None: + """The client secret is masked in repr while the client id stays visible.""" + secret = "super-secret-value-9000" + open_id = Mock(spec=OpenId) + open_id.get_host_endpoint.return_value = "https://example.zitadel.cloud" + auth = ClientCredentialsAuthenticator(open_id, "client-1", secret, "openid") + + rendered = repr(auth) + + self.assertNotIn(secret, rendered) + self.assertIn("***", rendered) + self.assertIn("client-1", rendered) + # noinspection DuplicatedCode def test_refresh_token(self) -> None: - time.sleep(20) - assert self.oauth_host is not None - authenticator = ( - ClientCredentialsAuthenticator.builder(self.oauth_host, "dummy-client", "dummy-secret") + auth = self.inject_api_client( + ClientCredentialsAuthenticator.builder( + self.oauth_host, "dummy-client", "dummy-secret" + ) .scopes("openid", "foo") .build() ) - self.assertTrue(authenticator.get_auth_token(), "Access token should not be empty") - token = authenticator.refresh_token() - self.assertEqual( - {"Authorization": "Bearer " + token.access_token}, - authenticator.get_auth_headers(), + self.assertTrue(auth.get_auth_token(), "Access token should not be empty") + token = auth.refresh_token() + self.assertEqual({"Authorization": "Bearer " + token}, auth.get_auth_headers()) + self.assertTrue(token, "Access token should not be null") + self.assertEqual(token, auth.get_auth_token()) + self.assertEqual(self.oauth_host, auth.get_host()) + self.assertNotEqual( + auth.refresh_token(), + auth.refresh_token(), + "Two refreshToken calls should produce different tokens", ) - self.assertTrue(token.access_token, "Access token should not be null") + + def test_mints_and_caches_token(self) -> None: + api_client = StubApiClient( + response(200, DISCOVERY), + response(200, '{"access_token":"t0k3n","expires_in":3600}'), + ) + auth = authenticator(api_client) + + self.assertEqual("t0k3n", auth.get_auth_token()) + self.assertEqual({"Authorization": "Bearer t0k3n"}, auth.get_auth_headers()) + self.assertEqual(1, len(api_client.bodies)) self.assertTrue( - token.expires_at > datetime.now(timezone.utc), - "Token expiry should be in the future", + api_client.bodies[0].startswith( + "grant_type=client_credentials&scope=openid" + ) ) - self.assertEqual(token.access_token, authenticator.get_auth_token()) - self.assertEqual(self.oauth_host, authenticator.get_host()) - self.assertNotEqual( - authenticator.refresh_token().access_token, - authenticator.refresh_token().access_token, - "Two refreshToken calls should produce different tokens", + + def test_rejects_empty_credentials(self) -> None: + with self.assertRaises(ValueError): + ClientCredentialsAuthenticator.builder(HOST, "", "client-secret") + with self.assertRaises(ValueError): + ClientCredentialsAuthenticator.builder(HOST, "client-1", " ") + + def test_rejects_bad_host(self) -> None: + for host in ("", "ftp://example.com", "https://"): + with self.assertRaises(ValueError) as context: + ClientCredentialsAuthenticator.builder( + host, "client-1", "client-secret" + ) + self.assertIs(ValueError, type(context.exception)) + self.assertNotIsInstance(context.exception, ZitadelException) + + def test_requires_api_client(self) -> None: + auth = ClientCredentialsAuthenticator.builder( + HOST, "client-1", "client-secret" + ).build() + + with self.assertRaises(RuntimeError) as context: + auth.get_auth_token() + self.assertIs(RuntimeError, type(context.exception)) + + def test_discovery_unreachable(self) -> None: + auth = authenticator( + DefaultApiClient(TransportOptions()), host="http://127.0.0.1:1" ) + + with self.assertRaises(NetworkException) as context: + auth.get_auth_token() + self.assertIs(NetworkException, type(context.exception)) + self.assertIsInstance(context.exception, ApiException) + self.assertEqual(0, context.exception.status_code) + + def test_discovery_non_2xx(self) -> None: + with self.assertRaises(NotFoundException) as context: + authenticator( + StubApiClient(response(404, "{}"), response(200, "{}")) + ).get_auth_token() + self.assertIs(NotFoundException, type(context.exception)) + self.assertEqual(404, context.exception.status_code) + self.assertIsInstance(context.exception, ZitadelException) + + with self.assertRaises(InternalServerErrorException) as server: + authenticator( + StubApiClient(response(500, "{}"), response(200, "{}")) + ).get_auth_token() + self.assertIs(InternalServerErrorException, type(server.exception)) + + def test_discovery_malformed(self) -> None: + for body in ("not json", "[]", '{"issuer":"x"}'): + with self.assertRaises(SerializationException) as context: + authenticator( + StubApiClient(response(200, body), response(200, "{}")) + ).get_auth_token() + self.assertIs(SerializationException, type(context.exception)) + self.assertIsInstance(context.exception, ZitadelException) + + def test_token_endpoint_rejects(self) -> None: + with self.assertRaises(OAuth2ServerException) as context: + token_authenticator( + 401, '{"error":"invalid_client","error_description":"bad"}' + ).get_auth_token() + self.assertIs(OAuth2ServerException, type(context.exception)) + self.assertEqual(401, context.exception.status_code) + self.assertEqual("invalid_client", context.exception.code) + self.assertEqual("bad", context.exception.description) + self.assertIsInstance(context.exception, ZitadelException) + self.assertNotIsInstance(context.exception, ApiException) + + with self.assertRaises(OAuth2ServerException) as raw: + token_authenticator(503, "down").get_auth_token() + self.assertEqual(503, raw.exception.status_code) + self.assertEqual("down", raw.exception.raw_body) + + def test_token_endpoint_unusable(self) -> None: + for body in ('{"token_type":"Bearer"}', "not json", '{"access_token":""}'): + with self.assertRaises(OAuth2TokenException) as context: + token_authenticator(200, body).get_auth_token() + self.assertIs(OAuth2TokenException, type(context.exception)) + self.assertIsInstance(context.exception, ZitadelException) + + def test_rejects_bad_scopes(self) -> None: + builder = ClientCredentialsAuthenticator.builder( + HOST, "client-1", "client-secret" + ) + + for scopes in ((), ("open id",), ("",)): + with self.assertRaises(ValueError) as context: + builder.scopes(*scopes) + self.assertIs(ValueError, type(context.exception)) + + def test_joins_scopes(self) -> None: + api_client = StubApiClient( + response(200, DISCOVERY), response(200, '{"access_token":"t"}') + ) + auth = ( + ClientCredentialsAuthenticator.builder(HOST, "client-1", "client-secret") + .scopes("openid", "profile", "openid") + .build() + ) + auth.set_api_client(api_client) + + auth.get_auth_token() + + self.assertIn("&scope=openid+profile&", api_client.bodies[0]) diff --git a/test/auth/test_oauth_authenticator.py b/test/auth/test_oauth_authenticator.py index 3add8d5f..3e186bd0 100644 --- a/test/auth/test_oauth_authenticator.py +++ b/test/auth/test_oauth_authenticator.py @@ -1,8 +1,22 @@ +import time import unittest -from typing import Optional +import urllib.error +import urllib.request +from typing import Optional, TypeVar +from unittest.mock import Mock from testcontainers.core.container import DockerContainer +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) +from zitadel_client.auth.oauth_authenticator import OAuthAuthenticator +from zitadel_client.auth.open_id import OpenId +from zitadel_client.default_api_client import DefaultApiClient +from zitadel_client.transport_options import TransportOptions + +A = TypeVar("A", bound=OAuthAuthenticator) + class OAuthAuthenticatorTest(unittest.TestCase): """ @@ -21,14 +35,65 @@ class OAuthAuthenticatorTest(unittest.TestCase): @classmethod def setup_class(cls) -> None: - cls.mock_oauth2_server = DockerContainer("ghcr.io/navikt/mock-oauth2-server:2.1.10").with_exposed_ports(8080) + cls.mock_oauth2_server = DockerContainer( + "ghcr.io/navikt/mock-oauth2-server:2.1.10" + ).with_exposed_ports(8080) cls.mock_oauth2_server.start() host = cls.mock_oauth2_server.get_container_host_ip() port = cls.mock_oauth2_server.get_exposed_port(8080) # noinspection HttpUrlsUsage cls.oauth_host = f"http://{host}:{port}" + # Wait for HTTP GET / -> 405 (mock-oauth2-server ready), the same + # readiness strategy the other SDK test harnesses use — no fixed sleep. + deadline = time.time() + 30 + while True: + try: + urllib.request.urlopen(cls.oauth_host + "/", timeout=1) + except urllib.error.HTTPError as exc: + if exc.code == 405: + break + except Exception: + pass + if time.time() >= deadline: + raise RuntimeError( + f"mock-oauth2-server not ready at {cls.oauth_host} within 30s" + ) + time.sleep(0.5) @classmethod def teardown_class(cls) -> None: if cls.mock_oauth2_server is not None: cls.mock_oauth2_server.stop() + + def test_redacts_secret_in_repr(self) -> None: + """The cached/minted access token is masked in repr. + + Uses a concrete OAuth authenticator with a mocked OpenId so no network + call is made; the cached token is seeded directly. + """ + token = "minted-access-token-do-not-leak" + open_id = Mock(spec=OpenId) + open_id.get_host_endpoint.return_value = "https://example.zitadel.cloud" + authenticator = ClientCredentialsAuthenticator( + open_id, "client-1", "client-secret", "openid" + ) + authenticator._access_token = token + + rendered = OAuthAuthenticator.__repr__(authenticator) + + self.assertNotIn(token, rendered) + self.assertIn("***", rendered) + + @staticmethod + def inject_api_client(authenticator: A) -> A: + """ + Inject a real transport into an OAuth authenticator. + + OAuth authenticators require a transport to perform discovery and token + exchange. The real client wires this via ``set_api_client`` (see + ``Zitadel.__init__``); mirror that here so the bespoke tests can exchange + tokens against the mock OAuth2 server. The mock server is plain HTTP, so + default transport options are fine. + """ + authenticator.set_api_client(DefaultApiClient(TransportOptions())) + return authenticator diff --git a/test/auth/test_personal_access_authenticator.py b/test/auth/test_personal_access_authenticator.py index 595673cd..a6cb8277 100644 --- a/test/auth/test_personal_access_authenticator.py +++ b/test/auth/test_personal_access_authenticator.py @@ -7,6 +7,29 @@ class PersonalAccessTokenAuthenticatorTest(unittest.TestCase): def test_returns_expected_headers_and_host(self) -> None: - auth = PersonalAccessTokenAuthenticator("https://api.example.com", "my-secret-token") - self.assertEqual({"Authorization": "Bearer my-secret-token"}, auth.get_auth_headers()) + auth = PersonalAccessTokenAuthenticator( + "https://api.example.com", "my-secret-token" + ) + self.assertEqual( + {"Authorization": "Bearer my-secret-token"}, auth.get_auth_headers() + ) self.assertEqual("https://api.example.com", auth.get_host()) + + def test_redacts_secret_in_repr(self) -> None: + """The personal access token is masked in repr.""" + token = "tkn-abcdef-do-not-leak" + auth = PersonalAccessTokenAuthenticator("https://api.example.com", token) + + rendered = repr(auth) + + self.assertNotIn(token, rendered) + self.assertIn("***", rendered) + + def test_rejects_bad_arguments(self) -> None: + """An empty token or an invalid host is a ValueError.""" + with self.assertRaises(ValueError) as token: + PersonalAccessTokenAuthenticator("https://api.example.com", "") + self.assertIs(ValueError, type(token.exception)) + with self.assertRaises(ValueError) as host: + PersonalAccessTokenAuthenticator("ftp://api.example.com", "my-secret-token") + self.assertIs(ValueError, type(host.exception)) diff --git a/test/auth/test_web_token_authenticator.py b/test/auth/test_web_token_authenticator.py index c1c6c86a..1e450b04 100644 --- a/test/auth/test_web_token_authenticator.py +++ b/test/auth/test_web_token_authenticator.py @@ -1,5 +1,7 @@ -import time -from datetime import datetime, timezone +import json +import os +import tempfile +from unittest.mock import Mock from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.serialization import ( @@ -9,6 +11,7 @@ ) from test.auth.test_oauth_authenticator import OAuthAuthenticatorTest +from zitadel_client.auth.open_id import OpenId from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator @@ -17,9 +20,34 @@ class WebTokenAuthenticatorTest(OAuthAuthenticatorTest): Test for WebTokenAuthenticator to verify JWT token refresh functionality using the builder. """ + def test_redacts_secret_in_repr(self) -> None: + """The private key and cached access token are masked in repr. + + Uses a mocked OpenId so no network call is made; the cached token is + seeded directly to exercise the masked representation. + """ + token = "minted-access-token-do-not-leak" + private_key = "-----BEGIN PRIVATE KEY-----secret-key-material-----END-----" + open_id = Mock(spec=OpenId) + open_id.get_host_endpoint.return_value = "https://example.zitadel.cloud" + authenticator = WebTokenAuthenticator( + open_id, + "openid", + "issuer", + "subject", + "audience", + private_key, + ) + authenticator._access_token = token + + rendered = repr(authenticator) + + self.assertNotIn(token, rendered) + self.assertNotIn(private_key, rendered) + self.assertIn("***", rendered) + # noinspection DuplicatedCode def test_refresh_token_using_builder(self) -> None: - time.sleep(20) key = rsa.generate_private_key(public_exponent=65537, key_size=2048) private_key_pem = key.private_bytes( @@ -29,25 +57,97 @@ def test_refresh_token_using_builder(self) -> None: ).decode("utf-8") assert self.oauth_host is not None - authenticator = ( - WebTokenAuthenticator.builder(self.oauth_host, "dummy-client", private_key_pem).token_lifetime_seconds(3600).build() + authenticator = self.inject_api_client( + WebTokenAuthenticator.builder( + self.oauth_host, "dummy-client", private_key_pem + ) + .token_lifetime_seconds(3600) + .build() ) - self.assertTrue(authenticator.get_auth_token(), "Access token should not be empty") + self.assertTrue( + authenticator.get_auth_token(), "Access token should not be empty" + ) token = authenticator.refresh_token() self.assertEqual( - {"Authorization": "Bearer " + token.access_token}, + {"Authorization": "Bearer " + token}, authenticator.get_auth_headers(), ) - self.assertTrue(token.access_token, "Access token should not be null") - self.assertTrue( - token.expires_at > datetime.now(timezone.utc), - "Token expiry should be in the future", - ) - self.assertEqual(token.access_token, authenticator.get_auth_token()) + self.assertTrue(token, "Access token should not be null") + self.assertEqual(token, authenticator.get_auth_token()) self.assertEqual(self.oauth_host, authenticator.get_host()) self.assertNotEqual( - authenticator.refresh_token().access_token, - authenticator.refresh_token().access_token, + authenticator.refresh_token(), + authenticator.refresh_token(), "Two refreshToken calls should produce different tokens", ) + + @staticmethod + def _pem() -> str: + key = rsa.generate_private_key(public_exponent=65537, key_size=2048) + return key.private_bytes( + encoding=Encoding.PEM, + format=PrivateFormat.PKCS8, + encryption_algorithm=NoEncryption(), + ).decode("utf-8") + + def _key_file(self, content: str) -> str: + handle, path = tempfile.mkstemp(suffix=".json") + with os.fdopen(handle, "w", encoding="utf-8") as file: + file.write(content) + self.addCleanup(os.remove, path) + return path + + def test_loads_key_file(self) -> None: + """A Zitadel key file builds an authenticator for the host.""" + path = self._key_file( + json.dumps( + { + "type": "serviceaccount", + "keyId": "key-1", + "userId": "user-1", + "key": self._pem(), + } + ) + ) + + auth = WebTokenAuthenticator.from_json("https://example.zitadel.cloud", path) + + self.assertEqual("https://example.zitadel.cloud", auth.get_host()) + + def test_rejects_bad_key_file(self) -> None: + """A missing or malformed key file is a ValueError.""" + host = "https://example.zitadel.cloud" + with self.assertRaises(ValueError) as missing: + WebTokenAuthenticator.from_json( + host, os.path.join(tempfile.gettempdir(), "absent-zitadel-key.json") + ) + self.assertIs(ValueError, type(missing.exception)) + + for content in ( + "not json", + "[]", + '{"userId":"user-1","keyId":"key-1"}', + '{"userId":"user-1","keyId":"key-1","key":"not a pem"}', + ): + path = self._key_file(content) + with self.assertRaises(ValueError) as context: + WebTokenAuthenticator.from_json(host, path) + self.assertIs(ValueError, type(context.exception)) + + def test_rejects_bad_builder_arguments(self) -> None: + """Invalid builder arguments are a ValueError.""" + host = "https://example.zitadel.cloud" + pem = self._pem() + builder = WebTokenAuthenticator.builder(host, "user-1", pem) + + for action in ( + lambda: WebTokenAuthenticator.builder(host, "", pem), + lambda: WebTokenAuthenticator.builder(host, "user-1", "not a pem"), + lambda: builder.jwt_algorithm("HS256"), + lambda: builder.token_lifetime_seconds(0), + lambda: builder.key_id(""), + ): + with self.assertRaises(ValueError) as context: + action() + self.assertIs(ValueError, type(context.exception)) diff --git a/test/fixtures/squid.conf b/test/fixtures/squid.conf index f3e60d4b..ec29c778 100644 --- a/test/fixtures/squid.conf +++ b/test/fixtures/squid.conf @@ -1,3 +1,10 @@ http_port 3128 +http_port 3129 name=authport +auth_param basic program /usr/lib/squid/basic_fake_auth +auth_param basic realm sdk-test-proxy acl all src all +acl on_auth_port myportname authport +acl authed proxy_auth REQUIRED +http_access deny on_auth_port !authed http_access allow all +dns_nameservers 127.0.0.11 diff --git a/test/test_api_client.py b/test/test_api_client.py deleted file mode 100644 index 93a2eec0..00000000 --- a/test/test_api_client.py +++ /dev/null @@ -1,96 +0,0 @@ -import json -import time -import unittest -import urllib -import urllib.request - -from testcontainers.core.container import DockerContainer - -from zitadel_client import ApiClient, Configuration -from zitadel_client.auth.personal_access_token_authenticator import ( - PersonalAccessTokenAuthenticator, -) - - -class TestApiClient(unittest.TestCase): - """ - Test case for interacting with the WireMock mock OAuth2 server. - """ - - mock_oauth2_server: DockerContainer - oauth_host: str - - @classmethod - def setup_class(cls) -> None: - """ - Starts the WireMock Docker container and exposes the required port. - Sets up the OAuth server URL. - """ - cls.mock_oauth2_server = DockerContainer("wiremock/wiremock:3.12.1").with_exposed_ports(8080) - cls.mock_oauth2_server.start() - - host = cls.mock_oauth2_server.get_container_host_ip() - port = cls.mock_oauth2_server.get_exposed_port(8080) - # noinspection HttpUrlsUsage - cls.oauth_host = f"http://{host}:{port}" - - @classmethod - def teardown_class(cls) -> None: - """ - Stops the WireMock Docker container. - """ - if cls.mock_oauth2_server is not None: - cls.mock_oauth2_server.stop() - - def test_assert_headers_and_content_type(self) -> None: - """ - Test the behavior of API client when sending requests to the mock OAuth2 server, - asserting headers and content type. - """ - time.sleep(20) - - with urllib.request.urlopen( # noqa S310 allow all URL schemes - urllib.request.Request( # noqa S310 allow all URL schemes - self.oauth_host + "/__admin/mappings", - data=json.dumps( - { - "request": { - "method": "GET", - "url": "/your/endpoint", - "headers": { - "Authorization": {"equalTo": "Bearer mm"}, - "User-Agent": { - "matches": "^zitadel-client/\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9]+(\\.\\d+)?)? \\(lang=python; lang_version=[^;]+; os=[^;]+; arch=[^;]+\\)$" # noqa E501 - }, - }, - }, - "response": { - "status": 200, - "body": '{"key": "value"}', - "headers": {"Content-Type": "application/json"}, - }, - } - ).encode("utf-8"), - headers={"Content-Type": "application/json"}, - method="POST", - ) - ) as response: - response.read().decode() - - api_client = ApiClient(Configuration(authenticator=PersonalAccessTokenAuthenticator(self.oauth_host, "mm"))) - - api_response = api_client.call_api( - *( - api_client.param_serialize( - method="GET", - resource_path="/your/endpoint", - ) - ) - ) - - if api_response.status != 200: - self.fail(f"Expected status 200, but got {api_response.status}") - - -if __name__ == "__main__": - unittest.main() diff --git a/test/test_api_exception.py b/test/test_api_exception.py deleted file mode 100644 index f03546f0..00000000 --- a/test/test_api_exception.py +++ /dev/null @@ -1,14 +0,0 @@ -import unittest - -from zitadel_client.exceptions import ApiError - - -class ApiExceptionTest(unittest.TestCase): - def test_api_exception(self) -> None: - headers = {"H": "v"} - e = ApiError(418, headers, "body") - - self.assertEqual(str(e), "Error 418") - self.assertEqual(e.code, 418) - self.assertEqual(e.response_headers, headers) - self.assertEqual(e.response_body, "body") diff --git a/test/test_api_result.py b/test/test_api_result.py new file mode 100644 index 00000000..4d16c13d --- /dev/null +++ b/test/test_api_result.py @@ -0,0 +1,41 @@ +from typing import Any, cast +import pytest + +from zitadel_client.api_result import ApiResult + + +class TestApiResult: + def test_carries_data_status_code_headers_and_raw_body(self) -> None: + result = ApiResult( + status_code=200, + data={"id": 1}, + raw_body='{"id": 1}', + headers={"Content-Type": "application/json"}, + ) + + assert result.status_code == 200 + assert result.data == {"id": 1} + assert result.raw_body == '{"id": 1}' + assert result.headers == {"Content-Type": "application/json"} + + def test_data_may_be_none_for_empty_response(self) -> None: + # A 204 No Content carries no deserialized payload, but raw_body is + # always populated (an empty string when the server sent no body). + result: ApiResult[None] = ApiResult( + status_code=204, data=None, raw_body="", headers={} + ) + + assert result.status_code == 204 + assert result.data is None + assert result.raw_body == "" + assert result.headers == {} + + def test_is_frozen(self) -> None: + # ApiResult is an immutable @dataclass(frozen=True); attribute + # assignment must raise. + result: ApiResult[None] = ApiResult( + status_code=200, data=None, raw_body="", headers={} + ) + + with pytest.raises(Exception): + cast(Any, result).status_code = 500 diff --git a/test/test_configuration.py b/test/test_configuration.py index e4888044..925b51fa 100644 --- a/test/test_configuration.py +++ b/test/test_configuration.py @@ -1,21 +1,200 @@ -import unittest +from types import MappingProxyType -from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator -from zitadel_client.configuration import Configuration +from zitadel_client.configuration import Configuration, ConfigurationBuilder +from zitadel_client.server_configuration import ServerConfiguration, ServerVariable -class ConfigurationTest(unittest.TestCase): - def test_user_agent_getter_and_setter(self) -> None: - """ - Test user agent getter and setter. +class TestConfigurationDefaults: + def test_default_constructor_uses_spec_base_url(self) -> None: + config = Configuration() - @return void - """ - config = Configuration(NoAuthAuthenticator()) + assert config.base_url == "https://zitadel.com" + assert len(config.default_headers) == 0 - self.assertRegex( - config.user_agent, - r"^zitadel-client/\d+\.\d+\.\d+(-[a-zA-Z0-9]+(\.\d+)?)? \(lang=python; lang_version=[^;]+; os=[^;]+; arch=[^;]+\)$", + def test_builder_produces_correct_defaults(self) -> None: + config = Configuration.builder().build() + + assert config.base_url == "https://zitadel.com" + assert len(config.default_headers) == 0 + + def test_builder_returns_configuration_builder_instance(self) -> None: + builder = Configuration.builder() + + assert isinstance(builder, ConfigurationBuilder) + + +class TestConfigurationBuilder: + def test_builder_sets_base_url(self) -> None: + config = Configuration.builder().base_url("https://custom.example.com").build() + + assert config.base_url == "https://custom.example.com" + + def test_builder_sets_single_default_header(self) -> None: + config = ( + Configuration.builder() + .default_header("Authorization", "Bearer token123") + .build() + ) + + assert config.default_headers["Authorization"] == "Bearer token123" + + def test_builder_sets_multiple_default_headers(self) -> None: + config = ( + Configuration.builder() + .default_headers( + { + "Authorization": "Bearer token123", + "X-Custom": "value", + } + ) + .build() + ) + + assert config.default_headers["Authorization"] == "Bearer token123" + assert config.default_headers["X-Custom"] == "value" + + def test_builder_accumulates_headers(self) -> None: + config = ( + Configuration.builder() + .default_header("X-First", "one") + .default_header("X-Second", "two") + .default_headers({"X-Third": "three"}) + .build() + ) + + assert len(config.default_headers) == 3 + assert config.default_headers["X-First"] == "one" + assert config.default_headers["X-Second"] == "two" + assert config.default_headers["X-Third"] == "three" + + def test_builder_merges_single_and_bulk_headers(self) -> None: + config = ( + Configuration.builder() + .default_header("X-First", "one") + .default_headers({"X-Second": "two"}) + .default_header("X-Third", "three") + .build() + ) + + assert len(config.default_headers) == 3 + assert config.default_headers["X-First"] == "one" + assert config.default_headers["X-Second"] == "two" + assert config.default_headers["X-Third"] == "three" + + def test_builder_produces_independent_instances(self) -> None: + builder = Configuration.builder().base_url("https://example.com") + first = builder.build() + second = builder.build() + + assert first is not second + assert first.base_url == second.base_url + + def test_builder_sets_all_fields(self) -> None: + config = ( + Configuration.builder() + .base_url("https://api.example.com") + .default_header("Authorization", "Bearer token") + .default_headers({"X-Custom": "value"}) + .build() + ) + + assert config.base_url == "https://api.example.com" + assert config.default_headers["Authorization"] == "Bearer token" + assert config.default_headers["X-Custom"] == "value" + + def test_builder_is_fluent(self) -> None: + builder = Configuration.builder() + + assert builder is builder.base_url("https://example.com") + assert builder is builder.default_header("X-Key", "value") + assert builder is builder.default_headers({"X-Other": "val"}) + + server = ServerConfiguration(url_template="https://example.com") + assert builder is builder.server(server) + + +class TestConfigurationServerResolution: + def test_builder_server_resolves_url(self) -> None: + server = ServerConfiguration( + url_template="https://{env}.example.com/api/{version}", + description="Test server", + variables={ + "env": ServerVariable( + default_value="api", + enum_values=["api", "staging"], + ), + "version": ServerVariable( + default_value="v3", + enum_values=["v2", "v3"], + ), + }, + ) + + config = Configuration.builder().server(server).build() + + assert config.base_url == "https://api.example.com/api/v3" + + def test_builder_server_with_variable_overrides(self) -> None: + server = ServerConfiguration( + url_template="https://{env}.example.com/api/{version}", + variables={ + "env": ServerVariable( + default_value="api", + enum_values=["api", "staging"], + ), + "version": ServerVariable( + default_value="v3", + enum_values=["v2", "v3"], + ), + }, + ) + + config = ( + Configuration.builder() + .server(server, {"env": "staging", "version": "v2"}) + .build() + ) + + assert config.base_url == "https://staging.example.com/api/v2" + + def test_builder_base_url_overrides_server(self) -> None: + server = ServerConfiguration(url_template="https://api.example.com") + + config = ( + Configuration.builder() + .server(server) + .base_url("https://override.example.com") + .build() ) - config.user_agent = "CustomUserAgent/1.0" - self.assertEqual(config.user_agent, "CustomUserAgent/1.0") + + assert config.base_url == "https://override.example.com" + + +class TestDefaultConfiguration: + def test_default_configuration_returns_instance(self) -> None: + config = Configuration.default_configuration() + + assert isinstance(config, Configuration) + assert config.base_url == "https://zitadel.com" + + def test_default_configuration_returns_a_fresh_instance(self) -> None: + # There is no settable process-wide default: every call builds a new + # Configuration, so nothing one caller does can change what another + # gets. + first = Configuration.default_configuration() + second = Configuration.default_configuration() + + assert first is not second + assert first.base_url == second.base_url + + def test_configuration_has_no_settable_process_wide_default(self) -> None: + assert not hasattr(Configuration, "set_default") + assert not hasattr(Configuration, "get_default") + + +class TestConfigurationImmutability: + def test_default_headers_is_immutable(self) -> None: + config = Configuration.builder().default_header("X-Key", "value").build() + + assert isinstance(config.default_headers, MappingProxyType) + assert config.default_headers["X-Key"] == "value" diff --git a/test/test_default_api_client_unit.py b/test/test_default_api_client_unit.py new file mode 100644 index 00000000..f7fedba4 --- /dev/null +++ b/test/test_default_api_client_unit.py @@ -0,0 +1,1141 @@ +import json +import pytest +from http.server import HTTPServer, BaseHTTPRequestHandler +from threading import Thread +from typing import Any, ClassVar + +from zitadel_client.default_api_client import ( + DefaultApiClient, + _charset_from_content_type, + _decode_with_charset, + _guess_content_type, + _sanitize_multipart_field_name, + _sanitize_multipart_filename, +) +from zitadel_client.transport_options import TransportOptions + + +class _EchoHandler(BaseHTTPRequestHandler): + def do_GET(self) -> None: + self._respond() + + def do_POST(self) -> None: + length = int(self.headers.get("Content-Length", 0)) + body = self.rfile.read(length).decode() if length else "" + self._respond(body) + + def do_PUT(self) -> None: + length = int(self.headers.get("Content-Length", 0)) + body = self.rfile.read(length).decode() if length else "" + self._respond(body) + + def do_DELETE(self) -> None: + self._respond() + + def _respond(self, body: str = "") -> None: + if self.path == "/not-found": + self.send_response(404) + self.end_headers() + self.wfile.write(b"not found") + return + + if self.path == "/bad-gzip": + # Advertise gzip but send bytes that are NOT valid gzip. The + # client must surface this as the SDK's ApiException rather than + # leaking a raw gzip.BadGzipFile / OSError. + payload = b"this is definitely not gzip" + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Encoding", "gzip") + self.send_header("Content-Length", str(len(payload))) + self.end_headers() + self.wfile.write(payload) + return + + # Echo back all received headers as JSON. Lowercase the keys to match + # chasm's /test/echo envelope shape so tests use a single key style. + received_headers = {k.lower(): v for k, v in self.headers.items()} + data = json.dumps( + {"method": self.command, "body": body, "headers": received_headers} + ) + self.send_response(200) + self.send_header("Content-Type", "application/json") + self.send_header("X-Test-Header", "test-value") + self.end_headers() + self.wfile.write(data.encode()) + + def log_message(self, format: str, *args: Any) -> None: + pass + + +class TestDefaultApiClientUnit: + server: HTTPServer + port: int + base_url: str + thread: Thread + + @classmethod + def setup_class(cls) -> None: + cls.server = HTTPServer(("127.0.0.1", 0), _EchoHandler) + cls.port = cls.server.server_address[1] + cls.base_url = f"http://127.0.0.1:{cls.port}" + cls.thread = Thread(target=cls.server.serve_forever, daemon=True) + cls.thread.start() + + @classmethod + def teardown_class(cls) -> None: + cls.server.shutdown() + + def test_sends_get_request_and_returns_response(self) -> None: + client = DefaultApiClient() + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["method"] == "GET" + + def test_sends_post_with_json_body(self) -> None: + client = DefaultApiClient() + headers = {"Content-Type": "application/json"} + response = client.send_request( + "POST", f"{self.base_url}/echo", headers, '{"key":"value"}' + ) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["method"] == "POST" + assert "key" in body["body"] + + def test_returns_response_headers(self) -> None: + client = DefaultApiClient() + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + lower_headers = {k.lower(): v for k, v in response.headers.items()} + assert "x-test-header" in lower_headers + assert lower_headers["x-test-header"] == "test-value" + + def test_malformed_gzip_body_raises_api_exception(self) -> None: + """decompression-error-not-wrapped: a body that advertises + Content-Encoding: gzip but is not valid gzip must surface as the + SDK's ApiException carrying the response's real status, not a + NetworkException and not a raw gzip.BadGzipFile / OSError.""" + from zitadel_client.errors import ApiException, NetworkException + + client = DefaultApiClient() + with pytest.raises(ApiException) as exc_info: + client.send_request("GET", f"{self.base_url}/bad-gzip", {}, None) + assert type(exc_info.value) is ApiException + assert not isinstance(exc_info.value, NetworkException) + assert exc_info.value.status_code == 200 + assert "decompress" in str(exc_info.value.message or "").lower() + + def test_returns_non_2xx_status_code(self) -> None: + client = DefaultApiClient() + response = client.send_request("GET", f"{self.base_url}/not-found", {}, None) + assert response.status_code == 404 + assert response.body == "not found" + + def test_sends_put_request(self) -> None: + client = DefaultApiClient() + response = client.send_request("PUT", f"{self.base_url}/echo", {}, "update") + assert response.status_code == 200 + body = json.loads(response.body) + assert body["method"] == "PUT" + + def test_sends_delete_request(self) -> None: + client = DefaultApiClient() + response = client.send_request("DELETE", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["method"] == "DELETE" + + def test_injects_custom_user_agent(self) -> None: + transport = TransportOptions.builder().user_agent("TestAgent/1.0").build() + client = DefaultApiClient(transport) + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["headers"].get("user-agent") == "TestAgent/1.0" + + def test_injects_default_user_agent_when_not_explicitly_set(self) -> None: + client = DefaultApiClient() + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["headers"].get("user-agent") is not None + assert len(body["headers"].get("user-agent", "")) > 0 + + def test_injects_request_id(self) -> None: + transport = TransportOptions.builder().inject_request_id(True).build() + client = DefaultApiClient(transport) + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert "x-request-id" in body["headers"] + assert len(body["headers"]["x-request-id"]) > 0 + + def test_does_not_inject_request_id_when_disabled(self) -> None: + transport = TransportOptions.builder().inject_request_id(False).build() + client = DefaultApiClient(transport) + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert "x-request-id" not in body["headers"] + + def test_includes_transport_default_headers(self) -> None: + transport = ( + TransportOptions.builder() + .default_header("X-Custom-Transport", "transport-value") + .build() + ) + client = DefaultApiClient(transport) + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["headers"].get("x-custom-transport") == "transport-value" + + def test_caller_headers_override_defaults(self) -> None: + transport = ( + TransportOptions.builder().default_header("X-Override", "transport").build() + ) + client = DefaultApiClient(transport) + response = client.send_request( + "GET", f"{self.base_url}/echo", {"X-Override": "caller"}, None + ) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["headers"].get("x-override") == "caller" + + def test_returns_json_body_for_vendor_json_content_type(self) -> None: + """Responses with Content-Type application/vnd.api+json should be + JSON-deserialized, not returned as a raw string.""" + client = DefaultApiClient() + response = client.send_request("GET", f"{self.base_url}/echo", {}, None) + # The echo handler returns application/json; verify the body is valid JSON + body = json.loads(response.body) + assert isinstance(body, dict) + # Simulate a +json content type check inline + content_type = "application/vnd.api+json" + assert content_type.startswith("application/json") or "+json" in content_type + + def test_does_not_override_caller_request_id(self) -> None: + transport = TransportOptions.builder().inject_request_id(True).build() + client = DefaultApiClient(transport) + response = client.send_request( + "GET", f"{self.base_url}/echo", {"X-Request-ID": "caller-id"}, None + ) + assert response.status_code == 200 + body = json.loads(response.body) + assert body["headers"].get("x-request-id") == "caller-id" + + def test_generates_unique_request_ids(self) -> None: + transport = TransportOptions.builder().inject_request_id(True).build() + client = DefaultApiClient(transport) + response1 = client.send_request("GET", f"{self.base_url}/echo", {}, None) + response2 = client.send_request("GET", f"{self.base_url}/echo", {}, None) + body1 = json.loads(response1.body) + body2 = json.loads(response2.body) + id1 = body1["headers"].get("x-request-id") + id2 = body2["headers"].get("x-request-id") + assert id1 is not None + assert id2 is not None + assert id1 != id2 + + def test_joins_multi_value_response_headers(self) -> None: + import socketserver + import threading + + multi_value_port = None + + class MultiValueHandler(BaseHTTPRequestHandler): + def do_GET(self) -> None: + self.send_response(200) + self.send_header("X-Multi", "val1") + self.send_header("X-Multi", "val2") + self.end_headers() + self.wfile.write(b"ok") + + def log_message(self, format: str, *args: Any) -> None: + pass + + with socketserver.TCPServer(("127.0.0.1", 0), MultiValueHandler) as httpd: + multi_value_port = httpd.server_address[1] + t = threading.Thread(target=httpd.handle_request) + t.start() + client = DefaultApiClient() + response = client.send_request( + "GET", f"http://127.0.0.1:{multi_value_port}/multi", {}, None + ) + t.join() + + assert response.status_code == 200 + # urllib3 joins multi-value response headers with ", " + lower_headers = {k.lower(): v for k, v in response.headers.items()} + assert "x-multi" in lower_headers + assert "val1" in lower_headers["x-multi"] and "val2" in lower_headers["x-multi"] + + +class TestCharsetDecoding: + """Verify response body decoding honors the Content-Type charset.""" + + def test_extracts_charset_parameter(self) -> None: + assert ( + _charset_from_content_type("text/plain; charset=ISO-8859-1") == "ISO-8859-1" + ) + assert _charset_from_content_type("text/plain") is None + assert _charset_from_content_type("") is None + assert _charset_from_content_type('text/plain; charset="utf-8"') == "utf-8" + + def test_decodes_iso_8859_1_response(self) -> None: + decoded = _decode_with_charset(b"\xe9", "text/plain; charset=ISO-8859-1") + assert decoded == "é" + + def test_defaults_to_utf8_when_no_charset(self) -> None: + decoded = _decode_with_charset("é".encode("utf-8"), "text/plain") + assert decoded == "é" + + def test_unknown_charset_falls_back_to_utf8(self) -> None: + decoded = _decode_with_charset( + "é".encode("utf-8"), "text/plain; charset=not-a-real-charset" + ) + assert decoded == "é" + + def test_bomless_utf16_decodes_big_endian(self) -> None: + # "Log" encoded as UTF-16 big-endian WITHOUT a BOM. RFC 2781 says a + # BOM-less UTF-16 stream defaults to big-endian, so these bytes must + # decode to "Log" — not the little-endian misread "䰀漀最". + big_endian = b"\x00L\x00o\x00g" + decoded = _decode_with_charset(big_endian, "text/plain; charset=utf-16") + assert decoded == "Log" + # Interpreting the same bytes little-endian would NOT yield "Log", + # which proves the big-endian choice is the one being applied. + assert big_endian.decode("utf-16-le") != "Log" + + def test_utf16_honors_little_endian_bom(self) -> None: + # When a little-endian BOM (FF FE) is present it must still be honored + # and stripped, so BOM-driven detection is not broken by the no-BOM + # big-endian default. + little_endian_bom = b"\xff\xfeL\x00o\x00g\x00" + decoded = _decode_with_charset(little_endian_bom, "text/plain; charset=utf-16") + assert decoded == "Log" + + def test_send_request_decodes_iso_8859_1_response(self) -> None: + import socketserver + import threading + + class _Latin1Handler(BaseHTTPRequestHandler): + def do_GET(self) -> None: + self.send_response(200) + self.send_header("Content-Type", "text/plain; charset=ISO-8859-1") + self.end_headers() + self.wfile.write(b"\xe9") + + def log_message(self, format: str, *args: Any) -> None: + pass + + with socketserver.TCPServer(("127.0.0.1", 0), _Latin1Handler) as httpd: + port = httpd.server_address[1] + t = threading.Thread(target=httpd.handle_request) + t.start() + client = DefaultApiClient() + response = client.send_request("GET", f"http://127.0.0.1:{port}/", {}, None) + t.join() + assert response.body == "é" + + +class TestMultipartFilenameSanitization: + """Sanitize multipart filenames against CRLF injection and non-ASCII drift.""" + + def test_rejects_crlf_in_filename(self) -> None: + with pytest.raises(ValueError): + _sanitize_multipart_filename("a\r\nX-Injected: yes") + + def test_rejects_nul_in_filename(self) -> None: + with pytest.raises(ValueError): + _sanitize_multipart_filename("a\x00b.txt") + + def test_escapes_quote_and_backslash(self) -> None: + ascii_fallback, rfc5987 = _sanitize_multipart_filename('a"b\\c.txt') + assert ascii_fallback == 'a\\"b\\\\c.txt' + assert rfc5987 is None + + def test_rfc5987_for_non_ascii(self) -> None: + ascii_fallback, rfc5987 = _sanitize_multipart_filename("日本.pdf") + assert rfc5987 == "UTF-8''%E6%97%A5%E6%9C%AC.pdf" + # ASCII fallback must still be present and quote-safe + assert '"' not in ascii_fallback or '\\"' in ascii_fallback + + def test_multipart_body_rejects_filename_injection(self) -> None: + import io + + client = DefaultApiClient() + file_like = io.BytesIO(b"hello") + file_like.name = "a\r\nX-Injected: yes" + with pytest.raises(ValueError): + client._build_multipart_body({"upload": file_like}, "boundary") + + def test_multipart_body_escapes_quote_in_filename(self) -> None: + import io + + client = DefaultApiClient() + file_like = io.BytesIO(b"hello") + file_like.name = 'a"b.txt' + body = client._build_multipart_body({"upload": file_like}, "boundary") + assert b'filename="a\\"b.txt"' in body + + def test_multipart_body_uses_rfc5987_for_non_ascii_filename(self) -> None: + import io + + client = DefaultApiClient() + file_like = io.BytesIO(b"hello") + file_like.name = "日本.pdf" + body = client._build_multipart_body({"upload": file_like}, "boundary") + assert b"filename*=UTF-8''%E6%97%A5%E6%9C%AC.pdf" in body + + +class TestMultipartFieldNameUtf8: + """multipart-field-name-ascii-fold: a non-ASCII field NAME must reach the + wire as raw UTF-8, NOT be transliterated to '?'. + + Field names (unlike filename fallbacks) are carried verbatim per RFC 7578 + section 5.1.1. The previous bug routed the name through + ``_sanitize_multipart_filename`` whose ASCII fallback replaced non-ASCII + bytes with ``?``; the dedicated ``_sanitize_multipart_field_name`` keeps + the name intact. + """ + + def test_field_name_helper_preserves_non_ascii(self) -> None: + # The helper must return the name unchanged (no '?' substitution). + assert _sanitize_multipart_field_name("dépôt") == "dépôt" + + def test_field_name_helper_escapes_quote_and_backslash(self) -> None: + assert _sanitize_multipart_field_name('a"b\\c') == 'a\\"b\\\\c' + + def test_field_name_helper_rejects_crlf(self) -> None: + with pytest.raises(ValueError): + _sanitize_multipart_field_name("a\r\nX-Injected: yes") + + def test_field_name_helper_rejects_nul(self) -> None: + with pytest.raises(ValueError): + _sanitize_multipart_field_name("a\x00b") + + def test_multipart_body_preserves_non_ascii_field_name_as_utf8(self) -> None: + client = DefaultApiClient() + body = client._build_multipart_body({"café": b"x"}, "boundary") + # The name directive must appear as raw UTF-8 bytes, never folded to '?'. + # Anchor on '; name=' so the check targets the name directive and does + # not collide with the filename fallback (a raw-bytes part reuses the + # field name as the filename, whose ASCII fallback may legitimately fold + # non-ASCII to '?' alongside an RFC 5987 filename*= parameter). + assert 'name="café"'.encode("utf-8") in body + assert b'; name="caf?"' not in body + + def test_multipart_body_preserves_cjk_field_name_as_utf8(self) -> None: + client = DefaultApiClient() + body = client._build_multipart_body({"標籤": b"x"}, "boundary") + # The name directive must carry the raw UTF-8 field name. The filename + # fallback derived from the reused field name may legitimately fold + # non-ASCII to '?' alongside an RFC 5987 filename*= parameter, so only + # the name directive is asserted free of folding here. + assert 'name="標籤"'.encode("utf-8") in body + assert b'; name="?' not in body + + +class TestMultipartContentType: + """Per-part Content-Type comes from the filename extension.""" + + def test_guess_content_type_from_extension(self) -> None: + assert _guess_content_type("file.png") == "image/png" + + def test_guess_content_type_unknown_extension_defaults_to_octet_stream( + self, + ) -> None: + assert _guess_content_type("blob.zzz") == "application/octet-stream" + + def test_guess_content_type_no_filename_defaults_to_octet_stream(self) -> None: + assert _guess_content_type(None) == "application/octet-stream" + assert _guess_content_type("") == "application/octet-stream" + + def test_multipart_body_emits_png_content_type_for_png_file(self) -> None: + import io + + client = DefaultApiClient() + file_like = io.BytesIO(b"\x89PNG\r\n\x1a\n") + file_like.name = "file.png" + body = client._build_multipart_body({"upload": file_like}, "boundary") + assert b"Content-Type: image/png" in body + + def test_multipart_body_uses_octet_stream_for_bytes_without_filename(self) -> None: + client = DefaultApiClient() + body = client._build_multipart_body({"upload": b"\x00\x01\x02"}, "boundary") + assert b"Content-Type: application/octet-stream" in body + + def test_multipart_raw_bytes_reuses_field_name_as_filename(self) -> None: + # multipart-raw-bytes-part-content-type: a raw-bytes part with no + # explicit filename must reuse the field name as the filename and + # advertise a Content-Type guessed from that name (octet-stream when + # the name has no/unknown extension), matching the go/node/java + # cross-language contract. + client = DefaultApiClient() + body = client._build_multipart_body({"file": b"\x00\x01\x02"}, "boundary") + assert b'name="file"' in body + assert b'filename="file"' in body + assert b"Content-Type: application/octet-stream" in body + + def test_multipart_model_part_serialized_through_object_serializer(self) -> None: + # cross-cutting parity: a multipart/form-data body whose field is a + # MODEL part must be serialized through the SDK's configured + # ObjectSerializer (model_dump_json(by_alias=True, ...)) so it carries + # the WIRE property names declared by the field aliases (isEnabled, + # recordedAt) and the SDK date-time string — NOT pydantic's snake_case + # attribute names (is_enabled, recorded_at) and NOT a Python repr. The + # model part is built at the lowest level by _build_multipart_body, so + # capture its bytes and assert on the embedded JSON. Routing through + # ObjectSerializer keeps the multipart model part byte-identical to a + # JSON request body, matching the other 11 SDKs. + # + # The part model is declared here rather than imported from the + # generated models, so this test holds for EVERY spec this SDK is + # generated from — no spec is guaranteed to contain a model with these + # properties. It mirrors how the generator emits models: snake_case + # attributes carrying the camelCase wire name as a pydantic alias. + import datetime + from pydantic import BaseModel, ConfigDict, Field + from pydantic import AwareDatetime, StrictBool + from typing import Optional + + class MultipartModelPart(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + is_enabled: Optional[StrictBool] = Field(default=None, alias="isEnabled") + recorded_at: Optional[AwareDatetime] = Field( + default=None, alias="recordedAt" + ) + + instant = datetime.datetime( + 2020, 1, 2, 3, 4, 5, 123000, tzinfo=datetime.timezone.utc + ) + metadata = MultipartModelPart(isEnabled=True, recordedAt=instant) + + client = DefaultApiClient() + body = client._build_multipart_body({"metadata": metadata}, "boundary") + text = body.decode("utf-8") + + # The model part is a JSON part. + assert 'name="metadata"' in text + assert "Content-Type: application/json" in text + + # Extract the JSON object that follows the metadata part's blank line. + marker = text.index('name="metadata"') + json_start = text.index("{", marker) + json_end = text.index("}", json_start) + 1 + part_json = text[json_start:json_end] + parsed = json.loads(part_json) + + # WIRE keys present, snake_case attribute names absent. + assert "isEnabled" in parsed + assert "recordedAt" in parsed + assert "is_enabled" not in parsed + assert "recorded_at" not in parsed + + assert parsed["isEnabled"] is True + # recordedAt carries a proper RFC 3339 date-time string (the SDK format), + # not a Python datetime repr or a date-only value. + assert parsed["recordedAt"].startswith("2020-01-02T03:04:05") + assert ".123" in parsed["recordedAt"] + + +class TestMultipartBinaryPreservation: + """Binary multipart parts must not be re-encoded through UTF-8.""" + + def test_text_mode_file_is_rejected_not_silently_reencoded(self) -> None: + """Passing a str-yielding file-like must NOT silently round-trip via UTF-8.""" + import io + + client = DefaultApiClient() + # A text-mode file containing bytes that don't survive UTF-8 roundtrip + text_file = io.StringIO("é") + text_file.name = "note.txt" + with pytest.raises(TypeError): + client._build_multipart_body({"upload": text_file}, "boundary") + + def test_explicit_str_tuple_content_is_rejected(self) -> None: + client = DefaultApiClient() + with pytest.raises(TypeError): + client._build_multipart_body({"upload": ("file.bin", "hello")}, "boundary") + + def test_high_byte_binary_content_is_preserved(self) -> None: + client = DefaultApiClient() + payload = bytes(range(256)) + body = client._build_multipart_body({"upload": payload}, "boundary") + # The payload must appear verbatim in the body + assert payload in body + + def test_tuple_with_filename_emits_filename_and_mime(self) -> None: + client = DefaultApiClient() + body = client._build_multipart_body( + {"upload": ("file.pdf", b"%PDF-1.4")}, "boundary" + ) + assert b'filename="file.pdf"' in body + assert b"Content-Type: application/pdf" in body + assert b"%PDF-1.4" in body + + +class _FakeResp: + """Minimal response double for exercising the redirect loop without + standing up a real HTTP server. ``read``/``release_conn`` mirror the + urllib3 contract the loop relies on.""" + + def __init__(self, status: int, headers: dict[str, Any]) -> None: + self.status = status + self.headers = headers + + def read(self) -> bytes: + return b"" + + def release_conn(self) -> None: + return None + + +class TestNoRedirectOnTokenPost: + """3.2: ``no_redirect=True`` must NOT follow redirects. The first 3xx + response is returned to the caller verbatim (status/body/headers) rather + than being thrown. The OAuth2 token manager inspects and rejects the 3xx + itself, so the credential body is never silently replayed -- but the + transport's job is simply to return the response as-is.""" + + def _make_pool(self, responses: list[Any]) -> Any: + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + self._responses = list(responses) + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, dict(kwargs.get("headers") or {}))) + return self._responses.pop(0) + + return _Pool() + + def test_307_returned_as_is_when_no_redirect(self) -> None: + transport = TransportOptions.builder().follow_redirects(True).build() + pool = self._make_pool( + [ + _FakeResp(307, {"location": "https://attacker.example.com/steal"}), + ] + ) + client = DefaultApiClient(transport, pool_manager=pool) + result = client.send_request( + "POST", + "https://auth.example.com/token", + {"Content-Type": "application/x-www-form-urlencoded"}, + "grant_type=client_credentials&client_id=x&client_secret=y", + no_redirect=True, + ) + # The 3xx is returned verbatim and the replay request to the + # attacker host must never have been issued. + assert result.status_code == 307 + assert result.headers.get("location") == "https://attacker.example.com/steal" + assert len(pool.calls) == 1 + + def test_308_returned_as_is_when_no_redirect(self) -> None: + transport = TransportOptions.builder().follow_redirects(True).build() + pool = self._make_pool( + [ + _FakeResp(308, {"location": "https://attacker.example.com/steal"}), + ] + ) + client = DefaultApiClient(transport, pool_manager=pool) + result = client.send_request( + "POST", + "https://auth.example.com/token", + {"Content-Type": "application/x-www-form-urlencoded"}, + "grant_type=password&username=u&password=p", + no_redirect=True, + ) + assert result.status_code == 308 + assert len(pool.calls) == 1 + + def test_303_returned_as_is_when_no_redirect(self) -> None: + # no_redirect disables redirect following entirely, so even a 303 + # is returned to the caller rather than coerced-to-GET and followed. + transport = TransportOptions.builder().follow_redirects(True).build() + pool = self._make_pool( + [ + _FakeResp(303, {"location": "https://auth.example.com/done"}), + ] + ) + client = DefaultApiClient(transport, pool_manager=pool) + result = client.send_request( + "POST", + "https://auth.example.com/token", + {"Content-Type": "application/x-www-form-urlencoded"}, + "grant_type=client_credentials", + no_redirect=True, + ) + assert result.status_code == 303 + assert len(pool.calls) == 1 + + def test_no_redirect_does_not_affect_normal_request(self) -> None: + # Without no_redirect, 307 follows normally (replays the body). + transport = TransportOptions.builder().follow_redirects(True).build() + pool = self._make_pool( + [ + _FakeResp(307, {"location": "https://api.example.com/v2/echo"}), + _FakeResp(200, {}), + ] + ) + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "POST", + "https://api.example.com/v1/echo", + {"Content-Type": "application/json"}, + '{"hello":"world"}', + ) + assert len(pool.calls) == 2 + + +class TestBodyReplayOnTlsDowngrade: + """3.3: an HTTPS -> HTTP downgrade must NOT silently replay a request + body over plaintext. The existing Authorization-strip guard covers the + credential header path; this guard covers the body itself.""" + + def test_307_downgrade_with_body_raises(self) -> None: + from zitadel_client.errors import ApiException + + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url)) + if len(self.calls) == 1: + return _FakeResp(307, {"location": "http://example.com/insecure"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + with pytest.raises(ApiException) as excinfo: + client.send_request( + "POST", + "https://example.com/secure", + {"Content-Type": "application/json"}, + '{"secret":"value"}', + ) + assert "downgrade" in str(excinfo.value.message or "").lower() + # A refused redirect is a response that could not be used: an + # ApiException with the 3xx status, never a NetworkException. + assert type(excinfo.value) is ApiException + assert excinfo.value.status_code == 307 + # The replay over plaintext must never have happened. + assert len(pool.calls) == 1 + + def test_308_downgrade_with_body_raises(self) -> None: + from zitadel_client.errors import ApiException + + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url)) + if len(self.calls) == 1: + return _FakeResp(308, {"location": "http://example.com/insecure"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + with pytest.raises(ApiException): + client.send_request( + "PUT", + "https://example.com/secure", + {"Content-Type": "application/json"}, + '{"secret":"value"}', + ) + assert len(pool.calls) == 1 + + def test_303_downgrade_with_body_is_allowed(self) -> None: + # 303 coerces to GET and drops the body, so plaintext replay is + # not a concern. The Authorization-strip guard still runs. + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, dict(kwargs.get("headers") or {}))) + if len(self.calls) == 1: + return _FakeResp(303, {"location": "http://example.com/done"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "POST", + "https://example.com/secure", + {"Content-Type": "application/json"}, + '{"x":1}', + ) + assert len(pool.calls) == 2 + assert pool.calls[1][0] == "GET" + + def test_http_to_https_upgrade_with_body_is_allowed(self) -> None: + # Upgrade is not a downgrade; the body must replay normally. + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, kwargs.get("body"))) + if len(self.calls) == 1: + return _FakeResp(307, {"location": "https://example.com/secure"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "POST", + "http://example.com/insecure", + {"Content-Type": "application/json"}, + '{"x":1}', + ) + assert len(pool.calls) == 2 + + +class TestContentLengthStrippedOnRedirect: + """3.4: the 303-coerce-to-GET (and 301/302 method-demotion) branch must + drop ``Content-Length`` along with the body, otherwise the follow-up + GET arrives advertising a Content-Length the server expects but the + request never sends.""" + + def test_303_drops_content_length_when_body_is_dropped(self) -> None: + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, dict(kwargs.get("headers") or {}))) + if len(self.calls) == 1: + return _FakeResp(303, {"location": "https://example.com/done"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "POST", + "https://example.com/start", + {"Content-Type": "application/json", "Content-Length": "11"}, + '{"x":"yz"}', + ) + assert len(pool.calls) == 2 + followup_headers = pool.calls[1][2] + assert not any(k.lower() == "content-length" for k in followup_headers), ( + f"Content-Length must be stripped on 303->GET; got {followup_headers!r}" + ) + assert not any(k.lower() == "content-type" for k in followup_headers) + + def test_302_post_to_get_drops_content_length(self) -> None: + # 302 on a POST demotes to GET in our loop (mirrors browser behaviour + # and the other 11 SDKs). The body and its length headers must go. + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, dict(kwargs.get("headers") or {}))) + if len(self.calls) == 1: + return _FakeResp(302, {"location": "https://example.com/done"}) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "POST", + "https://example.com/start", + {"Content-Type": "application/json", "Content-Length": "5"}, + '{"a":1}', + ) + assert len(pool.calls) == 2 + assert pool.calls[1][0] == "GET" + followup_headers = pool.calls[1][2] + assert not any(k.lower() == "content-length" for k in followup_headers) + + +class TestRedirectExhaustion: + """Exceeding ``max_redirects`` must raise a typed ApiException ("too many + redirects") rather than silently returning the final 3xx as a normal + response.""" + + def test_exhausting_redirect_budget_raises(self) -> None: + from zitadel_client.errors import ApiException + + class _Pool: + def request(self, method: str, url: str, **kwargs: Any) -> Any: + # Always answer with another redirect so the budget is exhausted. + return _FakeResp(302, {"location": "https://example.com/next"}) + + transport = ( + TransportOptions.builder().follow_redirects(True).max_redirects(3).build() + ) + client = DefaultApiClient(transport, pool_manager=_Pool()) + with pytest.raises(ApiException) as excinfo: + client.send_request("GET", "https://example.com/start", {}, None) + assert "too many redirects" in str(excinfo.value.message or "").lower() + assert type(excinfo.value) is ApiException + assert excinfo.value.status_code in (301, 302, 303, 307, 308) + + def test_terminal_redirect_without_location_does_not_raise(self) -> None: + # A 3xx with no Location header is a legitimate terminal response and + # must NOT be treated as redirect exhaustion. + class _Pool: + def request(self, method: str, url: str, **kwargs: Any) -> Any: + return _FakeResp(302, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + client = DefaultApiClient(transport, pool_manager=_Pool()) + response = client.send_request("GET", "https://example.com/start", {}, None) + assert response.status_code == 302 + + +class TestUseAfterClose: + """Calling ``send_request`` after ``close()`` is a wrong call order: it + must raise the invalid-state RuntimeError rather than a foreign urllib3 + error or silently succeeding.""" + + def test_send_after_close_raises_runtime_error(self) -> None: + from zitadel_client.errors import ZitadelException + + class _Pool: + def __init__(self) -> None: + self.calls = 0 + + def clear(self) -> None: + return None + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls += 1 + return _FakeResp(200, {}) + + pool = _Pool() + client = DefaultApiClient(pool_manager=pool) + client.close() + with pytest.raises(RuntimeError) as excinfo: + client.send_request("GET", "https://example.com/x", {}, None) + assert type(excinfo.value) is RuntimeError + assert not isinstance(excinfo.value, ZitadelException) + # The request must never have been issued against the closed client. + assert pool.calls == 0 + + def test_close_is_idempotent(self) -> None: + client = DefaultApiClient() + client.close() + client.close() + + +class TestBodyReadErrorWrapped: + """A failure DURING the response body read (after headers are received) + must be wrapped in the SDK NetworkException, not leak the raw urllib3 error.""" + + def test_body_read_error_is_wrapped_in_network_exception(self) -> None: + import urllib3 + import urllib3.exceptions + from zitadel_client.errors import NetworkException + + class _ReadFailResp: + status = 200 + headers: ClassVar[dict[str, Any]] = {} + + def read(self) -> bytes: + raise urllib3.exceptions.ProtocolError("connection broken mid-body") + + def release_conn(self) -> None: + return None + + class _Pool: + def request(self, method: str, url: str, **kwargs: Any) -> Any: + return _ReadFailResp() + + transport = TransportOptions.builder().follow_redirects(False).build() + client = DefaultApiClient(transport, pool_manager=_Pool()) + with pytest.raises(NetworkException) as excinfo: + client.send_request("GET", "https://example.com/x", {}, None) + assert excinfo.value.status_code == 0 + # The underlying urllib3 error is preserved as the cause. + assert isinstance(excinfo.value.__cause__, urllib3.exceptions.HTTPError) + + +class TestNetworkErrors: + """A request that gets no HTTP response raises NetworkException, and one + that times out raises NetworkTimeoutException, both with status 0.""" + + def test_connection_refused_raises_network_exception(self) -> None: + import socket + from zitadel_client.errors import ( + ApiException, + NetworkException, + NetworkTimeoutException, + ) + + with socket.socket() as probe: + probe.bind(("127.0.0.1", 0)) + port = probe.getsockname()[1] + client = DefaultApiClient() + with pytest.raises(NetworkException) as excinfo: + client.send_request("GET", f"http://127.0.0.1:{port}/x", {}, None) + assert type(excinfo.value) is NetworkException + assert not isinstance(excinfo.value, NetworkTimeoutException) + assert isinstance(excinfo.value, ApiException) + assert excinfo.value.status_code == 0 + assert excinfo.value.__cause__ is not None + + def test_unparseable_url_raises_value_error(self) -> None: + # A request URL urllib3 cannot parse is a caller mistake: ValueError, + # never a NetworkException. + from zitadel_client.errors import ZitadelException + + client = DefaultApiClient() + with pytest.raises(ValueError) as excinfo: + client.send_request("GET", "http://[bad", {}, None) + assert not isinstance(excinfo.value, ZitadelException) + + def test_read_timeout_raises_network_timeout_exception(self) -> None: + import urllib3 + import urllib3.exceptions + from zitadel_client.errors import NetworkException, NetworkTimeoutException + + class _Pool: + def request(self, method: str, url: str, **kwargs: Any) -> Any: + no_pool: Any = None + raise urllib3.exceptions.MaxRetryError( + no_pool, + url, + urllib3.exceptions.ReadTimeoutError(no_pool, url, "read timed out"), + ) + + client = DefaultApiClient(pool_manager=_Pool()) + with pytest.raises(NetworkTimeoutException) as excinfo: + client.send_request("GET", "https://example.com/x", {}, None) + assert type(excinfo.value) is NetworkTimeoutException + assert isinstance(excinfo.value, NetworkException) + assert excinfo.value.status_code == 0 + assert isinstance(excinfo.value.__cause__, urllib3.exceptions.MaxRetryError) + + def test_connect_timeout_raises_network_timeout_exception(self) -> None: + # The single `urllib3.Timeout(total=...)` the client sets covers both + # the connect and the read phase, and urllib3 raises a different error + # for each. Both are the same expired deadline, so both must be a + # NetworkTimeoutException -- and the connect branch sits behind the + # NewConnectionError check, whose subclassing could invert on an + # upgrade. + import urllib3 + import urllib3.exceptions + from zitadel_client.errors import NetworkException, NetworkTimeoutException + + class _Pool: + def request(self, method: str, url: str, **kwargs: Any) -> Any: + no_pool: Any = None + raise urllib3.exceptions.MaxRetryError( + no_pool, + url, + urllib3.exceptions.ConnectTimeoutError( + no_pool, "connect timed out" + ), + ) + + client = DefaultApiClient(pool_manager=_Pool()) + with pytest.raises(NetworkTimeoutException) as excinfo: + client.send_request("GET", "https://example.com/x", {}, None) + assert type(excinfo.value) is NetworkTimeoutException + assert isinstance(excinfo.value, NetworkException) + assert excinfo.value.status_code == 0 + assert isinstance(excinfo.value.__cause__, urllib3.exceptions.MaxRetryError) + + +class TestCaCertPathFailsFast: + """An explicitly configured CA certificate path that cannot be read or + parsed must fail fast at construction with a ValueError rather than + silently falling back to the system trust store (security theater).""" + + def test_nonexistent_ca_cert_path_raises_value_error(self) -> None: + from zitadel_client.errors import ZitadelException + + transport = ( + TransportOptions.builder().ca_cert_path("/nonexistent/ca.pem").build() + ) + with pytest.raises(ValueError) as excinfo: + DefaultApiClient(transport) + assert type(excinfo.value) is ValueError + assert not isinstance(excinfo.value, ZitadelException) + + +class TestApiKeyHeaderStrippedOnCrossOrigin: + """3.1: spec-declared API-key header names are added to the cross-origin + sensitive-header allowlist at codegen time. When the spec declares no + apiKey-in-header schemes the allowlist is just the default trio.""" + + def test_default_sensitive_headers_includes_canonical_three(self) -> None: + from zitadel_client.default_api_client import DefaultApiClient + + assert "authorization" in DefaultApiClient._SENSITIVE_HEADERS + assert "cookie" in DefaultApiClient._SENSITIVE_HEADERS + assert "proxy-authorization" in DefaultApiClient._SENSITIVE_HEADERS + + def test_authorization_stripped_on_cross_origin_redirect(self) -> None: + # The static credential trio is always stripped on a cross-origin hop + # regardless of whether the spec declared any apiKey-in-header schemes. + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url, dict(kwargs.get("headers") or {}))) + if len(self.calls) == 1: + return _FakeResp( + 302, {"location": "https://other.example.com/dest"} + ) + return _FakeResp(200, {}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + client.send_request( + "GET", + "https://example.com/start", + {"Authorization": "Bearer secret", "X-Trace": "keep"}, + None, + ) + assert len(pool.calls) == 2 + followup_headers = pool.calls[1][2] + assert not any(k.lower() == "authorization" for k in followup_headers), ( + f"Authorization leaked on cross-origin redirect: {followup_headers!r}" + ) + # Non-sensitive headers must survive the hop. + assert any(k.lower() == "x-trace" for k in followup_headers) + + +class TestRedirectToNonHttpScheme: + """A Location pointing at a non-http(s) scheme (file:, javascript:, data:) + must be refused with a typed ApiException rather than silently returned.""" + + def test_non_http_scheme_redirect_raises(self) -> None: + from zitadel_client.errors import ApiException + + class _Pool: + def __init__(self) -> None: + self.calls: list[Any] = [] + + def request(self, method: str, url: str, **kwargs: Any) -> Any: + self.calls.append((method, url)) + return _FakeResp(302, {"location": "file:///etc/passwd"}) + + transport = TransportOptions.builder().follow_redirects(True).build() + pool = _Pool() + client = DefaultApiClient(transport, pool_manager=pool) + with pytest.raises(ApiException) as excinfo: + client.send_request("GET", "https://example.com/start", {}, None) + assert "non-http" in str(excinfo.value.message or "").lower() + assert type(excinfo.value) is ApiException + assert excinfo.value.status_code == 302 + # The non-http(s) target must never have been contacted. + assert len(pool.calls) == 1 diff --git a/test/test_header_selector.py b/test/test_header_selector.py new file mode 100644 index 00000000..2f27758f --- /dev/null +++ b/test/test_header_selector.py @@ -0,0 +1,175 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +""" +Unit tests for HeaderSelector. + +These tests verify that the Accept header is built by joining the acceptable +MIME types in their original declaration order, with no quality weights. +""" + +import pytest +from typing import Any +from zitadel_client.header_selector import HeaderSelector + + +class TestIsJsonMime: + """Tests for is_json_mime method.""" + + @pytest.fixture + def header_selector(self) -> HeaderSelector: + return HeaderSelector() + + def test_should_return_true_for_application_json( + self, header_selector: Any + ) -> None: + assert header_selector.is_json_mime("application/json") is True + + def test_should_return_true_for_application_json_with_charset( + self, header_selector: Any + ) -> None: + assert header_selector.is_json_mime("application/json; charset=UTF-8") is True + + def test_should_return_true_for_uppercase_application_json( + self, header_selector: Any + ) -> None: + assert header_selector.is_json_mime("APPLICATION/JSON") is True + + def test_should_return_true_for_vendor_json_types( + self, header_selector: Any + ) -> None: + assert header_selector.is_json_mime("application/vnd.api+json") is True + assert header_selector.is_json_mime("application/vnd.company+json") is True + assert header_selector.is_json_mime("application/hal+json") is True + + def test_should_return_false_for_text_html(self, header_selector: Any) -> None: + assert header_selector.is_json_mime("text/html") is False + + def test_should_return_false_for_application_xml( + self, header_selector: Any + ) -> None: + assert header_selector.is_json_mime("application/xml") is False + + def test_should_return_false_for_none(self, header_selector: Any) -> None: + assert header_selector.is_json_mime(None) is False + + def test_should_return_false_for_empty_string(self, header_selector: Any) -> None: + assert header_selector.is_json_mime("") is False + + +class TestSelectAcceptHeader: + """Tests for _select_accept_header method.""" + + @pytest.fixture + def header_selector(self) -> HeaderSelector: + return HeaderSelector() + + def test_should_return_empty_string_for_none_input( + self, header_selector: Any + ) -> None: + assert header_selector._select_accept_header(None) == "" + + def test_should_return_empty_string_for_empty_list( + self, header_selector: Any + ) -> None: + assert header_selector._select_accept_header([]) == "" + + def test_should_return_empty_string_when_all_entries_filtered_out( + self, header_selector: Any + ) -> None: + assert header_selector._select_accept_header(["", None]) == "" + + def test_should_return_single_accept_as_is(self, header_selector: Any) -> None: + assert ( + header_selector._select_accept_header(["application/json"]) + == "application/json" + ) + + def test_should_return_single_non_json_accept_as_is( + self, header_selector: Any + ) -> None: + assert header_selector._select_accept_header(["text/html"]) == "text/html" + + def test_should_join_in_declaration_order(self, header_selector: Any) -> None: + result = header_selector._select_accept_header( + ["image/jpeg", "image/png", "application/json"] + ) + assert result == "image/jpeg, image/png, application/json" + + def test_should_not_reorder_or_prioritize_json(self, header_selector: Any) -> None: + result = header_selector._select_accept_header( + ["text/html", "application/json"] + ) + # No JSON-first reordering, no quality weights. + assert result == "text/html, application/json" + + def test_should_filter_out_empty_entries_and_join_rest( + self, header_selector: Any + ) -> None: + result = header_selector._select_accept_header(["", "application/json", None]) + assert result == "application/json" + + def test_should_drop_whitespace_only_entries(self, header_selector: Any) -> None: + result = header_selector._select_accept_header([" ", "application/json"]) + assert result == "application/json" + + def test_should_not_add_quality_weights(self, header_selector: Any) -> None: + result = header_selector._select_accept_header( + ["text/html", "text/plain", "application/json"] + ) + assert "q=" not in result + assert result == "text/html, text/plain, application/json" + + +class TestSelectHeaders: + """Tests for select_headers method.""" + + @pytest.fixture + def header_selector(self) -> HeaderSelector: + return HeaderSelector() + + def test_should_set_accept_header_when_accepts_provided( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers( + ["application/json"], "application/json", False + ) + assert headers.get("Accept") == "application/json" + + def test_should_not_set_accept_header_when_accepts_empty( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers([], "application/json", False) + assert headers.get("Accept") is None + + def test_should_set_content_type_header_when_not_multipart( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers( + ["application/json"], "application/json", False + ) + assert headers.get("Content-Type") == "application/json" + + def test_should_not_set_content_type_header_when_multipart( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers( + ["application/json"], "application/json", True + ) + assert headers.get("Content-Type") is None + + def test_should_default_content_type_to_application_json_when_empty( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers(["application/json"], "", False) + assert headers.get("Content-Type") == "application/json" + + def test_should_default_content_type_to_application_json_when_none( + self, header_selector: Any + ) -> None: + headers = header_selector.select_headers(["application/json"], None, False) + assert headers.get("Content-Type") == "application/json" diff --git a/test/test_server_configuration.py b/test/test_server_configuration.py new file mode 100644 index 00000000..54dc2d02 --- /dev/null +++ b/test/test_server_configuration.py @@ -0,0 +1,71 @@ +import pytest + +from zitadel_client.errors import ZitadelException +from zitadel_client.server_configuration import ServerConfiguration, ServerVariable + + +class TestServerConfiguration: + def test_resolves_url_template_using_default_variable_values(self) -> None: + config = ServerConfiguration( + url_template="https://{env}.api.example.com/v{version}", + description="primary server", + variables={ + "env": ServerVariable( + default_value="prod", enum_values=["prod", "staging"] + ), + "version": ServerVariable(default_value="1"), + }, + ) + + assert config.get_url() == "https://prod.api.example.com/v1" + + def test_applies_overrides_and_falls_back_to_defaults_for_unset_variables( + self, + ) -> None: + # "env" is overridden, "version" is left to its default — the resolved + # URL must mix both. + config = ServerConfiguration( + url_template="https://{env}.api.example.com/v{version}", + variables={ + "env": ServerVariable( + default_value="prod", enum_values=["prod", "staging"] + ), + "version": ServerVariable(default_value="1"), + }, + ) + + assert ( + config.get_url({"env": "staging"}) == "https://staging.api.example.com/v1" + ) + + def test_exposes_raw_url_template_and_description(self) -> None: + config = ServerConfiguration( + url_template="https://{env}.api.example.com", + description="primary server", + variables={"env": ServerVariable(default_value="prod")}, + ) + + assert config.url_template == "https://{env}.api.example.com" + assert config.description == "primary server" + + def test_rejects_override_value_outside_the_variable_enum(self) -> None: + # server-variable-enum-validation: an override that is not in the + # variable's enum is rejected at resolution time. + config = ServerConfiguration( + url_template="https://{env}.api.example.com", + variables={ + "env": ServerVariable( + default_value="prod", enum_values=["prod", "staging"] + ), + }, + ) + + with pytest.raises(ValueError) as exc_info: + config.get_url({"env": "dev"}) + assert type(exc_info.value) is ValueError + assert not isinstance(exc_info.value, ZitadelException) + + def test_template_without_variables_is_returned_verbatim(self) -> None: + config = ServerConfiguration(url_template="https://api.example.com") + + assert config.get_url() == "https://api.example.com" diff --git a/test/test_server_variable.py b/test/test_server_variable.py new file mode 100644 index 00000000..0996fe2e --- /dev/null +++ b/test/test_server_variable.py @@ -0,0 +1,39 @@ +from zitadel_client.server_configuration import ServerVariable + + +class TestServerVariable: + def test_exposes_default_value_when_no_override_is_applied(self) -> None: + # The default value is what ServerConfiguration falls back to when a + # variable is left unset, so it must be carried through verbatim. + var = ServerVariable(default_value="v1", description="API version") + + assert var.default_value == "v1" + assert var.description == "API version" + + def test_omitted_enum_values_becomes_empty_list_meaning_any_value_allowed( + self, + ) -> None: + var = ServerVariable(default_value="prod") + + assert var.enum_values == [] + assert var.description is None + + def test_enum_values_are_exposed_for_validation(self) -> None: + # ServerConfiguration validates overrides against this set, so the + # enum list must surface exactly the allowed values. + var = ServerVariable( + default_value="prod", + description="deployment environment", + enum_values=["prod", "staging"], + ) + + assert var.enum_values == ["prod", "staging"] + assert "prod" in var.enum_values + assert "staging" in var.enum_values + + def test_enum_does_not_contain_a_value_outside_the_allowed_set(self) -> None: + # An out-of-set value (e.g. "dev") is absent from the enum, which is + # what drives ServerConfiguration to reject it. + var = ServerVariable(default_value="prod", enum_values=["prod", "staging"]) + + assert "dev" not in var.enum_values diff --git a/test/test_trace_context_util.py b/test/test_trace_context_util.py new file mode 100644 index 00000000..70bd9f0d --- /dev/null +++ b/test/test_trace_context_util.py @@ -0,0 +1,136 @@ +"""Unit tests for TraceContextUtil.""" + +import re + +from opentelemetry import trace +from opentelemetry.context import Context +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import SimpleSpanProcessor +from opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporter +from opentelemetry.sdk.trace.sampling import ALWAYS_OFF, ALWAYS_ON, Sampler +from opentelemetry.trace import ( + NonRecordingSpan, + SpanContext, + TraceFlags, + TraceState, + Tracer, +) + +from zitadel_client.trace_context_util import inject_trace_context + + +class TestInjectTraceContext: + """Tests for inject_trace_context function.""" + + def test_no_op_without_tracer(self) -> None: + headers: dict[str, str] = {} + inject_trace_context(headers) + + def test_empty_headers_do_not_cause_exception(self) -> None: + headers: dict[str, str] = {} + inject_trace_context(headers) + assert len(headers) == 0 + + def test_does_not_inject_traceparent_without_otel(self) -> None: + headers: dict[str, str] = {} + inject_trace_context(headers) + assert "traceparent" not in headers + + def test_does_not_inject_tracestate_without_otel(self) -> None: + headers: dict[str, str] = {} + inject_trace_context(headers) + assert "tracestate" not in headers + + def test_preserves_authorization_header(self) -> None: + headers: dict[str, str] = {"Authorization": "Bearer token123"} + inject_trace_context(headers) + assert headers["Authorization"] == "Bearer token123" + + def test_preserves_content_type_header(self) -> None: + headers: dict[str, str] = {"Content-Type": "application/json"} + inject_trace_context(headers) + assert headers["Content-Type"] == "application/json" + + def test_preserves_x_request_id_header(self) -> None: + headers: dict[str, str] = {"X-Request-ID": "req-12345"} + inject_trace_context(headers) + assert headers["X-Request-ID"] == "req-12345" + + def test_preserves_all_existing_headers(self) -> None: + headers: dict[str, str] = { + "Authorization": "Bearer token", + "Content-Type": "application/json", + "X-Request-ID": "abc-123", + } + inject_trace_context(headers) + assert len(headers) == 3 + assert headers["Authorization"] == "Bearer token" + assert headers["Content-Type"] == "application/json" + assert headers["X-Request-ID"] == "abc-123" + + def test_injects_traceparent_when_span_active(self) -> None: + tracer, exporter = _sdk_tracer() + headers: dict[str, str] = {} + with tracer.start_as_current_span("request") as span: + inject_trace_context(headers) + ctx = span.get_span_context() + assert ( + headers["traceparent"] + == f"00-{ctx.trace_id:032x}-{ctx.span_id:016x}-{ctx.trace_flags:02x}" + ) + assert [s.name for s in exporter.get_finished_spans()] == ["request"] + + def test_includes_tracestate_when_present(self) -> None: + tracer, _ = _sdk_tracer() + parent = _remote_parent(TraceState([("vendor", "value")])) + headers: dict[str, str] = {} + with tracer.start_as_current_span("request", context=parent): + inject_trace_context(headers) + assert headers["tracestate"] == "vendor=value" + + def test_omits_tracestate_when_empty(self) -> None: + tracer, _ = _sdk_tracer() + headers: dict[str, str] = {} + with tracer.start_as_current_span("request"): + inject_trace_context(headers) + assert "traceparent" in headers + assert "tracestate" not in headers + + def test_formats_trace_flags_correctly(self) -> None: + sampled, _ = _sdk_tracer() + unsampled, _ = _sdk_tracer(ALWAYS_OFF) + sampled_headers: dict[str, str] = {} + unsampled_headers: dict[str, str] = {} + with sampled.start_as_current_span("sampled"): + inject_trace_context(sampled_headers) + with unsampled.start_as_current_span("unsampled"): + inject_trace_context(unsampled_headers) + sampled_flags = sampled_headers["traceparent"].split("-")[3] + unsampled_flags = unsampled_headers["traceparent"].split("-")[3] + # Two lowercase hex digits; the low bit is the sampled flag. + assert re.fullmatch("[0-9a-f]{2}", sampled_flags) + assert re.fullmatch("[0-9a-f]{2}", unsampled_flags) + assert int(sampled_flags, 16) & TraceFlags.SAMPLED == TraceFlags.SAMPLED + assert int(unsampled_flags, 16) & TraceFlags.SAMPLED == 0 + + +def _sdk_tracer(sampler: Sampler = ALWAYS_ON) -> tuple[Tracer, InMemorySpanExporter]: + """A tracer from a real OpenTelemetry SDK provider that records every + finished span in memory, so the test controls the active span.""" + exporter = InMemorySpanExporter() + provider = TracerProvider(sampler=sampler) + provider.add_span_processor(SimpleSpanProcessor(exporter)) + return provider.get_tracer("trace-context-test"), exporter + + +def _remote_parent(trace_state: TraceState) -> Context: + """A context whose active span is a sampled remote parent carrying the + given tracestate, which a child span inherits.""" + parent = SpanContext( + trace_id=0x0AF7651916CD43DD8448EB211C80319C, + span_id=0xB7AD6B7169203331, + is_remote=True, + trace_flags=TraceFlags(TraceFlags.SAMPLED), + trace_state=trace_state, + ) + return trace.set_span_in_context(NonRecordingSpan(parent)) diff --git a/test/test_transport_options.py b/test/test_transport_options.py index 92601208..83b50476 100644 --- a/test/test_transport_options.py +++ b/test/test_transport_options.py @@ -1,39 +1,177 @@ -import unittest +import pytest +from types import MappingProxyType +from zitadel_client.errors import ZitadelException from zitadel_client.transport_options import TransportOptions -class TransportOptionsTest(unittest.TestCase): - def test_defaults_returns_empty(self) -> None: - self.assertEqual({}, TransportOptions.defaults().to_session_kwargs()) +class TestTransportOptions: + def test_verify_ssl_defaults_to_true(self) -> None: + opts = TransportOptions.builder().build() + assert opts.verify_ssl is True - def test_insecure_sets_verify_false(self) -> None: - opts = TransportOptions(insecure=True) - self.assertEqual({"verify": False}, opts.to_session_kwargs()) + def test_ca_cert_path_defaults_to_none(self) -> None: + opts = TransportOptions.builder().build() + assert opts.ca_cert_path is None - def test_ca_cert_path_sets_verify(self) -> None: - opts = TransportOptions(ca_cert_path="/path/to/ca.pem") - self.assertEqual({"verify": "/path/to/ca.pem"}, opts.to_session_kwargs()) + def test_proxy_defaults_to_none(self) -> None: + opts = TransportOptions.builder().build() + assert opts.proxy is None - def test_proxy_url_sets_proxies(self) -> None: - opts = TransportOptions(proxy_url="http://proxy:3128") - self.assertEqual( - {"proxies": {"http": "http://proxy:3128", "https": "http://proxy:3128"}}, - opts.to_session_kwargs(), + def test_timeout_defaults_to_ten_seconds(self) -> None: + opts = TransportOptions.builder().build() + assert opts.timeout == 10000 + + def test_follow_redirects_defaults_to_true(self) -> None: + opts = TransportOptions.builder().build() + assert opts.follow_redirects is True + + def test_max_redirects_defaults_to_none(self) -> None: + opts = TransportOptions.builder().build() + assert opts.max_redirects is None + + def test_user_agent_defaults_to_non_empty_string(self) -> None: + opts = TransportOptions.builder().build() + assert opts.user_agent is not None + assert len(opts.user_agent) > 0 + + def test_default_headers_defaults_to_empty(self) -> None: + opts = TransportOptions.builder().build() + assert len(opts.default_headers) == 0 + + def test_inject_request_id_defaults_to_false(self) -> None: + opts = TransportOptions.builder().build() + assert opts.inject_request_id is False + + def test_builder_sets_all_fields(self) -> None: + opts = ( + TransportOptions.builder() + .verify_ssl(False) + .ca_cert_path("/path/to/ca.pem") + .proxy("http://proxy:8080") + .timeout(5000) + .follow_redirects(False) + .max_redirects(3) + .user_agent("TestAgent/1.0") + .default_header("X-Custom", "value") + .inject_request_id(True) + .build() + ) + + assert opts.verify_ssl is False + assert opts.ca_cert_path == "/path/to/ca.pem" + assert opts.proxy == "http://proxy:8080" + assert opts.timeout == 5000 + assert opts.follow_redirects is False + assert opts.max_redirects == 3 + assert opts.user_agent == "TestAgent/1.0" + assert opts.default_headers["X-Custom"] == "value" + assert opts.inject_request_id is True + + def test_follow_redirects_defaults_to_true_with_null_max_redirects(self) -> None: + opts = TransportOptions.builder().follow_redirects(True).build() + + assert opts.follow_redirects is True + assert opts.max_redirects is None + + def test_invalid_proxy_url_throws_exception(self) -> None: + with pytest.raises(ValueError) as exc_info: + TransportOptions.builder().proxy("not-a-url").build() + assert type(exc_info.value) is ValueError + assert not isinstance(exc_info.value, ZitadelException) + + def test_null_proxy_url_is_accepted(self) -> None: + opts = TransportOptions.builder().proxy(None).build() + assert opts.proxy is None + + def test_builder_methods_return_same_instance(self) -> None: + builder = TransportOptions.builder() + + assert builder.verify_ssl(True) is builder + assert builder.ca_cert_path(None) is builder + assert builder.proxy(None) is builder + assert builder.timeout(None) is builder + assert builder.follow_redirects(True) is builder + assert builder.max_redirects(None) is builder + assert builder.user_agent(None) is builder + assert builder.default_header("X-Key", "val") is builder + assert builder.default_headers({}) is builder + assert builder.inject_request_id(False) is builder + + def test_accumulates_headers_from_default_header_calls(self) -> None: + opts = ( + TransportOptions.builder() + .default_header("X-First", "one") + .default_header("X-Second", "two") + .build() + ) + + assert len(opts.default_headers) == 2 + assert opts.default_headers["X-First"] == "one" + assert opts.default_headers["X-Second"] == "two" + + def test_merges_headers_from_default_headers_call(self) -> None: + opts = ( + TransportOptions.builder() + .default_header("X-First", "one") + .default_headers({"X-Second": "two", "X-Third": "three"}) + .build() ) - def test_insecure_takes_precedence_over_ca_cert(self) -> None: - opts = TransportOptions(insecure=True, ca_cert_path="/nonexistent/ca.pem") - self.assertEqual({"verify": False}, opts.to_session_kwargs()) - - def test_immutability(self) -> None: - opts = TransportOptions.defaults() - with self.assertRaises(AttributeError): - opts.insecure = True # type: ignore[misc] - - def test_defaults_factory(self) -> None: - opts = TransportOptions.defaults() - self.assertEqual({}, dict(opts.default_headers)) - self.assertIsNone(opts.ca_cert_path) - self.assertFalse(opts.insecure) - self.assertIsNone(opts.proxy_url) + assert len(opts.default_headers) == 3 + assert opts.default_headers["X-First"] == "one" + assert opts.default_headers["X-Second"] == "two" + assert opts.default_headers["X-Third"] == "three" + + def test_modifying_source_map_does_not_affect_built_options(self) -> None: + headers = {"X-Original": "original"} + + opts = TransportOptions.builder().default_headers(headers).build() + + headers["X-Added"] = "added" + + assert len(opts.default_headers) == 1 + assert opts.default_headers["X-Original"] == "original" + assert "X-Added" not in opts.default_headers + assert isinstance(opts.default_headers, MappingProxyType) + + def test_builder_produces_independent_instances(self) -> None: + builder = TransportOptions.builder().verify_ssl(False) + first = builder.build() + second = builder.build() + + assert first.verify_ssl == second.verify_ssl + assert first is not second + + # TimeoutConfigTests + + def test_timeout_defaults_to_ten_seconds_in_timeout_group(self) -> None: + # Default TransportOptions has a 10s end-to-end timeout. + opts = TransportOptions.builder().build() + assert opts.timeout == 10000 + + def test_timeout_can_be_explicitly_disabled(self) -> None: + opts = TransportOptions.builder().timeout(None).build() + assert opts.timeout is None + + def test_setting_timeout_is_accessible(self) -> None: + opts = TransportOptions.builder().timeout(5000).build() + assert opts.timeout == 5000 + + def test_timeout_field_is_named_timeout(self) -> None: + # Verify via the attribute that the field is named 'timeout' + # (not e.g. 'connection_timeout' or 'open_timeout'). + opts = TransportOptions.builder().timeout(1000).build() + assert opts.timeout is not None + assert opts.timeout == 1000 + + # ProxyConfigTests + + def test_proxy_url_is_preserved_on_read_back(self) -> None: + opts = TransportOptions.builder().proxy("http://proxy.example.com:8080").build() + assert opts.proxy == "http://proxy.example.com:8080" + + def test_setting_proxy_is_supported_on_all_platforms(self) -> None: + # Proxy configuration must not raise on any platform. + opts = TransportOptions.builder().proxy("http://proxy.example.com:8080").build() + assert opts.proxy == "http://proxy.example.com:8080" diff --git a/test/test_value_serializer.py b/test/test_value_serializer.py new file mode 100644 index 00000000..98d11477 --- /dev/null +++ b/test/test_value_serializer.py @@ -0,0 +1,560 @@ +import datetime + +import pytest + +from zitadel_client.value_serializer import AllowReservedValue, ValueSerializer + + +class TestValueSerializerPath: + def test_null_returns_empty_string(self) -> None: + assert ValueSerializer.serialize(None, "path", "string") == "" + + def test_string_returns_url_encoded_value(self) -> None: + assert ValueSerializer.serialize("hello", "path", "string") == "hello" + + def test_string_with_spaces_is_url_encoded(self) -> None: + assert ( + ValueSerializer.serialize("hello world", "path", "string") + == "hello%20world" + ) + + def test_string_with_slash_is_url_encoded(self) -> None: + assert ValueSerializer.serialize("a/b", "path", "string") == "a%2Fb" + + def test_integer_returns_string(self) -> None: + assert ValueSerializer.serialize(42, "path", "integer") == "42" + + def test_boolean_true_returns_true(self) -> None: + assert ValueSerializer.serialize(True, "path", "boolean") == "true" + + def test_boolean_false_returns_false(self) -> None: + assert ValueSerializer.serialize(False, "path", "boolean") == "false" + + +class TestValueSerializerQuery: + def test_null_returns_none(self) -> None: + assert ValueSerializer.serialize(None, "query", "string") is None + + def test_string_returns_as_is(self) -> None: + assert ValueSerializer.serialize("hello", "query", "string") == "hello" + + def test_integer_returns_string(self) -> None: + assert ValueSerializer.serialize(42, "query", "integer") == "42" + + def test_boolean_true_returns_true(self) -> None: + assert ValueSerializer.serialize(True, "query", "boolean") == "true" + + def test_boolean_false_returns_false(self) -> None: + assert ValueSerializer.serialize(False, "query", "boolean") == "false" + + def test_array_joins_with_comma_by_default(self) -> None: + assert ValueSerializer.serialize(["a", "b", "c"], "query", "array") == "a,b,c" + + def test_array_joins_with_comma_for_csv(self) -> None: + assert ( + ValueSerializer.serialize(["a", "b", "c"], "query", "array", "csv") + == "a,b,c" + ) + + def test_array_joins_with_space_for_ssv(self) -> None: + assert ( + ValueSerializer.serialize(["a", "b", "c"], "query", "array", "ssv") + == "a b c" + ) + + def test_array_joins_with_tab_for_tsv(self) -> None: + assert ( + ValueSerializer.serialize(["a", "b", "c"], "query", "array", "tsv") + == "a\tb\tc" + ) + + def test_array_joins_with_pipe_for_pipes(self) -> None: + assert ( + ValueSerializer.serialize(["a", "b", "c"], "query", "array", "pipes") + == "a|b|c" + ) + + def test_array_returns_list_for_multi(self) -> None: + assert ValueSerializer.serialize( + ["a", "b", "c"], "query", "array", "multi" + ) == ["a", "b", "c"] + + def test_empty_array_returns_empty_string_for_csv(self) -> None: + assert ValueSerializer.serialize([], "query", "array") == "" + + def test_empty_array_returns_empty_list_for_multi(self) -> None: + assert ValueSerializer.serialize([], "query", "array", "multi") == [] + + def test_single_element_array_returns_single_value(self) -> None: + assert ValueSerializer.serialize(["a"], "query", "array") == "a" + + def test_array_of_integers_stringifies_elements(self) -> None: + assert ValueSerializer.serialize([1, 2, 3], "query", "array") == "1,2,3" + + def test_array_of_booleans_stringifies_elements(self) -> None: + assert ( + ValueSerializer.serialize([True, False], "query", "array") == "true,false" + ) + + +class TestValueSerializerHeader: + def test_null_returns_empty_string(self) -> None: + assert ValueSerializer.serialize(None, "header", "string") == "" + + def test_string_returns_as_is(self) -> None: + assert ValueSerializer.serialize("hello", "header", "string") == "hello" + + def test_integer_returns_string(self) -> None: + assert ValueSerializer.serialize(42, "header", "integer") == "42" + + def test_boolean_true_returns_true(self) -> None: + assert ValueSerializer.serialize(True, "header", "boolean") == "true" + + def test_array_joins_with_comma(self) -> None: + assert ValueSerializer.serialize(["a", "b", "c"], "header", "array") == "a,b,c" + + def test_empty_array_joins_to_empty_string(self) -> None: + assert ValueSerializer.serialize([], "header", "array") == "" + + def test_array_of_integers_stringifies_and_joins(self) -> None: + assert ValueSerializer.serialize([1, 2, 3], "header", "array") == "1,2,3" + + +class TestValueSerializerCookie: + def test_string_returns_as_is(self) -> None: + assert ValueSerializer.serialize("hello", "cookie", "string") == "hello" + + def test_null_returns_empty_string(self) -> None: + assert ValueSerializer.serialize(None, "cookie", "string") == "" + + +class TestValueSerializerForm: + def test_null_returns_empty_string(self) -> None: + assert ValueSerializer.serialize(None, "form", "string") == "" + + def test_string_returns_as_is(self) -> None: + assert ValueSerializer.serialize("hello", "form", "string") == "hello" + + def test_integer_returns_string(self) -> None: + assert ValueSerializer.serialize(42, "form", "integer") == "42" + + def test_boolean_true_returns_true(self) -> None: + assert ValueSerializer.serialize(True, "form", "boolean") == "true" + + def test_boolean_false_returns_false(self) -> None: + assert ValueSerializer.serialize(False, "form", "boolean") == "false" + + +class TestMatrixStyle: + def test_scalar_returns_semicolon_prefixed_name_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "blue", "path", "string", None, "matrix", True + ) + == ";color=blue" + ) + + def test_array_with_explode_false_joins_with_comma(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["blue", "black"], "path", "array", None, "matrix", False + ) + == ";color=blue,black" + ) + + def test_array_with_explode_true_repeats_name(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["blue", "black"], "path", "array", None, "matrix", True + ) + == ";color=blue;color=black" + ) + + def test_null_returns_empty_string(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", None, "path", "string", None, "matrix", True + ) + == "" + ) + + +class TestLabelStyle: + def test_scalar_returns_dot_prefixed_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "blue", "path", "string", None, "label", True + ) + == ".blue" + ) + + def test_array_with_explode_false_joins_with_comma(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["blue", "black"], "path", "array", None, "label", False + ) + == ".blue,black" + ) + + def test_array_with_explode_true_joins_with_dot(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["blue", "black"], "path", "array", None, "label", True + ) + == ".blue.black" + ) + + def test_null_returns_empty_string(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", None, "path", "string", None, "label", True + ) + == "" + ) + + +class TestSpaceDelimitedStyle: + def test_array_joins_with_space(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", + ["blue", "black"], + "query", + "array", + None, + "spaceDelimited", + False, + ) + == "blue black" + ) + + def test_array_with_explode_true_returns_list(self) -> None: + assert ValueSerializer.serialize_styled( + "color", ["blue", "black"], "query", "array", None, "spaceDelimited", True + ) == ["blue", "black"] + + def test_scalar_returns_stringified_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "blue", "query", "string", None, "spaceDelimited", False + ) + == "blue" + ) + + +class TestPipeDelimitedStyle: + def test_array_joins_with_pipe(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", + ["blue", "black"], + "query", + "array", + None, + "pipeDelimited", + False, + ) + == "blue|black" + ) + + def test_array_with_explode_true_returns_list(self) -> None: + assert ValueSerializer.serialize_styled( + "color", ["blue", "black"], "query", "array", None, "pipeDelimited", True + ) == ["blue", "black"] + + def test_scalar_returns_stringified_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "blue", "query", "string", None, "pipeDelimited", False + ) + == "blue" + ) + + +class TestFormStyleWithExplode: + def test_array_with_explode_false_joins_with_comma(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["blue", "black"], "query", "array", None, "form", False + ) + == "blue,black" + ) + + def test_array_with_explode_true_returns_list(self) -> None: + assert ValueSerializer.serialize_styled( + "color", ["blue", "black"], "query", "array", None, "form", True + ) == ["blue", "black"] + + def test_scalar_with_explode_true_returns_string_not_list(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "blue", "query", "string", None, "form", True + ) + == "blue" + ) + + def test_single_element_array_with_explode_true_returns_list(self) -> None: + assert ValueSerializer.serialize_styled( + "color", ["blue"], "query", "array", None, "form", True + ) == ["blue"] + + def test_null_returns_none_for_query(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", None, "query", "string", None, "form", True + ) + is None + ) + + +class TestSimpleStyleBackwardCompatibility: + def test_scalar_returns_stringified_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", "5", "path", "string", None, "simple", False + ) + == "5" + ) + + def test_array_joins_with_comma(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", ["3", "4", "5"], "path", "array", None, "simple", False + ) + == "3,4,5" + ) + + def test_null_returns_empty_string(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", None, "path", "string", None, "simple", True + ) + == "" + ) + + def test_scalar_url_encodes_for_path(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", "hello world", "path", "string", None, "simple", False + ) + == "hello%20world" + ) + + def test_path_serialization_is_final_and_must_not_be_double_encoded(self) -> None: + # The api template substitutes ``str(serialize_styled(...))`` directly + # into the path WITHOUT an additional ``quote()`` wrap. This guards + # against the double-encoding regression where a space became + # ``%2520`` and ``/`` became ``a%252Fb``. The serializer output here + # is the FINAL wire value -- re-encoding it would be wrong. + space = ValueSerializer.serialize_styled( + "id", "a b", "path", "string", None, "simple", False + ) + assert space == "a%20b" + from urllib.parse import quote + + # A second encode (the removed outer wrap) would corrupt it. + assert quote(str(space), safe="/;,=.~:!$&'()*+@") == "a%2520b" + assert space != "a%2520b" + + slash = ValueSerializer.serialize_styled( + "id", "a/b", "path", "string", None, "simple", False + ) + assert slash == "a%2Fb" + assert slash != "a%252Fb" + + +class TestNullStyleFallback: + def test_path_with_null_style_behaves_like_simple(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", "5", "path", "string", None, None, False + ) + == "5" + ) + + def test_empty_style_falls_back(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "id", "5", "path", "string", None, "", False + ) + == "5" + ) + + +class TestDeepObjectSerialization: + def test_basic_map_returns_bracketed_keys(self) -> None: + result = ValueSerializer.serialize_deep_object( + "filter", {"color": "blue", "size": "large"} + ) + assert result["filter[color]"] == "blue" + assert result["filter[size]"] == "large" + + def test_null_returns_empty_dict(self) -> None: + result = ValueSerializer.serialize_deep_object("filter", None) + assert result == {} + + +class TestAllowReserved: + """OAS ``allowReserved: true`` query encoding. + + Cross-language parity with the Java ``AllowReservedTests``. + """ + + def test_reserved_chars_preserved_other_chars_still_encoded(self) -> None: + assert ( + ValueSerializer.encode_query_allowing_reserved("v1.0/beta:rc1") + == "v1.0/beta:rc1" + ) + # Space is illegal in a URL and must still be percent-encoded even + # when reserved characters are preserved. + assert ValueSerializer.encode_query_allowing_reserved("a b:c") == "a%20b:c" + + def test_maybe_allow_reserved_wraps_only_when_allow_reserved_true(self) -> None: + assert ValueSerializer.maybe_allow_reserved("plain", False) == "plain" + wrapped = ValueSerializer.maybe_allow_reserved("v1/beta", True) + assert isinstance(wrapped, AllowReservedValue) + assert wrapped.value == "v1/beta" + assert ValueSerializer.maybe_allow_reserved(None, True) is None + + +class TestPathEncodingParity: + """Cross-language parity tests for path-segment percent-encoding. + + Every SDK must produce identical encoded strings for these inputs. + """ + + def test_ascii_safe_pass_through(self) -> None: + assert ValueSerializer.serialize("abc123", "path", "string") == "abc123" + + def test_space_encoded(self) -> None: + assert ValueSerializer.serialize("a b", "path", "string") == "a%20b" + + def test_slash_encoded(self) -> None: + assert ValueSerializer.serialize("a/b", "path", "string") == "a%2Fb" + + def test_question_mark_encoded(self) -> None: + assert ValueSerializer.serialize("a?b", "path", "string") == "a%3Fb" + + def test_hash_encoded(self) -> None: + assert ValueSerializer.serialize("a#b", "path", "string") == "a%23b" + + def test_comma_preserved(self) -> None: + assert ValueSerializer.serialize("a,b", "path", "string") == "a,b" + + def test_colon_preserved(self) -> None: + assert ValueSerializer.serialize("a:b", "path", "string") == "a:b" + + def test_plus_preserved(self) -> None: + assert ValueSerializer.serialize("a+b", "path", "string") == "a+b" + + def test_unicode_encoded(self) -> None: + assert ( + ValueSerializer.serialize("日本", "path", "string") == "%E6%97%A5%E6%9C%AC" + ) + + def test_empty_string_preserved(self) -> None: + assert ValueSerializer.serialize("", "path", "string") == "" + + def test_null_returns_empty(self) -> None: + assert ValueSerializer.serialize(None, "path", "string") == "" + + def test_simple_style_encodes_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "a b", "path", "string", None, "simple", False + ) + == "a%20b" + ) + + def test_simple_style_array_encodes_each_item(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", ["a b", "c?d"], "path", "array", None, "simple", False + ) + == "a%20b,c%3Fd" + ) + + def test_path_array_item_with_reserved_char_is_percent_encoded(self) -> None: + # Gap W1 regression: every per-item path value in a styled array + # must be percent-encoded BEFORE being joined with the structural + # separator. Otherwise '/', '?', '#', space leak into the URL. + items = ["a/b", "c"] + assert ( + ValueSerializer.serialize_styled( + "name", items, "path", "array", None, "simple", False + ) + == "a%2Fb,c" + ) + assert ( + ValueSerializer.serialize_styled( + "name", items, "path", "array", None, "label", True + ) + == ".a%2Fb.c" + ) + assert ( + ValueSerializer.serialize_styled( + "name", items, "path", "array", None, "matrix", False + ) + == ";name=a%2Fb,c" + ) + + def test_matrix_style_encodes_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "a b", "path", "string", None, "matrix", False + ) + == ";color=a%20b" + ) + + def test_label_style_encodes_value(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "a b", "path", "string", None, "label", False + ) + == ".a%20b" + ) + + def test_query_location_not_path_encoded(self) -> None: + assert ( + ValueSerializer.serialize_styled( + "color", "a b", "query", "string", None, "form", False + ) + == "a b" + ) + + def test_empty_string_path_param_raises(self) -> None: + # Gap W — empty-string path values silently produce malformed + # URLs like `/resource//details`; reject at serialization time so + # callers see the real error rather than a downstream 404. + with pytest.raises(ValueError): + ValueSerializer.serialize_styled( + "id", "", "path", "string", None, "simple", False + ) + + +class TestValueSerializerFormatDatePath: + """N3/W3 parity: ``format: date`` path parameters must emit a date-only + string (YYYY-MM-DD), not a full ISO datetime. Python models + ``format: date`` as ``datetime.date``, which the value serializer + formats via ``isoformat()``. + """ + + def test_date_in_path_returns_yyyy_mm_dd(self) -> None: + date = datetime.date(2024, 1, 15) + assert ValueSerializer.serialize(date, "path", "string") == "2024-01-15" + + def test_date_via_serialize_styled_simple_returns_yyyy_mm_dd(self) -> None: + date = datetime.date(2024, 1, 15) + assert ( + ValueSerializer.serialize_styled( + "since", date, "path", "string", None, "simple", False + ) + == "2024-01-15" + ) + + def test_date_at_year_boundary_emits_date_only(self) -> None: + # UTC/midnight edge: a date on the year boundary must serialize as a + # bare YYYY-MM-DD with no time/offset suffix, matching the + # stringifyDate UTC behaviour of Go/Node/Swift/Dart. + date = datetime.date(2024, 12, 31) + assert ValueSerializer.serialize(date, "path", "string") == "2024-12-31" diff --git a/test/test_zitadel.py b/test/test_zitadel.py index 394843ee..8dbc7b93 100644 --- a/test/test_zitadel.py +++ b/test/test_zitadel.py @@ -2,6 +2,8 @@ import inspect import os import pkgutil +import socket +import time import unittest import urllib.request from typing import Optional @@ -11,7 +13,15 @@ from testcontainers.core.wait_strategies import PortWaitStrategy from testcontainers.core.waiting_utils import wait_container_is_ready +from zitadel_client.auth.client_credentials_authenticator import ( + ClientCredentialsAuthenticator, +) from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator +from zitadel_client.auth.personal_access_token_authenticator import ( + PersonalAccessTokenAuthenticator, +) +from zitadel_client.errors import ClientException +from zitadel_client.errors.network_exception import NetworkException from zitadel_client.transport_options import TransportOptions from zitadel_client.zitadel import Zitadel @@ -26,11 +36,43 @@ def _wait_for_wiremock(host: str, port: str) -> None: raise ConnectionError(f"WireMock not ready: {resp.status}") +def _wait_for_ports( + container: DockerContainer, ports: list[int], timeout: float = 60.0 +) -> None: + """Block until every given container port is both published by Docker and + accepting TCP connections on the host. + + Both proxy ports must be reachable before their mapped ports are read: 3128 + is the open proxy and 3129 the same proxy gated by Basic credentials, and a + single-port wait can return while 3129 is still unmapped. + """ + host = container.get_container_host_ip() + deadline = time.time() + timeout + while True: + try: + for port in ports: + mapped = container.get_exposed_port(port) + if not mapped: + raise ConnectionError(f"port {port} not mapped yet") + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.settimeout(2) + sock.connect((host, int(mapped))) + return + except (OSError, ValueError, TypeError): + if time.time() > deadline: + raise TimeoutError( + f"Proxy ports {ports} did not become available in time" + ) + time.sleep(0.2) + + class ZitadelServicesTest(unittest.TestCase): def test_services_dynamic(self) -> None: expected = set() package = importlib.import_module("zitadel_client.api") - for _, modname, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): + for _, modname, _ in pkgutil.walk_packages( + package.__path__, package.__name__ + "." + ): module = importlib.import_module(modname) for _, obj in inspect.getmembers(module, inspect.isclass): if obj.__module__ == modname and obj.__name__.endswith("ServiceApi"): @@ -41,16 +83,19 @@ def test_services_dynamic(self) -> None: for attr in dir(zitadel) if not attr.startswith("_") and hasattr(getattr(zitadel, attr), "__class__") - and getattr(zitadel, attr).__class__.__module__.startswith("zitadel_client.api") + and getattr(zitadel, attr).__class__.__module__.startswith( + "zitadel_client.api" + ) } self.assertEqual(expected, actual) -class ZitadelTransportTest(unittest.TestCase): +class ZitadelTransportTest(unittest.IsolatedAsyncioTestCase): host: Optional[str] = None http_port: Optional[str] = None https_port: Optional[str] = None proxy_port: Optional[str] = None + proxy_auth_port: Optional[str] = None ca_cert_path: Optional[str] = None wiremock: DockerContainer = None proxy: DockerContainer = None @@ -69,14 +114,16 @@ def setup_class(cls) -> None: .with_network(cls.network) .with_network_aliases("wiremock") .with_exposed_ports(8080, 8443) - .with_volume_mapping(keystore_path, "/home/wiremock/keystore.p12", mode="ro") - .with_volume_mapping(os.path.join(FIXTURES_DIR, "mappings"), "/home/wiremock/mappings", mode="ro") + .with_volume_mapping( + keystore_path, "/home/wiremock/keystore.p12", mode="ro" + ) + .with_volume_mapping( + os.path.join(FIXTURES_DIR, "mappings"), + "/home/wiremock/mappings", + mode="ro", + ) .with_command( - "--https-port 8443" - " --https-keystore /home/wiremock/keystore.p12" - " --keystore-password password" - " --keystore-type PKCS12" - " --global-response-templating" + "--https-port 8443 --https-keystore /home/wiremock/keystore.p12 --keystore-password password --keystore-type PKCS12 --global-response-templating" ) ) cls.wiremock.start() @@ -84,7 +131,7 @@ def setup_class(cls) -> None: cls.proxy = ( DockerContainer("ubuntu/squid:6.10-24.10_beta") .with_network(cls.network) - .with_exposed_ports(3128) + .with_exposed_ports(3128, 3129) .with_volume_mapping(squid_conf, "/etc/squid/squid.conf", mode="ro") .waiting_for(PortWaitStrategy(3128)) ) @@ -93,7 +140,10 @@ def setup_class(cls) -> None: cls.host = cls.wiremock.get_container_host_ip() cls.http_port = cls.wiremock.get_exposed_port(8080) cls.https_port = cls.wiremock.get_exposed_port(8443) + + _wait_for_ports(cls.proxy, [3128, 3129]) cls.proxy_port = cls.proxy.get_exposed_port(3128) + cls.proxy_auth_port = cls.proxy.get_exposed_port(3129) _wait_for_wiremock(cls.host, cls.http_port) @@ -106,50 +156,94 @@ def teardown_class(cls) -> None: if cls.network is not None: cls.network.remove() - def test_custom_ca_cert(self) -> None: - zitadel = Zitadel.with_client_credentials( - f"https://{self.host}:{self.https_port}", - "dummy-client", - "dummy-secret", - transport_options=TransportOptions(ca_cert_path=self.ca_cert_path), + async def test_custom_ca_cert(self) -> None: + transport = TransportOptions(ca_cert_path=self.ca_cert_path) + zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + f"https://{self.host}:{self.https_port}", + "dummy-client", + "dummy-secret", + ).build(), + transport_options=transport, ) - response = zitadel.settings.get_general_settings({}) + response = await zitadel.settings_service.get_general_settings({}) self.assertEqual("https", response.default_language) - def test_insecure_mode(self) -> None: - zitadel = Zitadel.with_client_credentials( - f"https://{self.host}:{self.https_port}", - "dummy-client", - "dummy-secret", - transport_options=TransportOptions(insecure=True), + async def test_insecure_mode(self) -> None: + transport = TransportOptions(verify_ssl=False) + zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + f"https://{self.host}:{self.https_port}", + "dummy-client", + "dummy-secret", + ).build(), + transport_options=transport, ) - response = zitadel.settings.get_general_settings({}) + response = await zitadel.settings_service.get_general_settings({}) self.assertEqual("https", response.default_language) - def test_default_headers(self) -> None: - zitadel = Zitadel.with_client_credentials( - f"http://{self.host}:{self.http_port}", - "dummy-client", - "dummy-secret", - transport_options=TransportOptions(default_headers={"X-Custom-Header": "test-value"}), + async def test_default_headers(self) -> None: + transport = TransportOptions(default_headers={"X-Custom-Header": "test-value"}) + zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( + f"http://{self.host}:{self.http_port}", + "dummy-client", + "dummy-secret", + ).build(), + transport_options=transport, ) - response = zitadel.settings.get_general_settings({}) + response = await zitadel.settings_service.get_general_settings({}) self.assertEqual("http", response.default_language) self.assertEqual("test-value", response.default_org_id) - def test_proxy_url(self) -> None: - zitadel = Zitadel.with_access_token( - "http://wiremock:8080", - "test-token", - transport_options=TransportOptions(proxy_url=f"http://{self.host}:{self.proxy_port}"), + async def test_proxy_url(self) -> None: + zitadel = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator( + "http://wiremock:8080", + "test-token", + ), + transport_options=TransportOptions( + proxy=f"http://{self.host}:{self.proxy_port}" + ), + ) + response = await zitadel.settings_service.get_general_settings({}) + self.assertEqual("http", response.default_language) + + async def test_proxy_requires_credentials(self) -> None: + zitadel = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator( + "http://wiremock:8080", + "test-token", + ), + transport_options=TransportOptions( + proxy=f"http://{self.host}:{self.proxy_auth_port}" + ), + ) + with self.assertRaises(ClientException) as context: + await zitadel.settings_service.get_general_settings({}) + self.assertEqual(407, context.exception.status_code) + + async def test_proxy_with_credentials(self) -> None: + zitadel = Zitadel.with_authenticator( + PersonalAccessTokenAuthenticator( + "http://wiremock:8080", + "test-token", + ), + transport_options=TransportOptions( + proxy=f"http://user:pass@{self.host}:{self.proxy_auth_port}" + ), ) - response = zitadel.settings.get_general_settings({}) + response = await zitadel.settings_service.get_general_settings({}) self.assertEqual("http", response.default_language) - def test_no_ca_cert_fails(self) -> None: - with self.assertRaises(Exception): # noqa: B017 - Zitadel.with_client_credentials( + async def test_no_ca_cert_fails(self) -> None: + zitadel = Zitadel.with_authenticator( + ClientCredentialsAuthenticator.builder( f"https://{self.host}:{self.https_port}", "dummy-client", "dummy-secret", - ) + ).build() + ) + with self.assertRaises(NetworkException) as context: + await zitadel.settings_service.get_general_settings({}) + self.assertIs(NetworkException, type(context.exception)) diff --git a/uv.lock b/uv.lock index f211ad2b..f901b19d 100644 --- a/uv.lock +++ b/uv.lock @@ -1,6 +1,22 @@ version = 1 revision = 3 -requires-python = ">=3.10" +requires-python = ">=3.13" +resolution-markers = [ + "python_full_version >= '3.15'", + "python_full_version < '3.15'", +] + +[[package]] +name = "accessible-pygments" +version = "0.0.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bc/c1/bbac6a50d02774f91572938964c582fff4270eee73ab822a4aeea4d8b11b/accessible_pygments-0.0.5.tar.gz", hash = "sha256:40918d3e6a2b619ad424cb91e556bd3bd8865443d9f22f1dcdf79e33c8046872", size = 1377899, upload-time = "2024-05-10T11:23:10.216Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8d/3f/95338030883d8c8b91223b4e21744b04d11b161a3ef117295d8241f50ab4/accessible_pygments-0.0.5-py3-none-any.whl", hash = "sha256:88ae3211e68a1d0b011504b2ffc1691feafce124b845bd072ab6f9f66f34d4b7", size = 1395903, upload-time = "2024-05-10T11:23:08.421Z" }, +] [[package]] name = "alabaster" @@ -21,15 +37,43 @@ wheels = [ ] [[package]] -name = "authlib" -version = "1.6.12" +name = "ast-serialize" +version = "0.5.0" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cryptography" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/d3/30/6691fdc63b35f54a5a65e04fa1e59d827f4d4e8f4a39678ba7d3088ce0c8/authlib-1.6.12.tar.gz", hash = "sha256:0656d8482f28fc8221929d5f35b2bde5d13e10555ebc06b4561b0d622e83b1bd", size = 165368, upload-time = "2026-05-04T08:11:31.826Z" } +sdist = { url = "https://files.pythonhosted.org/packages/81/9d/09e27731bd5864a9ce04e3244074e674bb8936bf62b45e0357248717adac/ast_serialize-0.5.0.tar.gz", hash = "sha256:5880091bfe6f4f986f22866375c2e884843e7a0b6343ae41aeea659613d879b6", size = 61157, upload-time = "2026-05-17T17:48:29.429Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cd/51/9b0b5cd4cf683a02db937a6f9bbebcdc9c56558a7bb3763ce7d3512103c3/authlib-1.6.12-py2.py3-none-any.whl", hash = "sha256:e9229ad7fde610b139dd12f5edbe97eab9ee78bfb85691247e767727850b99ab", size = 244473, upload-time = "2026-05-04T08:11:30.354Z" }, + { url = "https://files.pythonhosted.org/packages/c0/9a/13dde51ba9e15f8b97957ab7cb0120d0e381524d651c6bd630b9c359227f/ast_serialize-0.5.0-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8f5c14f169eb0972c0c21bada5358b23d6047c76583b005234f865b11f1fa00a", size = 1183520, upload-time = "2026-05-17T17:47:30.831Z" }, + { url = "https://files.pythonhosted.org/packages/37/de/5a7f0a9fe68944f536632a5af84676739c7d2582be42deb082634bf3a754/ast_serialize-0.5.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:7d1a2de9de5be04652f0ed60738356ef94f66db37924a9499fffe98dc491aa0b", size = 1175779, upload-time = "2026-05-17T17:47:32.551Z" }, + { url = "https://files.pythonhosted.org/packages/9c/81/0bb853e76e4f6e9a1855d569003c59e19ffac45f7079d91505d1bb212f92/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be5173fb66f9b49026d9d5a2ff0fc7c7009077107c0eb285b2d60fdf1fe10bd1", size = 1233750, upload-time = "2026-05-17T17:47:34.731Z" }, + { url = "https://files.pythonhosted.org/packages/e5/d3/4cf705beeccc08754d0bbda99aefff26110e209b9a07ac8a6b60eec48531/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f8015cd071ac1339924ee2b8098c93e00e155f30a16f40ec9816fcf84f4753f6", size = 1235942, upload-time = "2026-05-17T17:47:36.287Z" }, + { url = "https://files.pythonhosted.org/packages/26/c8/ee097e437ea27dd2b8b227865c875492b585650a5802a22d82b304c8201b/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5499e8797edff2a9186aa313ed382c6b422e798e9332d9953badcee6e69a88f2", size = 1442517, upload-time = "2026-05-17T17:47:38.17Z" }, + { url = "https://files.pythonhosted.org/packages/ff/bd/68063442838f1ba68ec72b5436430bc75b3bb17a1a3c3063f09b0c05ae2b/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6848f2a093fb5548751a9a09bff8fcd229e2bbeb0e3331f391b6ae6d26cd9903", size = 1254081, upload-time = "2026-05-17T17:47:39.826Z" }, + { url = "https://files.pythonhosted.org/packages/50/e2/1e520793bc6a4e4524a6ab022391e827825eaa0c3811828bfdc6852eca26/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:832d4c998e0b091fd60a6d6bceee535483c4d490de9ba85003af835225719261", size = 1259910, upload-time = "2026-05-17T17:47:41.369Z" }, + { url = "https://files.pythonhosted.org/packages/4e/e1/49b60f467979979cfe6913b43948ff25bca971ad0591d181812f163a988e/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:16db7c62ec0b8efe1d7afd283a388d8f74f2605d56032e5a37747d2de8dba027", size = 1250678, upload-time = "2026-05-17T17:47:43.702Z" }, + { url = "https://files.pythonhosted.org/packages/74/ba/66ab9555de6275677566f6574e5ef6c29cb185ea866f643bc06f8280a8ee/ast_serialize-0.5.0-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:baf5eb061eb5bccade4128ad42da33787d72f6013809cd1b590376ece8b3c937", size = 1301603, upload-time = "2026-05-17T17:47:46.256Z" }, + { url = "https://files.pythonhosted.org/packages/66/42/6aca9b9abc710014b2be9059689e5dd1679339e78f567ffb4d255a9e2050/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:104e4a35bd7c124173c41760ef9aaea17ddb3f86c65cb643671d59afbe3ee94c", size = 1410332, upload-time = "2026-05-17T17:47:47.899Z" }, + { url = "https://files.pythonhosted.org/packages/47/68/2f76594432a22581ecf878b5e75a9b8601c24b2241cf0bbeb1e21fcf370c/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:36be371028fc1675acb38a331bde160dbab7ff907fdf00b67eb6911aa106951b", size = 1509979, upload-time = "2026-05-17T17:47:50.942Z" }, + { url = "https://files.pythonhosted.org/packages/40/ac/a93c9b58292653f6c595752f677a08e608f903b710594909e9231a389b3b/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:061ee58bdb52341c8201a6df41182a977736bae3b7ded87ca7176ca25a8a47ab", size = 1505002, upload-time = "2026-05-17T17:47:54.093Z" }, + { url = "https://files.pythonhosted.org/packages/14/2e/b278f68c497ee2f1d1576cbbef8db5281cd4a5f2db040537592ac9c8862e/ast_serialize-0.5.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b15219e9cdc9f53f6f4cb51c009203507228226148c05c5e8fe451c28b435eb3", size = 1456231, upload-time = "2026-05-17T17:47:56.311Z" }, + { url = "https://files.pythonhosted.org/packages/0b/43/419be1c566a4c504cd8fd60ce2f84e790f295495c0f327cfaeadf3d51012/ast_serialize-0.5.0-cp314-cp314t-win32.whl", hash = "sha256:842d1c004bb466c7df036f95fabef789570541922b10976b12f5592a69cf0b38", size = 1058668, upload-time = "2026-05-17T17:47:58.305Z" }, + { url = "https://files.pythonhosted.org/packages/03/6f/c9d4d549295ed05111aeb8853232d1afd9d0a179fddb01eeffbb3a4a6842/ast_serialize-0.5.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b0c06d760909b095cc466356dfccd05a1c7233a6ca191c020dca2c6a6f16c24c", size = 1101075, upload-time = "2026-05-17T17:48:00.35Z" }, + { url = "https://files.pythonhosted.org/packages/d0/8e/d00c5ab30c58222e07d62956fca86c59d91b9ad32997e633c38b526623a3/ast_serialize-0.5.0-cp314-cp314t-win_arm64.whl", hash = "sha256:787baedb0262cc49e8ce37cc15c00ae818e46a165a3b36f5e21ed174998104cb", size = 1075347, upload-time = "2026-05-17T17:48:01.753Z" }, + { url = "https://files.pythonhosted.org/packages/e0/9e/dc2530acb3a60dc6e46d65abf27d1d9f86721694757906a148d90a6860de/ast_serialize-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:0668aa9459cfa8c9c49ddd2163ebcf43088ba045ef7492af6fe22e0098303101", size = 1191380, upload-time = "2026-05-17T17:48:03.738Z" }, + { url = "https://files.pythonhosted.org/packages/26/0a/bd3d18a582f273d6c843d16bb9e22e9e16365ff7991e92f18f798e9f1224/ast_serialize-0.5.0-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:bf683d6363edf2b39eed6b6d4fe22d34b6203867a67e27134d9e2a2680c4bc4a", size = 1183879, upload-time = "2026-05-17T17:48:05.463Z" }, + { url = "https://files.pythonhosted.org/packages/40/ae/1f919100f8620887af58fcc381c61a1f218cdf89c6e155f87b213e61010a/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cc22cf0c9be65e71cf88fda130af60d61eb4a79370ad4cfe7900d48a4aa2211", size = 1244529, upload-time = "2026-05-17T17:48:07.008Z" }, + { url = "https://files.pythonhosted.org/packages/c6/ca/6376559dcce707cdbc1d0d9a13c8d3baaaa501e949ce0ebdc4230cd881aa/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f66173891548c9f2726bf27957b41cabce12fa679dc6da505ddbde4d4b3b31cf", size = 1240560, upload-time = "2026-05-17T17:48:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/35/b2/a620e206b5aeb7efbf2710336df57d457cffbb3991076bbcc1147ef9abd4/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e42d729ef2be96a14efbad355093284739e3670ece3e534f82cc8832790911d9", size = 1451172, upload-time = "2026-05-17T17:48:09.922Z" }, + { url = "https://files.pythonhosted.org/packages/fa/e0/4ad5c04c24a40481b2935ce9a0ccdb6023dc8b667167d06ae530cc3512f2/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b725026bafa801dbd7310eb13a75f0a2e370e7e51b2cb225f9d21fcfadf919ee", size = 1265072, upload-time = "2026-05-17T17:48:11.469Z" }, + { url = "https://files.pythonhosted.org/packages/b2/71/4d1d479aa56d0101c40e17720c3d6ac2af7269ea0487a80b18e7bfd1a5b7/ast_serialize-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b54f60c1d78767a53b67eaa663f0dfac3afe606aa07f1301572f588b73d64809", size = 1270488, upload-time = "2026-05-17T17:48:13.575Z" }, + { url = "https://files.pythonhosted.org/packages/6d/4f/0de1bbe06f6edef9fde4ed12ca8e7b3ec7e6e2bd4e672c5af487f7957665/ast_serialize-0.5.0-cp39-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:27d51654fc240a1e87e742d353d98eb45b75f62f129086b3596ab53df2ac2a43", size = 1260702, upload-time = "2026-05-17T17:48:15.141Z" }, + { url = "https://files.pythonhosted.org/packages/75/61/e00872439cfdddcc3c1b6cdaa6e5d904ba8e26a18807c67c4e14409d0ca8/ast_serialize-0.5.0-cp39-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c36237c46dd1674542f2109740ea5ea485a169bf1431939ada0434e17934", size = 1311182, upload-time = "2026-05-17T17:48:16.779Z" }, + { url = "https://files.pythonhosted.org/packages/76/8e/699a5b955f7926956c95e9e1d74132acad73c2fe7a426f94da89123c20aa/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:1943db345233cc7194a470f13afa9c59772c0b123dea0c9414c4d4ca54369759", size = 1421410, upload-time = "2026-05-17T17:48:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/a9/ae/d5b7626874478997adc7a29ab28accf21e596fb590c944290401dfd0b29e/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:df1c00022cbbcb064bfaa505aa9c9295362443ce5dacb459d1331d3da353f887", size = 1516587, upload-time = "2026-05-17T17:48:20.133Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ce/b59e02a82d9c4244d64cde502e0b00e83e38816abe19155ceb5437402c7f/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:cae65289fc456fde04af979a2be09302ef5d8ab92ef23e596d6746dc267ada27", size = 1515171, upload-time = "2026-05-17T17:48:21.921Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/d8d90042747d05aa08d4efcf1c99035a5f670a6bf4c214d31644392afbca/ast_serialize-0.5.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:239a4c354e8d676e9d94631d1d4a64edc6b266f86ff3a5a80aedd344f342c01d", size = 1464668, upload-time = "2026-05-17T17:48:23.544Z" }, + { url = "https://files.pythonhosted.org/packages/dd/51/5b840c4df7334104cecffa28f23904fe81ca89ca223d2450e288de39fd3c/ast_serialize-0.5.0-cp39-abi3-win32.whl", hash = "sha256:143a4ef63285a075871908fda3672dc21864b83a8ec3ee12304aa3e4c5387b9a", size = 1068311, upload-time = "2026-05-17T17:48:25.027Z" }, + { url = "https://files.pythonhosted.org/packages/41/11/ca5672c7d491825bc4cd6702dea106a6b60d928707712ec257c7833ae476/ast_serialize-0.5.0-cp39-abi3-win_amd64.whl", hash = "sha256:cf25572c526add400f26a4750dc6ce0c3bb93fc1f75e7ae0cad4ce4f2cd5c590", size = 1108931, upload-time = "2026-05-17T17:48:26.591Z" }, + { url = "https://files.pythonhosted.org/packages/45/19/cc8bd127d28a43da249aa955cfd164cf8fd534e79e42cea96c4854d72fd0/ast_serialize-0.5.0-cp39-abi3-win_arm64.whl", hash = "sha256:92a31c9c20d25a076edaeec76b128a3535d74a24f340b9a8a7e96c9b86dc9642", size = 1081181, upload-time = "2026-05-17T17:48:28.122Z" }, ] [[package]] @@ -42,12 +86,44 @@ wheels = [ ] [[package]] -name = "cachetools" -version = "6.2.4" +name = "beautifulsoup4" +version = "4.15.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/bc/1d/ede8680603f6016887c062a2cf4fc8fdba905866a3ab8831aa8aa651320c/cachetools-6.2.4.tar.gz", hash = "sha256:82c5c05585e70b6ba2d3ae09ea60b79548872185d2f24ae1f2709d37299fd607", size = 31731, upload-time = "2025-12-15T18:24:53.744Z" } +dependencies = [ + { name = "soupsieve" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/65/318323f98dbee45d42dff61d8f047181bc6f2268a9068cfad035a46be5af/beautifulsoup4-4.15.0.tar.gz", hash = "sha256:288e3ca7d54b06f2ac191970bc275c1939cb46d450b255bf6718b04aa37ab4f7", size = 632571, upload-time = "2026-06-07T16:44:20.453Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/fc/1d7b80d0eb7b714984ce40efc78859c022cd930e402f599d8ca9e39c78a4/cachetools-6.2.4-py3-none-any.whl", hash = "sha256:69a7a52634fed8b8bf6e24a050fb60bff1c9bd8f6d24572b99c32d4e71e62a51", size = 11551, upload-time = "2025-12-15T18:24:52.332Z" }, + { url = "https://files.pythonhosted.org/packages/88/c6/92fcd42f1ba33e1184263f25bfabf3d27c383410470f169e4b8163bf9c17/beautifulsoup4-4.15.0-py3-none-any.whl", hash = "sha256:d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9", size = 109924, upload-time = "2026-06-07T16:44:21.566Z" }, +] + +[[package]] +name = "brotli" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f7/16/c92ca344d646e71a43b8bb353f0a6490d7f6e06210f8554c8f874e454285/brotli-1.2.0.tar.gz", hash = "sha256:e310f77e41941c13340a95976fe66a8a95b01e783d430eeaf7a2f87e0a57dd0a", size = 7388632, upload-time = "2025-11-05T18:39:42.86Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6c/d4/4ad5432ac98c73096159d9ce7ffeb82d151c2ac84adcc6168e476bb54674/brotli-1.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:9e5825ba2c9998375530504578fd4d5d1059d09621a02065d1b6bfc41a8e05ab", size = 861523, upload-time = "2025-11-05T18:38:34.67Z" }, + { url = "https://files.pythonhosted.org/packages/91/9f/9cc5bd03ee68a85dc4bc89114f7067c056a3c14b3d95f171918c088bf88d/brotli-1.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0cf8c3b8ba93d496b2fae778039e2f5ecc7cff99df84df337ca31d8f2252896c", size = 444289, upload-time = "2025-11-05T18:38:35.6Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b6/fe84227c56a865d16a6614e2c4722864b380cb14b13f3e6bef441e73a85a/brotli-1.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c8565e3cdc1808b1a34714b553b262c5de5fbda202285782173ec137fd13709f", size = 1528076, upload-time = "2025-11-05T18:38:36.639Z" }, + { url = "https://files.pythonhosted.org/packages/55/de/de4ae0aaca06c790371cf6e7ee93a024f6b4bb0568727da8c3de112e726c/brotli-1.2.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:26e8d3ecb0ee458a9804f47f21b74845cc823fd1bb19f02272be70774f56e2a6", size = 1626880, upload-time = "2025-11-05T18:38:37.623Z" }, + { url = "https://files.pythonhosted.org/packages/5f/16/a1b22cbea436642e071adcaf8d4b350a2ad02f5e0ad0da879a1be16188a0/brotli-1.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:67a91c5187e1eec76a61625c77a6c8c785650f5b576ca732bd33ef58b0dff49c", size = 1419737, upload-time = "2025-11-05T18:38:38.729Z" }, + { url = "https://files.pythonhosted.org/packages/46/63/c968a97cbb3bdbf7f974ef5a6ab467a2879b82afbc5ffb65b8acbb744f95/brotli-1.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4ecdb3b6dc36e6d6e14d3a1bdc6c1057c8cbf80db04031d566eb6080ce283a48", size = 1484440, upload-time = "2025-11-05T18:38:39.916Z" }, + { url = "https://files.pythonhosted.org/packages/06/9d/102c67ea5c9fc171f423e8399e585dabea29b5bc79b05572891e70013cdd/brotli-1.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3e1b35d56856f3ed326b140d3c6d9db91740f22e14b06e840fe4bb1923439a18", size = 1593313, upload-time = "2025-11-05T18:38:41.24Z" }, + { url = "https://files.pythonhosted.org/packages/9e/4a/9526d14fa6b87bc827ba1755a8440e214ff90de03095cacd78a64abe2b7d/brotli-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:54a50a9dad16b32136b2241ddea9e4df159b41247b2ce6aac0b3276a66a8f1e5", size = 1487945, upload-time = "2025-11-05T18:38:42.277Z" }, + { url = "https://files.pythonhosted.org/packages/5b/e8/3fe1ffed70cbef83c5236166acaed7bb9c766509b157854c80e2f766b38c/brotli-1.2.0-cp313-cp313-win32.whl", hash = "sha256:1b1d6a4efedd53671c793be6dd760fcf2107da3a52331ad9ea429edf0902f27a", size = 334368, upload-time = "2025-11-05T18:38:43.345Z" }, + { url = "https://files.pythonhosted.org/packages/ff/91/e739587be970a113b37b821eae8097aac5a48e5f0eca438c22e4c7dd8648/brotli-1.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:b63daa43d82f0cdabf98dee215b375b4058cce72871fd07934f179885aad16e8", size = 369116, upload-time = "2025-11-05T18:38:44.609Z" }, + { url = "https://files.pythonhosted.org/packages/17/e1/298c2ddf786bb7347a1cd71d63a347a79e5712a7c0cba9e3c3458ebd976f/brotli-1.2.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:6c12dad5cd04530323e723787ff762bac749a7b256a5bece32b2243dd5c27b21", size = 863080, upload-time = "2025-11-05T18:38:45.503Z" }, + { url = "https://files.pythonhosted.org/packages/84/0c/aac98e286ba66868b2b3b50338ffbd85a35c7122e9531a73a37a29763d38/brotli-1.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:3219bd9e69868e57183316ee19c84e03e8f8b5a1d1f2667e1aa8c2f91cb061ac", size = 445453, upload-time = "2025-11-05T18:38:46.433Z" }, + { url = "https://files.pythonhosted.org/packages/ec/f1/0ca1f3f99ae300372635ab3fe2f7a79fa335fee3d874fa7f9e68575e0e62/brotli-1.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:963a08f3bebd8b75ac57661045402da15991468a621f014be54e50f53a58d19e", size = 1528168, upload-time = "2025-11-05T18:38:47.371Z" }, + { url = "https://files.pythonhosted.org/packages/d6/a6/2ebfc8f766d46df8d3e65b880a2e220732395e6d7dc312c1e1244b0f074a/brotli-1.2.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9322b9f8656782414b37e6af884146869d46ab85158201d82bab9abbcb971dc7", size = 1627098, upload-time = "2025-11-05T18:38:48.385Z" }, + { url = "https://files.pythonhosted.org/packages/f3/2f/0976d5b097ff8a22163b10617f76b2557f15f0f39d6a0fe1f02b1a53e92b/brotli-1.2.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cf9cba6f5b78a2071ec6fb1e7bd39acf35071d90a81231d67e92d637776a6a63", size = 1419861, upload-time = "2025-11-05T18:38:49.372Z" }, + { url = "https://files.pythonhosted.org/packages/9c/97/d76df7176a2ce7616ff94c1fb72d307c9a30d2189fe877f3dd99af00ea5a/brotli-1.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7547369c4392b47d30a3467fe8c3330b4f2e0f7730e45e3103d7d636678a808b", size = 1484594, upload-time = "2025-11-05T18:38:50.655Z" }, + { url = "https://files.pythonhosted.org/packages/d3/93/14cf0b1216f43df5609f5b272050b0abd219e0b54ea80b47cef9867b45e7/brotli-1.2.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:fc1530af5c3c275b8524f2e24841cbe2599d74462455e9bae5109e9ff42e9361", size = 1593455, upload-time = "2025-11-05T18:38:51.624Z" }, + { url = "https://files.pythonhosted.org/packages/b3/73/3183c9e41ca755713bdf2cc1d0810df742c09484e2e1ddd693bee53877c1/brotli-1.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d2d085ded05278d1c7f65560aae97b3160aeb2ea2c0b3e26204856beccb60888", size = 1488164, upload-time = "2025-11-05T18:38:53.079Z" }, + { url = "https://files.pythonhosted.org/packages/64/6a/0c78d8f3a582859236482fd9fa86a65a60328a00983006bcf6d83b7b2253/brotli-1.2.0-cp314-cp314-win32.whl", hash = "sha256:832c115a020e463c2f67664560449a7bea26b0c1fdd690352addad6d0a08714d", size = 339280, upload-time = "2025-11-05T18:38:54.02Z" }, + { url = "https://files.pythonhosted.org/packages/f5/10/56978295c14794b2c12007b07f3e41ba26acda9257457d7085b0bb3bb90c/brotli-1.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:e7c0af964e0b4e3412a0ebf341ea26ec767fa0b4cf81abb5e897c9338b5ad6a3", size = 375639, upload-time = "2025-11-05T18:38:55.67Z" }, ] [[package]] @@ -68,43 +144,6 @@ dependencies = [ ] sdist = { url = "https://files.pythonhosted.org/packages/eb/56/b1ba7935a17738ae8453301356628e8147c79dbb825bcbc73dc7401f9846/cffi-2.0.0.tar.gz", hash = "sha256:44d1b5909021139fe36001ae048dbdde8214afa20200eda0f64c068cac5d5529", size = 523588, upload-time = "2025-09-08T23:24:04.541Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/93/d7/516d984057745a6cd96575eea814fe1edd6646ee6efd552fb7b0921dec83/cffi-2.0.0-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:0cf2d91ecc3fcc0625c2c530fe004f82c110405f101548512cce44322fa8ac44", size = 184283, upload-time = "2025-09-08T23:22:08.01Z" }, - { url = "https://files.pythonhosted.org/packages/9e/84/ad6a0b408daa859246f57c03efd28e5dd1b33c21737c2db84cae8c237aa5/cffi-2.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f73b96c41e3b2adedc34a7356e64c8eb96e03a3782b535e043a986276ce12a49", size = 180504, upload-time = "2025-09-08T23:22:10.637Z" }, - { url = "https://files.pythonhosted.org/packages/50/bd/b1a6362b80628111e6653c961f987faa55262b4002fcec42308cad1db680/cffi-2.0.0-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:53f77cbe57044e88bbd5ed26ac1d0514d2acf0591dd6bb02a3ae37f76811b80c", size = 208811, upload-time = "2025-09-08T23:22:12.267Z" }, - { url = "https://files.pythonhosted.org/packages/4f/27/6933a8b2562d7bd1fb595074cf99cc81fc3789f6a6c05cdabb46284a3188/cffi-2.0.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:3e837e369566884707ddaf85fc1744b47575005c0a229de3327f8f9a20f4efeb", size = 216402, upload-time = "2025-09-08T23:22:13.455Z" }, - { url = "https://files.pythonhosted.org/packages/05/eb/b86f2a2645b62adcfff53b0dd97e8dfafb5c8aa864bd0d9a2c2049a0d551/cffi-2.0.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:5eda85d6d1879e692d546a078b44251cdd08dd1cfb98dfb77b670c97cee49ea0", size = 203217, upload-time = "2025-09-08T23:22:14.596Z" }, - { url = "https://files.pythonhosted.org/packages/9f/e0/6cbe77a53acf5acc7c08cc186c9928864bd7c005f9efd0d126884858a5fe/cffi-2.0.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:9332088d75dc3241c702d852d4671613136d90fa6881da7d770a483fd05248b4", size = 203079, upload-time = "2025-09-08T23:22:15.769Z" }, - { url = "https://files.pythonhosted.org/packages/98/29/9b366e70e243eb3d14a5cb488dfd3a0b6b2f1fb001a203f653b93ccfac88/cffi-2.0.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:fc7de24befaeae77ba923797c7c87834c73648a05a4bde34b3b7e5588973a453", size = 216475, upload-time = "2025-09-08T23:22:17.427Z" }, - { url = "https://files.pythonhosted.org/packages/21/7a/13b24e70d2f90a322f2900c5d8e1f14fa7e2a6b3332b7309ba7b2ba51a5a/cffi-2.0.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:cf364028c016c03078a23b503f02058f1814320a56ad535686f90565636a9495", size = 218829, upload-time = "2025-09-08T23:22:19.069Z" }, - { url = "https://files.pythonhosted.org/packages/60/99/c9dc110974c59cc981b1f5b66e1d8af8af764e00f0293266824d9c4254bc/cffi-2.0.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e11e82b744887154b182fd3e7e8512418446501191994dbf9c9fc1f32cc8efd5", size = 211211, upload-time = "2025-09-08T23:22:20.588Z" }, - { url = "https://files.pythonhosted.org/packages/49/72/ff2d12dbf21aca1b32a40ed792ee6b40f6dc3a9cf1644bd7ef6e95e0ac5e/cffi-2.0.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:8ea985900c5c95ce9db1745f7933eeef5d314f0565b27625d9a10ec9881e1bfb", size = 218036, upload-time = "2025-09-08T23:22:22.143Z" }, - { url = "https://files.pythonhosted.org/packages/e2/cc/027d7fb82e58c48ea717149b03bcadcbdc293553edb283af792bd4bcbb3f/cffi-2.0.0-cp310-cp310-win32.whl", hash = "sha256:1f72fb8906754ac8a2cc3f9f5aaa298070652a0ffae577e0ea9bd480dc3c931a", size = 172184, upload-time = "2025-09-08T23:22:23.328Z" }, - { url = "https://files.pythonhosted.org/packages/33/fa/072dd15ae27fbb4e06b437eb6e944e75b068deb09e2a2826039e49ee2045/cffi-2.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:b18a3ed7d5b3bd8d9ef7a8cb226502c6bf8308df1525e1cc676c3680e7176739", size = 182790, upload-time = "2025-09-08T23:22:24.752Z" }, - { url = "https://files.pythonhosted.org/packages/12/4a/3dfd5f7850cbf0d06dc84ba9aa00db766b52ca38d8b86e3a38314d52498c/cffi-2.0.0-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:b4c854ef3adc177950a8dfc81a86f5115d2abd545751a304c5bcf2c2c7283cfe", size = 184344, upload-time = "2025-09-08T23:22:26.456Z" }, - { url = "https://files.pythonhosted.org/packages/4f/8b/f0e4c441227ba756aafbe78f117485b25bb26b1c059d01f137fa6d14896b/cffi-2.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2de9a304e27f7596cd03d16f1b7c72219bd944e99cc52b84d0145aefb07cbd3c", size = 180560, upload-time = "2025-09-08T23:22:28.197Z" }, - { url = "https://files.pythonhosted.org/packages/b1/b7/1200d354378ef52ec227395d95c2576330fd22a869f7a70e88e1447eb234/cffi-2.0.0-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:baf5215e0ab74c16e2dd324e8ec067ef59e41125d3eade2b863d294fd5035c92", size = 209613, upload-time = "2025-09-08T23:22:29.475Z" }, - { url = "https://files.pythonhosted.org/packages/b8/56/6033f5e86e8cc9bb629f0077ba71679508bdf54a9a5e112a3c0b91870332/cffi-2.0.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:730cacb21e1bdff3ce90babf007d0a0917cc3e6492f336c2f0134101e0944f93", size = 216476, upload-time = "2025-09-08T23:22:31.063Z" }, - { url = "https://files.pythonhosted.org/packages/dc/7f/55fecd70f7ece178db2f26128ec41430d8720f2d12ca97bf8f0a628207d5/cffi-2.0.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:6824f87845e3396029f3820c206e459ccc91760e8fa24422f8b0c3d1731cbec5", size = 203374, upload-time = "2025-09-08T23:22:32.507Z" }, - { url = "https://files.pythonhosted.org/packages/84/ef/a7b77c8bdc0f77adc3b46888f1ad54be8f3b7821697a7b89126e829e676a/cffi-2.0.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:9de40a7b0323d889cf8d23d1ef214f565ab154443c42737dfe52ff82cf857664", size = 202597, upload-time = "2025-09-08T23:22:34.132Z" }, - { url = "https://files.pythonhosted.org/packages/d7/91/500d892b2bf36529a75b77958edfcd5ad8e2ce4064ce2ecfeab2125d72d1/cffi-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8941aaadaf67246224cee8c3803777eed332a19d909b47e29c9842ef1e79ac26", size = 215574, upload-time = "2025-09-08T23:22:35.443Z" }, - { url = "https://files.pythonhosted.org/packages/44/64/58f6255b62b101093d5df22dcb752596066c7e89dd725e0afaed242a61be/cffi-2.0.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:a05d0c237b3349096d3981b727493e22147f934b20f6f125a3eba8f994bec4a9", size = 218971, upload-time = "2025-09-08T23:22:36.805Z" }, - { url = "https://files.pythonhosted.org/packages/ab/49/fa72cebe2fd8a55fbe14956f9970fe8eb1ac59e5df042f603ef7c8ba0adc/cffi-2.0.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:94698a9c5f91f9d138526b48fe26a199609544591f859c870d477351dc7b2414", size = 211972, upload-time = "2025-09-08T23:22:38.436Z" }, - { url = "https://files.pythonhosted.org/packages/0b/28/dd0967a76aab36731b6ebfe64dec4e981aff7e0608f60c2d46b46982607d/cffi-2.0.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5fed36fccc0612a53f1d4d9a816b50a36702c28a2aa880cb8a122b3466638743", size = 217078, upload-time = "2025-09-08T23:22:39.776Z" }, - { url = "https://files.pythonhosted.org/packages/2b/c0/015b25184413d7ab0a410775fdb4a50fca20f5589b5dab1dbbfa3baad8ce/cffi-2.0.0-cp311-cp311-win32.whl", hash = "sha256:c649e3a33450ec82378822b3dad03cc228b8f5963c0c12fc3b1e0ab940f768a5", size = 172076, upload-time = "2025-09-08T23:22:40.95Z" }, - { url = "https://files.pythonhosted.org/packages/ae/8f/dc5531155e7070361eb1b7e4c1a9d896d0cb21c49f807a6c03fd63fc877e/cffi-2.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:66f011380d0e49ed280c789fbd08ff0d40968ee7b665575489afa95c98196ab5", size = 182820, upload-time = "2025-09-08T23:22:42.463Z" }, - { url = "https://files.pythonhosted.org/packages/95/5c/1b493356429f9aecfd56bc171285a4c4ac8697f76e9bbbbb105e537853a1/cffi-2.0.0-cp311-cp311-win_arm64.whl", hash = "sha256:c6638687455baf640e37344fe26d37c404db8b80d037c3d29f58fe8d1c3b194d", size = 177635, upload-time = "2025-09-08T23:22:43.623Z" }, - { url = "https://files.pythonhosted.org/packages/ea/47/4f61023ea636104d4f16ab488e268b93008c3d0bb76893b1b31db1f96802/cffi-2.0.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:6d02d6655b0e54f54c4ef0b94eb6be0607b70853c45ce98bd278dc7de718be5d", size = 185271, upload-time = "2025-09-08T23:22:44.795Z" }, - { url = "https://files.pythonhosted.org/packages/df/a2/781b623f57358e360d62cdd7a8c681f074a71d445418a776eef0aadb4ab4/cffi-2.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8eca2a813c1cb7ad4fb74d368c2ffbbb4789d377ee5bb8df98373c2cc0dee76c", size = 181048, upload-time = "2025-09-08T23:22:45.938Z" }, - { url = "https://files.pythonhosted.org/packages/ff/df/a4f0fbd47331ceeba3d37c2e51e9dfc9722498becbeec2bd8bc856c9538a/cffi-2.0.0-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:21d1152871b019407d8ac3985f6775c079416c282e431a4da6afe7aefd2bccbe", size = 212529, upload-time = "2025-09-08T23:22:47.349Z" }, - { url = "https://files.pythonhosted.org/packages/d5/72/12b5f8d3865bf0f87cf1404d8c374e7487dcf097a1c91c436e72e6badd83/cffi-2.0.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b21e08af67b8a103c71a250401c78d5e0893beff75e28c53c98f4de42f774062", size = 220097, upload-time = "2025-09-08T23:22:48.677Z" }, - { url = "https://files.pythonhosted.org/packages/c2/95/7a135d52a50dfa7c882ab0ac17e8dc11cec9d55d2c18dda414c051c5e69e/cffi-2.0.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:1e3a615586f05fc4065a8b22b8152f0c1b00cdbc60596d187c2a74f9e3036e4e", size = 207983, upload-time = "2025-09-08T23:22:50.06Z" }, - { url = "https://files.pythonhosted.org/packages/3a/c8/15cb9ada8895957ea171c62dc78ff3e99159ee7adb13c0123c001a2546c1/cffi-2.0.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:81afed14892743bbe14dacb9e36d9e0e504cd204e0b165062c488942b9718037", size = 206519, upload-time = "2025-09-08T23:22:51.364Z" }, - { url = "https://files.pythonhosted.org/packages/78/2d/7fa73dfa841b5ac06c7b8855cfc18622132e365f5b81d02230333ff26e9e/cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:3e17ed538242334bf70832644a32a7aae3d83b57567f9fd60a26257e992b79ba", size = 219572, upload-time = "2025-09-08T23:22:52.902Z" }, - { url = "https://files.pythonhosted.org/packages/07/e0/267e57e387b4ca276b90f0434ff88b2c2241ad72b16d31836adddfd6031b/cffi-2.0.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3925dd22fa2b7699ed2617149842d2e6adde22b262fcbfada50e3d195e4b3a94", size = 222963, upload-time = "2025-09-08T23:22:54.518Z" }, - { url = "https://files.pythonhosted.org/packages/b6/75/1f2747525e06f53efbd878f4d03bac5b859cbc11c633d0fb81432d98a795/cffi-2.0.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2c8f814d84194c9ea681642fd164267891702542f028a15fc97d4674b6206187", size = 221361, upload-time = "2025-09-08T23:22:55.867Z" }, - { url = "https://files.pythonhosted.org/packages/7b/2b/2b6435f76bfeb6bbf055596976da087377ede68df465419d192acf00c437/cffi-2.0.0-cp312-cp312-win32.whl", hash = "sha256:da902562c3e9c550df360bfa53c035b2f241fed6d9aef119048073680ace4a18", size = 172932, upload-time = "2025-09-08T23:22:57.188Z" }, - { url = "https://files.pythonhosted.org/packages/f8/ed/13bd4418627013bec4ed6e54283b1959cf6db888048c7cf4b4c3b5b36002/cffi-2.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:da68248800ad6320861f129cd9c1bf96ca849a2771a59e0344e88681905916f5", size = 183557, upload-time = "2025-09-08T23:22:58.351Z" }, - { url = "https://files.pythonhosted.org/packages/95/31/9f7f93ad2f8eff1dbc1c3656d7ca5bfd8fb52c9d786b4dcf19b2d02217fa/cffi-2.0.0-cp312-cp312-win_arm64.whl", hash = "sha256:4671d9dd5ec934cb9a73e7ee9676f9362aba54f7f34910956b84d727b0d73fb6", size = 177762, upload-time = "2025-09-08T23:22:59.668Z" }, { url = "https://files.pythonhosted.org/packages/4b/8d/a0a47a0c9e413a658623d014e91e74a50cdd2c423f7ccfd44086ef767f90/cffi-2.0.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:00bdf7acc5f795150faa6957054fbbca2439db2f775ce831222b66f192f03beb", size = 185230, upload-time = "2025-09-08T23:23:00.879Z" }, { url = "https://files.pythonhosted.org/packages/4a/d2/a6c0296814556c68ee32009d9c2ad4f85f2707cdecfd7727951ec228005d/cffi-2.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:45d5e886156860dc35862657e1494b9bae8dfa63bf56796f2fb56e1679fc0bca", size = 181043, upload-time = "2025-09-08T23:23:02.231Z" }, { url = "https://files.pythonhosted.org/packages/b0/1e/d22cc63332bd59b06481ceaac49d6c507598642e2230f201649058a7e704/cffi-2.0.0-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:07b271772c100085dd28b74fa0cd81c8fb1a3ba18b21e03d7c27f3436a10606b", size = 212446, upload-time = "2025-09-08T23:23:03.472Z" }, @@ -141,69 +180,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ae/3a/dbeec9d1ee0844c679f6bb5d6ad4e9f198b1224f4e7a32825f47f6192b0c/cffi-2.0.0-cp314-cp314t-win_arm64.whl", hash = "sha256:0a1527a803f0a659de1af2e1fd700213caba79377e27e4693648c2923da066f9", size = 184195, upload-time = "2025-09-08T23:23:43.004Z" }, ] -[[package]] -name = "chardet" -version = "5.2.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f3/0d/f7b6ab21ec75897ed80c17d79b15951a719226b9fababf1e40ea74d69079/chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7", size = 2069618, upload-time = "2023-08-01T19:23:02.662Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/38/6f/f5fbc992a329ee4e0f288c1fe0e2ad9485ed064cac731ed2fe47dcc38cbf/chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970", size = 199385, upload-time = "2023-08-01T19:23:00.661Z" }, -] - [[package]] name = "charset-normalizer" version = "3.4.4" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/1f/b8/6d51fc1d52cbd52cd4ccedd5b5b2f0f6a11bbf6765c782298b0f3e808541/charset_normalizer-3.4.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e824f1492727fa856dd6eda4f7cee25f8518a12f3c4a56a74e8095695089cf6d", size = 209709, upload-time = "2025-10-14T04:40:11.385Z" }, - { url = "https://files.pythonhosted.org/packages/5c/af/1f9d7f7faafe2ddfb6f72a2e07a548a629c61ad510fe60f9630309908fef/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bd5d4137d500351a30687c2d3971758aac9a19208fc110ccb9d7188fbe709e8", size = 148814, upload-time = "2025-10-14T04:40:13.135Z" }, - { url = "https://files.pythonhosted.org/packages/79/3d/f2e3ac2bbc056ca0c204298ea4e3d9db9b4afe437812638759db2c976b5f/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:027f6de494925c0ab2a55eab46ae5129951638a49a34d87f4c3eda90f696b4ad", size = 144467, upload-time = "2025-10-14T04:40:14.728Z" }, - { url = "https://files.pythonhosted.org/packages/ec/85/1bf997003815e60d57de7bd972c57dc6950446a3e4ccac43bc3070721856/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f820802628d2694cb7e56db99213f930856014862f3fd943d290ea8438d07ca8", size = 162280, upload-time = "2025-10-14T04:40:16.14Z" }, - { url = "https://files.pythonhosted.org/packages/3e/8e/6aa1952f56b192f54921c436b87f2aaf7c7a7c3d0d1a765547d64fd83c13/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:798d75d81754988d2565bff1b97ba5a44411867c0cf32b77a7e8f8d84796b10d", size = 159454, upload-time = "2025-10-14T04:40:17.567Z" }, - { url = "https://files.pythonhosted.org/packages/36/3b/60cbd1f8e93aa25d1c669c649b7a655b0b5fb4c571858910ea9332678558/charset_normalizer-3.4.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d1bb833febdff5c8927f922386db610b49db6e0d4f4ee29601d71e7c2694313", size = 153609, upload-time = "2025-10-14T04:40:19.08Z" }, - { url = "https://files.pythonhosted.org/packages/64/91/6a13396948b8fd3c4b4fd5bc74d045f5637d78c9675585e8e9fbe5636554/charset_normalizer-3.4.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9cd98cdc06614a2f768d2b7286d66805f94c48cde050acdbbb7db2600ab3197e", size = 151849, upload-time = "2025-10-14T04:40:20.607Z" }, - { url = "https://files.pythonhosted.org/packages/b7/7a/59482e28b9981d105691e968c544cc0df3b7d6133152fb3dcdc8f135da7a/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:077fbb858e903c73f6c9db43374fd213b0b6a778106bc7032446a8e8b5b38b93", size = 151586, upload-time = "2025-10-14T04:40:21.719Z" }, - { url = "https://files.pythonhosted.org/packages/92/59/f64ef6a1c4bdd2baf892b04cd78792ed8684fbc48d4c2afe467d96b4df57/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:244bfb999c71b35de57821b8ea746b24e863398194a4014e4c76adc2bbdfeff0", size = 145290, upload-time = "2025-10-14T04:40:23.069Z" }, - { url = "https://files.pythonhosted.org/packages/6b/63/3bf9f279ddfa641ffa1962b0db6a57a9c294361cc2f5fcac997049a00e9c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:64b55f9dce520635f018f907ff1b0df1fdc31f2795a922fb49dd14fbcdf48c84", size = 163663, upload-time = "2025-10-14T04:40:24.17Z" }, - { url = "https://files.pythonhosted.org/packages/ed/09/c9e38fc8fa9e0849b172b581fd9803bdf6e694041127933934184e19f8c3/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:faa3a41b2b66b6e50f84ae4a68c64fcd0c44355741c6374813a800cd6695db9e", size = 151964, upload-time = "2025-10-14T04:40:25.368Z" }, - { url = "https://files.pythonhosted.org/packages/d2/d1/d28b747e512d0da79d8b6a1ac18b7ab2ecfd81b2944c4c710e166d8dd09c/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6515f3182dbe4ea06ced2d9e8666d97b46ef4c75e326b79bb624110f122551db", size = 161064, upload-time = "2025-10-14T04:40:26.806Z" }, - { url = "https://files.pythonhosted.org/packages/bb/9a/31d62b611d901c3b9e5500c36aab0ff5eb442043fb3a1c254200d3d397d9/charset_normalizer-3.4.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:cc00f04ed596e9dc0da42ed17ac5e596c6ccba999ba6bd92b0e0aef2f170f2d6", size = 155015, upload-time = "2025-10-14T04:40:28.284Z" }, - { url = "https://files.pythonhosted.org/packages/1f/f3/107e008fa2bff0c8b9319584174418e5e5285fef32f79d8ee6a430d0039c/charset_normalizer-3.4.4-cp310-cp310-win32.whl", hash = "sha256:f34be2938726fc13801220747472850852fe6b1ea75869a048d6f896838c896f", size = 99792, upload-time = "2025-10-14T04:40:29.613Z" }, - { url = "https://files.pythonhosted.org/packages/eb/66/e396e8a408843337d7315bab30dbf106c38966f1819f123257f5520f8a96/charset_normalizer-3.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:a61900df84c667873b292c3de315a786dd8dac506704dea57bc957bd31e22c7d", size = 107198, upload-time = "2025-10-14T04:40:30.644Z" }, - { url = "https://files.pythonhosted.org/packages/b5/58/01b4f815bf0312704c267f2ccb6e5d42bcc7752340cd487bc9f8c3710597/charset_normalizer-3.4.4-cp310-cp310-win_arm64.whl", hash = "sha256:cead0978fc57397645f12578bfd2d5ea9138ea0fac82b2f63f7f7c6877986a69", size = 100262, upload-time = "2025-10-14T04:40:32.108Z" }, - { url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" }, - { url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" }, - { url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" }, - { url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" }, - { url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" }, - { url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" }, - { url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" }, - { url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" }, - { url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" }, - { url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" }, - { url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" }, - { url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" }, - { url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" }, - { url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" }, - { url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" }, - { url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" }, - { url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" }, - { url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" }, - { url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" }, - { url = "https://files.pythonhosted.org/packages/86/bb/b32194a4bf15b88403537c2e120b817c61cd4ecffa9b6876e941c3ee38fe/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1e34719c6ed0b92f418c7c780480b26b5d9c50349e9a9af7d76bf757530350d", size = 161497, upload-time = "2025-10-14T04:40:57.217Z" }, - { url = "https://files.pythonhosted.org/packages/19/89/a54c82b253d5b9b111dc74aca196ba5ccfcca8242d0fb64146d4d3183ff1/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2437418e20515acec67d86e12bf70056a33abdacb5cb1655042f6538d6b085a8", size = 159240, upload-time = "2025-10-14T04:40:58.358Z" }, - { url = "https://files.pythonhosted.org/packages/c0/10/d20b513afe03acc89ec33948320a5544d31f21b05368436d580dec4e234d/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11d694519d7f29d6cd09f6ac70028dba10f92f6cdd059096db198c283794ac86", size = 153471, upload-time = "2025-10-14T04:40:59.468Z" }, - { url = "https://files.pythonhosted.org/packages/61/fa/fbf177b55bdd727010f9c0a3c49eefa1d10f960e5f09d1d887bf93c2e698/charset_normalizer-3.4.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ac1c4a689edcc530fc9d9aa11f5774b9e2f33f9a0c6a57864e90908f5208d30a", size = 150864, upload-time = "2025-10-14T04:41:00.623Z" }, - { url = "https://files.pythonhosted.org/packages/05/12/9fbc6a4d39c0198adeebbde20b619790e9236557ca59fc40e0e3cebe6f40/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:21d142cc6c0ec30d2efee5068ca36c128a30b0f2c53c1c07bd78cb6bc1d3be5f", size = 150647, upload-time = "2025-10-14T04:41:01.754Z" }, - { url = "https://files.pythonhosted.org/packages/ad/1f/6a9a593d52e3e8c5d2b167daf8c6b968808efb57ef4c210acb907c365bc4/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5dbe56a36425d26d6cfb40ce79c314a2e4dd6211d51d6d2191c00bed34f354cc", size = 145110, upload-time = "2025-10-14T04:41:03.231Z" }, - { url = "https://files.pythonhosted.org/packages/30/42/9a52c609e72471b0fc54386dc63c3781a387bb4fe61c20231a4ebcd58bdd/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5bfbb1b9acf3334612667b61bd3002196fe2a1eb4dd74d247e0f2a4d50ec9bbf", size = 162839, upload-time = "2025-10-14T04:41:04.715Z" }, - { url = "https://files.pythonhosted.org/packages/c4/5b/c0682bbf9f11597073052628ddd38344a3d673fda35a36773f7d19344b23/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d055ec1e26e441f6187acf818b73564e6e6282709e9bcb5b63f5b23068356a15", size = 150667, upload-time = "2025-10-14T04:41:05.827Z" }, - { url = "https://files.pythonhosted.org/packages/e4/24/a41afeab6f990cf2daf6cb8c67419b63b48cf518e4f56022230840c9bfb2/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af2d8c67d8e573d6de5bc30cdb27e9b95e49115cd9baad5ddbd1a6207aaa82a9", size = 160535, upload-time = "2025-10-14T04:41:06.938Z" }, - { url = "https://files.pythonhosted.org/packages/2a/e5/6a4ce77ed243c4a50a1fecca6aaaab419628c818a49434be428fe24c9957/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:780236ac706e66881f3b7f2f32dfe90507a09e67d1d454c762cf642e6e1586e0", size = 154816, upload-time = "2025-10-14T04:41:08.101Z" }, - { url = "https://files.pythonhosted.org/packages/a8/ef/89297262b8092b312d29cdb2517cb1237e51db8ecef2e9af5edbe7b683b1/charset_normalizer-3.4.4-cp312-cp312-win32.whl", hash = "sha256:5833d2c39d8896e4e19b689ffc198f08ea58116bee26dea51e362ecc7cd3ed26", size = 99694, upload-time = "2025-10-14T04:41:09.23Z" }, - { url = "https://files.pythonhosted.org/packages/3d/2d/1e5ed9dd3b3803994c155cd9aacb60c82c331bad84daf75bcb9c91b3295e/charset_normalizer-3.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:a79cfe37875f822425b89a82333404539ae63dbdddf97f84dcbc3d339aae9525", size = 107131, upload-time = "2025-10-14T04:41:10.467Z" }, - { url = "https://files.pythonhosted.org/packages/d0/d9/0ed4c7098a861482a7b6a95603edce4c0d9db2311af23da1fb2b75ec26fc/charset_normalizer-3.4.4-cp312-cp312-win_arm64.whl", hash = "sha256:376bec83a63b8021bb5c8ea75e21c4ccb86e7e45ca4eb81146091b56599b80c3", size = 100390, upload-time = "2025-10-14T04:41:11.915Z" }, { url = "https://files.pythonhosted.org/packages/97/45/4b3a1239bbacd321068ea6e7ac28875b03ab8bc0aa0966452db17cd36714/charset_normalizer-3.4.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e1f185f86a6f3403aa2420e815904c67b2f9ebc443f045edd0de921108345794", size = 208091, upload-time = "2025-10-14T04:41:13.346Z" }, { url = "https://files.pythonhosted.org/packages/7d/62/73a6d7450829655a35bb88a88fca7d736f9882a27eacdca2c6d505b57e2e/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b39f987ae8ccdf0d2642338faf2abb1862340facc796048b604ef14919e55ed", size = 147936, upload-time = "2025-10-14T04:41:14.461Z" }, { url = "https://files.pythonhosted.org/packages/89/c5/adb8c8b3d6625bef6d88b251bbb0d95f8205831b987631ab0c8bb5d937c2/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3162d5d8ce1bb98dd51af660f2121c55d0fa541b46dff7bb9b9f86ea1d87de72", size = 144180, upload-time = "2025-10-14T04:41:15.588Z" }, @@ -254,44 +236,6 @@ version = "7.13.0" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/b6/45/2c665ca77ec32ad67e25c77daf1cee28ee4558f3bc571cdbaf88a00b9f23/coverage-7.13.0.tar.gz", hash = "sha256:a394aa27f2d7ff9bc04cf703817773a59ad6dfbd577032e690f961d2460ee936", size = 820905, upload-time = "2025-12-08T13:14:38.055Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/db/08/bdd7ccca14096f7eb01412b87ac11e5d16e4cb54b6e328afc9dee8bdaec1/coverage-7.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:02d9fb9eccd48f6843c98a37bd6817462f130b86da8660461e8f5e54d4c06070", size = 217979, upload-time = "2025-12-08T13:12:14.505Z" }, - { url = "https://files.pythonhosted.org/packages/fa/f0/d1302e3416298a28b5663ae1117546a745d9d19fde7e28402b2c5c3e2109/coverage-7.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:367449cf07d33dc216c083f2036bb7d976c6e4903ab31be400ad74ad9f85ce98", size = 218496, upload-time = "2025-12-08T13:12:16.237Z" }, - { url = "https://files.pythonhosted.org/packages/07/26/d36c354c8b2a320819afcea6bffe72839efd004b98d1d166b90801d49d57/coverage-7.13.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cdb3c9f8fef0a954c632f64328a3935988d33a6604ce4bf67ec3e39670f12ae5", size = 245237, upload-time = "2025-12-08T13:12:17.858Z" }, - { url = "https://files.pythonhosted.org/packages/91/52/be5e85631e0eec547873d8b08dd67a5f6b111ecfe89a86e40b89b0c1c61c/coverage-7.13.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d10fd186aac2316f9bbb46ef91977f9d394ded67050ad6d84d94ed6ea2e8e54e", size = 247061, upload-time = "2025-12-08T13:12:19.132Z" }, - { url = "https://files.pythonhosted.org/packages/0f/45/a5e8fa0caf05fbd8fa0402470377bff09cc1f026d21c05c71e01295e55ab/coverage-7.13.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7f88ae3e69df2ab62fb0bc5219a597cb890ba5c438190ffa87490b315190bb33", size = 248928, upload-time = "2025-12-08T13:12:20.702Z" }, - { url = "https://files.pythonhosted.org/packages/f5/42/ffb5069b6fd1b95fae482e02f3fecf380d437dd5a39bae09f16d2e2e7e01/coverage-7.13.0-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c4be718e51e86f553bcf515305a158a1cd180d23b72f07ae76d6017c3cc5d791", size = 245931, upload-time = "2025-12-08T13:12:22.243Z" }, - { url = "https://files.pythonhosted.org/packages/95/6e/73e809b882c2858f13e55c0c36e94e09ce07e6165d5644588f9517efe333/coverage-7.13.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a00d3a393207ae12f7c49bb1c113190883b500f48979abb118d8b72b8c95c032", size = 246968, upload-time = "2025-12-08T13:12:23.52Z" }, - { url = "https://files.pythonhosted.org/packages/87/08/64ebd9e64b6adb8b4a4662133d706fbaccecab972e0b3ccc23f64e2678ad/coverage-7.13.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3a7b1cd820e1b6116f92c6128f1188e7afe421c7e1b35fa9836b11444e53ebd9", size = 244972, upload-time = "2025-12-08T13:12:24.781Z" }, - { url = "https://files.pythonhosted.org/packages/12/97/f4d27c6fe0cb375a5eced4aabcaef22de74766fb80a3d5d2015139e54b22/coverage-7.13.0-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:37eee4e552a65866f15dedd917d5e5f3d59805994260720821e2c1b51ac3248f", size = 245241, upload-time = "2025-12-08T13:12:28.041Z" }, - { url = "https://files.pythonhosted.org/packages/0c/94/42f8ae7f633bf4c118bf1038d80472f9dade88961a466f290b81250f7ab7/coverage-7.13.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:62d7c4f13102148c78d7353c6052af6d899a7f6df66a32bddcc0c0eb7c5326f8", size = 245847, upload-time = "2025-12-08T13:12:29.337Z" }, - { url = "https://files.pythonhosted.org/packages/a8/2f/6369ca22b6b6d933f4f4d27765d313d8914cc4cce84f82a16436b1a233db/coverage-7.13.0-cp310-cp310-win32.whl", hash = "sha256:24e4e56304fdb56f96f80eabf840eab043b3afea9348b88be680ec5986780a0f", size = 220573, upload-time = "2025-12-08T13:12:30.905Z" }, - { url = "https://files.pythonhosted.org/packages/f1/dc/a6a741e519acceaeccc70a7f4cfe5d030efc4b222595f0677e101af6f1f3/coverage-7.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:74c136e4093627cf04b26a35dab8cbfc9b37c647f0502fc313376e11726ba303", size = 221509, upload-time = "2025-12-08T13:12:32.09Z" }, - { url = "https://files.pythonhosted.org/packages/f1/dc/888bf90d8b1c3d0b4020a40e52b9f80957d75785931ec66c7dfaccc11c7d/coverage-7.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0dfa3855031070058add1a59fdfda0192fd3e8f97e7c81de0596c145dea51820", size = 218104, upload-time = "2025-12-08T13:12:33.333Z" }, - { url = "https://files.pythonhosted.org/packages/8d/ea/069d51372ad9c380214e86717e40d1a743713a2af191cfba30a0911b0a4a/coverage-7.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4fdb6f54f38e334db97f72fa0c701e66d8479af0bc3f9bfb5b90f1c30f54500f", size = 218606, upload-time = "2025-12-08T13:12:34.498Z" }, - { url = "https://files.pythonhosted.org/packages/68/09/77b1c3a66c2aa91141b6c4471af98e5b1ed9b9e6d17255da5eb7992299e3/coverage-7.13.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7e442c013447d1d8d195be62852270b78b6e255b79b8675bad8479641e21fd96", size = 248999, upload-time = "2025-12-08T13:12:36.02Z" }, - { url = "https://files.pythonhosted.org/packages/0a/32/2e2f96e9d5691eaf1181d9040f850b8b7ce165ea10810fd8e2afa534cef7/coverage-7.13.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1ed5630d946859de835a85e9a43b721123a8a44ec26e2830b296d478c7fd4259", size = 250925, upload-time = "2025-12-08T13:12:37.221Z" }, - { url = "https://files.pythonhosted.org/packages/7b/45/b88ddac1d7978859b9a39a8a50ab323186148f1d64bc068f86fc77706321/coverage-7.13.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7f15a931a668e58087bc39d05d2b4bf4b14ff2875b49c994bbdb1c2217a8daeb", size = 253032, upload-time = "2025-12-08T13:12:38.763Z" }, - { url = "https://files.pythonhosted.org/packages/71/cb/e15513f94c69d4820a34b6bf3d2b1f9f8755fa6021be97c7065442d7d653/coverage-7.13.0-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:30a3a201a127ea57f7e14ba43c93c9c4be8b7d17a26e03bb49e6966d019eede9", size = 249134, upload-time = "2025-12-08T13:12:40.382Z" }, - { url = "https://files.pythonhosted.org/packages/09/61/d960ff7dc9e902af3310ce632a875aaa7860f36d2bc8fc8b37ee7c1b82a5/coverage-7.13.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7a485ff48fbd231efa32d58f479befce52dcb6bfb2a88bb7bf9a0b89b1bc8030", size = 250731, upload-time = "2025-12-08T13:12:41.992Z" }, - { url = "https://files.pythonhosted.org/packages/98/34/c7c72821794afc7c7c2da1db8f00c2c98353078aa7fb6b5ff36aac834b52/coverage-7.13.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:22486cdafba4f9e471c816a2a5745337742a617fef68e890d8baf9f3036d7833", size = 248795, upload-time = "2025-12-08T13:12:43.331Z" }, - { url = "https://files.pythonhosted.org/packages/0a/5b/e0f07107987a43b2def9aa041c614ddb38064cbf294a71ef8c67d43a0cdd/coverage-7.13.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:263c3dbccc78e2e331e59e90115941b5f53e85cfcc6b3b2fbff1fd4e3d2c6ea8", size = 248514, upload-time = "2025-12-08T13:12:44.546Z" }, - { url = "https://files.pythonhosted.org/packages/71/c2/c949c5d3b5e9fc6dd79e1b73cdb86a59ef14f3709b1d72bf7668ae12e000/coverage-7.13.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:e5330fa0cc1f5c3c4c3bb8e101b742025933e7848989370a1d4c8c5e401ea753", size = 249424, upload-time = "2025-12-08T13:12:45.759Z" }, - { url = "https://files.pythonhosted.org/packages/11/f1/bbc009abd6537cec0dffb2cc08c17a7f03de74c970e6302db4342a6e05af/coverage-7.13.0-cp311-cp311-win32.whl", hash = "sha256:0f4872f5d6c54419c94c25dd6ae1d015deeb337d06e448cd890a1e89a8ee7f3b", size = 220597, upload-time = "2025-12-08T13:12:47.378Z" }, - { url = "https://files.pythonhosted.org/packages/c4/f6/d9977f2fb51c10fbaed0718ce3d0a8541185290b981f73b1d27276c12d91/coverage-7.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51a202e0f80f241ccb68e3e26e19ab5b3bf0f813314f2c967642f13ebcf1ddfe", size = 221536, upload-time = "2025-12-08T13:12:48.7Z" }, - { url = "https://files.pythonhosted.org/packages/be/ad/3fcf43fd96fb43e337a3073dea63ff148dcc5c41ba7a14d4c7d34efb2216/coverage-7.13.0-cp311-cp311-win_arm64.whl", hash = "sha256:d2a9d7f1c11487b1c69367ab3ac2d81b9b3721f097aa409a3191c3e90f8f3dd7", size = 220206, upload-time = "2025-12-08T13:12:50.365Z" }, - { url = "https://files.pythonhosted.org/packages/9b/f1/2619559f17f31ba00fc40908efd1fbf1d0a5536eb75dc8341e7d660a08de/coverage-7.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0b3d67d31383c4c68e19a88e28fc4c2e29517580f1b0ebec4a069d502ce1e0bf", size = 218274, upload-time = "2025-12-08T13:12:52.095Z" }, - { url = "https://files.pythonhosted.org/packages/2b/11/30d71ae5d6e949ff93b2a79a2c1b4822e00423116c5c6edfaeef37301396/coverage-7.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:581f086833d24a22c89ae0fe2142cfaa1c92c930adf637ddf122d55083fb5a0f", size = 218638, upload-time = "2025-12-08T13:12:53.418Z" }, - { url = "https://files.pythonhosted.org/packages/79/c2/fce80fc6ded8d77e53207489d6065d0fed75db8951457f9213776615e0f5/coverage-7.13.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:0a3a30f0e257df382f5f9534d4ce3d4cf06eafaf5192beb1a7bd066cb10e78fb", size = 250129, upload-time = "2025-12-08T13:12:54.744Z" }, - { url = "https://files.pythonhosted.org/packages/5b/b6/51b5d1eb6fcbb9a1d5d6984e26cbe09018475c2922d554fd724dd0f056ee/coverage-7.13.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:583221913fbc8f53b88c42e8dbb8fca1d0f2e597cb190ce45916662b8b9d9621", size = 252885, upload-time = "2025-12-08T13:12:56.401Z" }, - { url = "https://files.pythonhosted.org/packages/0d/f8/972a5affea41de798691ab15d023d3530f9f56a72e12e243f35031846ff7/coverage-7.13.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f5d9bd30756fff3e7216491a0d6d520c448d5124d3d8e8f56446d6412499e74", size = 253974, upload-time = "2025-12-08T13:12:57.718Z" }, - { url = "https://files.pythonhosted.org/packages/8a/56/116513aee860b2c7968aa3506b0f59b22a959261d1dbf3aea7b4450a7520/coverage-7.13.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a23e5a1f8b982d56fa64f8e442e037f6ce29322f1f9e6c2344cd9e9f4407ee57", size = 250538, upload-time = "2025-12-08T13:12:59.254Z" }, - { url = "https://files.pythonhosted.org/packages/d6/75/074476d64248fbadf16dfafbf93fdcede389ec821f74ca858d7c87d2a98c/coverage-7.13.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9b01c22bc74a7fb44066aaf765224c0d933ddf1f5047d6cdfe4795504a4493f8", size = 251912, upload-time = "2025-12-08T13:13:00.604Z" }, - { url = "https://files.pythonhosted.org/packages/f2/d2/aa4f8acd1f7c06024705c12609d8698c51b27e4d635d717cd1934c9668e2/coverage-7.13.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:898cce66d0836973f48dda4e3514d863d70142bdf6dfab932b9b6a90ea5b222d", size = 250054, upload-time = "2025-12-08T13:13:01.892Z" }, - { url = "https://files.pythonhosted.org/packages/19/98/8df9e1af6a493b03694a1e8070e024e7d2cdc77adedc225a35e616d505de/coverage-7.13.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:3ab483ea0e251b5790c2aac03acde31bff0c736bf8a86829b89382b407cd1c3b", size = 249619, upload-time = "2025-12-08T13:13:03.236Z" }, - { url = "https://files.pythonhosted.org/packages/d8/71/f8679231f3353018ca66ef647fa6fe7b77e6bff7845be54ab84f86233363/coverage-7.13.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1d84e91521c5e4cb6602fe11ece3e1de03b2760e14ae4fcf1a4b56fa3c801fcd", size = 251496, upload-time = "2025-12-08T13:13:04.511Z" }, - { url = "https://files.pythonhosted.org/packages/04/86/9cb406388034eaf3c606c22094edbbb82eea1fa9d20c0e9efadff20d0733/coverage-7.13.0-cp312-cp312-win32.whl", hash = "sha256:193c3887285eec1dbdb3f2bd7fbc351d570ca9c02ca756c3afbc71b3c98af6ef", size = 220808, upload-time = "2025-12-08T13:13:06.422Z" }, - { url = "https://files.pythonhosted.org/packages/1c/59/af483673df6455795daf5f447c2f81a3d2fcfc893a22b8ace983791f6f34/coverage-7.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:4f3e223b2b2db5e0db0c2b97286aba0036ca000f06aca9b12112eaa9af3d92ae", size = 221616, upload-time = "2025-12-08T13:13:07.95Z" }, - { url = "https://files.pythonhosted.org/packages/64/b0/959d582572b30a6830398c60dd419c1965ca4b5fb38ac6b7093a0d50ca8d/coverage-7.13.0-cp312-cp312-win_arm64.whl", hash = "sha256:086cede306d96202e15a4b77ace8472e39d9f4e5f9fd92dd4fecdfb2313b2080", size = 220261, upload-time = "2025-12-08T13:13:09.581Z" }, { url = "https://files.pythonhosted.org/packages/7c/cc/bce226595eb3bf7d13ccffe154c3c487a22222d87ff018525ab4dd2e9542/coverage-7.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:28ee1c96109974af104028a8ef57cec21447d42d0e937c0275329272e370ebcf", size = 218297, upload-time = "2025-12-08T13:13:10.977Z" }, { url = "https://files.pythonhosted.org/packages/3b/9f/73c4d34600aae03447dff3d7ad1d0ac649856bfb87d1ca7d681cfc913f9e/coverage-7.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d1e97353dcc5587b85986cda4ff3ec98081d7e84dd95e8b2a6d59820f0545f8a", size = 218673, upload-time = "2025-12-08T13:13:12.562Z" }, { url = "https://files.pythonhosted.org/packages/63/ab/8fa097db361a1e8586535ae5073559e6229596b3489ec3ef2f5b38df8cb2/coverage-7.13.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:99acd4dfdfeb58e1937629eb1ab6ab0899b131f183ee5f23e0b5da5cba2fec74", size = 249652, upload-time = "2025-12-08T13:13:13.909Z" }, @@ -347,18 +291,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8d/4c/1968f32fb9a2604645827e11ff84a31e59d532e01995f904723b4f5328b3/coverage-7.13.0-py3-none-any.whl", hash = "sha256:850d2998f380b1e266459ca5b47bc9e7daf9af1d070f66317972f382d46f1904", size = 210068, upload-time = "2025-12-08T13:14:36.236Z" }, ] -[package.optional-dependencies] -toml = [ - { name = "tomli", marker = "python_full_version <= '3.11'" }, -] - [[package]] name = "cryptography" version = "50.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/de/41/6cbdcf9142d00fe82836fbb51e503e58088575cf7a0fe1dbff6695bf0840/cryptography-50.0.0.tar.gz", hash = "sha256:eeac2acb5a20ed25e0ad6d1df9891a520b78b404266b6d11778f25d5d691a6c9", size = 880201, upload-time = "2026-07-31T14:25:10.11Z" } wheels = [ @@ -401,21 +339,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/64/a2/4615c8f7d81a00b1d6e6afe19f694e1543582349fb5f4076f6cb5dc36485/cryptography-50.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:c87f62a3d3b9888ed0fdde100ec06aa61ca9cd44bad9057d1dff9a516b5f5bb9", size = 4878208, upload-time = "2026-07-31T14:24:45.522Z" }, { url = "https://files.pythonhosted.org/packages/d2/1a/efcfb02f91407149a0dacffffab791f7e19bf6385f63b3666dc8b5e5c9c8/cryptography-50.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:65c2c3add92b45fd0709db8594536aea39c2a67af0e27ffcf049c498501140b7", size = 5037050, upload-time = "2026-07-31T14:24:47.697Z" }, { url = "https://files.pythonhosted.org/packages/57/30/4a22984d4f1bdfb8c054f07a92bc176b97a3134cc1d6c4b3bffb1f3688b4/cryptography-50.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:d24fead1d4d076e1bfb006dcec392074a3cd8d7b4fc8a595aa64073b2b7a96ba", size = 3874135, upload-time = "2026-07-31T14:24:50.085Z" }, - { url = "https://files.pythonhosted.org/packages/9d/3e/e54cde8c01631a5a8226ccd617eab9e57fd5cfdad90f1a9e6bb570794631/cryptography-50.0.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:5e34edd123674534acd70147f0ca331eaa2c74e6325fb2028c886aa26ba0b68c", size = 3963170, upload-time = "2026-07-31T14:24:51.968Z" }, - { url = "https://files.pythonhosted.org/packages/01/b6/0b9e125e90f3d2dcf599a218a899cda7326a3158cfa258723f0b398b08f6/cryptography-50.0.0-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:8eb5e1172eb569ea8a872796576e6a67c276351728b6455d5beb01242b027c6a", size = 4692441, upload-time = "2026-07-31T14:24:53.743Z" }, - { url = "https://files.pythonhosted.org/packages/53/c9/a5151588710785a96d7bc4de27d4cd62f263bbbcb203cfe29df537eb6505/cryptography-50.0.0-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:910d11e1a385c654bf738bf3e6b8e6ed5de0f5610fcae2be9e5b398d8081d20e", size = 4699810, upload-time = "2026-07-31T14:24:55.746Z" }, - { url = "https://files.pythonhosted.org/packages/c7/1a/15b92b25eb6ce3089cd49377ae990a0f3ad485a510f968aed1f19dbdcdf2/cryptography-50.0.0-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:62598a8a57f815db4c6259a4e97d857dab56697e7de8e8ab02352ab74da1995d", size = 4691924, upload-time = "2026-07-31T14:24:58.082Z" }, - { url = "https://files.pythonhosted.org/packages/62/15/219075012ab13e8905f3cd572204f4acb4b111df787104346b9bc0cea789/cryptography-50.0.0-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:07479a1cb08219ab719147e742e76090c9c773321959bb94946fffdd397a6437", size = 4699593, upload-time = "2026-07-31T14:24:59.951Z" }, - { url = "https://files.pythonhosted.org/packages/8e/b5/c2c5fce26f0ee40d21bafe7f191d29a34b35a65ac4fe8a1191d1983612e9/cryptography-50.0.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:c99c003e088647b8a5b7c145d6f78c335f6348332b62e142d411c4b63d1460b9", size = 3813796, upload-time = "2026-07-31T14:25:02.298Z" }, ] [[package]] -name = "distlib" -version = "0.4.0" +name = "dnspython" +version = "2.8.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" }, + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, ] [[package]] @@ -442,20 +374,21 @@ wheels = [ ] [[package]] -name = "exceptiongroup" -version = "1.3.1" +name = "email-validator" +version = "2.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "dnspython" }, + { name = "idna" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f5/22/900cb125c76b7aaa450ce02fd727f452243f2e91a61af068b40adba60ea9/email_validator-2.3.0.tar.gz", hash = "sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426", size = 51238, upload-time = "2025-08-26T13:09:06.831Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, + { url = "https://files.pythonhosted.org/packages/de/15/545e2b6cf2e3be84bc1ed85613edd75b8aea69807a71c26f4ca6a9258e82/email_validator-2.3.0-py3-none-any.whl", hash = "sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", size = 35604, upload-time = "2025-08-26T13:09:05.858Z" }, ] [[package]] name = "fawltydeps" -version = "0.19.0" +version = "0.20.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "importlib-metadata" }, @@ -464,20 +397,26 @@ dependencies = [ { name = "pip-requirements-parser" }, { name = "pydantic" }, { name = "pyyaml" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/dc/6d/36114743a9ee46b7c3eb31f00ec13746cfb5f33da38b6ab08e84c0eb3357/fawltydeps-0.19.0.tar.gz", hash = "sha256:0fbe9b1736f3a1c7060d5b3489e24f594187a0c98afa5ea888b27e70e63b0ae0", size = 48320, upload-time = "2025-02-28T12:50:55.355Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b1/83/c84f7f6500d15f0f1e56eb1dde7cc42c7ab3dd536d8d6363b4937c89e79b/fawltydeps-0.20.0.tar.gz", hash = "sha256:ad080b284a2278c9940540b643483aff8b57794a1362735d3024c270810c0182", size = 48949, upload-time = "2025-06-05T09:52:30.723Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/58/c8/581e08c6d7ead9e4fa9e7ad858609d726687764a83a517f7dac2d904a114/fawltydeps-0.19.0-py3-none-any.whl", hash = "sha256:fbdd3da5620dd3c6b12a8c00ac655d17376aacf6d105fa61fe44fa4fa195baed", size = 55610, upload-time = "2025-02-28T12:50:53.437Z" }, + { url = "https://files.pythonhosted.org/packages/cf/95/3c90282ffeab315db5250d15685a3d80be29d7c8036f4ea8ff753ff6ae02/fawltydeps-0.20.0-py3-none-any.whl", hash = "sha256:d3bfb260c54135ec5dfa2583a7381c45d2759deb23f6de6f4905da9adac67512", size = 57400, upload-time = "2025-06-05T09:52:29.385Z" }, ] [[package]] -name = "filelock" -version = "3.20.3" +name = "furo" +version = "2025.12.19" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/1d/65/ce7f1b70157833bf3cb851b556a37d4547ceafc158aa9b34b36782f23696/filelock-3.20.3.tar.gz", hash = "sha256:18c57ee915c7ec61cff0ecf7f0f869936c7c30191bb0cf406f1341778d0834e1", size = 19485, upload-time = "2026-01-09T17:55:05.421Z" } +dependencies = [ + { name = "accessible-pygments" }, + { name = "beautifulsoup4" }, + { name = "pygments" }, + { name = "sphinx" }, + { name = "sphinx-basic-ng" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ec/20/5f5ad4da6a5a27c80f2ed2ee9aee3f9e36c66e56e21c00fde467b2f8f88f/furo-2025.12.19.tar.gz", hash = "sha256:188d1f942037d8b37cd3985b955839fea62baa1730087dc29d157677c857e2a7", size = 1661473, upload-time = "2025-12-19T17:34:40.889Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b5/36/7fb70f04bf00bc646cd5bb45aa9eddb15e19437a28b8fb2b4a5249fac770/filelock-3.20.3-py3-none-any.whl", hash = "sha256:4b0dda527ee31078689fc205ec4f1c1bf7d56cf88b6dc9426c4f230e46c2dce1", size = 16701, upload-time = "2026-01-09T17:55:04.334Z" }, + { url = "https://files.pythonhosted.org/packages/f4/b2/50e9b292b5cac13e9e81272c7171301abc753a60460d21505b606e15cf21/furo-2025.12.19-py3-none-any.whl", hash = "sha256:bb0ead5309f9500130665a26bee87693c41ce4dbdff864dbfb6b0dae4673d24f", size = 339262, upload-time = "2025-12-19T17:34:38.905Z" }, ] [[package]] @@ -500,14 +439,14 @@ wheels = [ [[package]] name = "importlib-metadata" -version = "8.7.0" +version = "9.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "zipp" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a9/01/15bb152d77b21318514a96f43af312635eb2500c96b55398d020c93d86ea/importlib_metadata-9.0.0.tar.gz", hash = "sha256:a4f57ab599e6a2e3016d7595cfd72eb4661a5106e787a95bcc90c7105b831efc", size = 56405, upload-time = "2026-03-20T06:42:56.999Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, + { url = "https://files.pythonhosted.org/packages/38/3d/2d244233ac4f76e38533cfcb2991c9eb4c7bf688ae0a036d30725b8faafe/importlib_metadata-9.0.0-py3-none-any.whl", hash = "sha256:2d21d1cc5a017bd0559e36150c21c830ab1dc304dedd1b7ea85d20f45ef3edd7", size = 27789, upload-time = "2026-03-20T06:42:55.665Z" }, ] [[package]] @@ -519,13 +458,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "isodate" +version = "0.7.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/54/4d/e940025e2ce31a8ce1202635910747e5a87cc3a6a6bb2d00973375014749/isodate-0.7.2.tar.gz", hash = "sha256:4cd1aa0f43ca76f4a6c6c0292a85f40b35ec2e43e315b59f06e6d32171a953e6", size = 29705, upload-time = "2024-10-08T23:04:11.5Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/15/aa/0aca39a37d3c7eb941ba736ede56d689e7be91cab5d9ca846bde3999eba6/isodate-0.7.2-py3-none-any.whl", hash = "sha256:28009937d8031054830160fce6d409ed342816b543597cece116d966c6d99e15", size = 22320, upload-time = "2024-10-08T23:04:09.501Z" }, +] + [[package]] name = "isort" -version = "7.0.0" +version = "8.0.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/63/53/4f3c058e3bace40282876f9b553343376ee687f3c35a525dc79dbd450f88/isort-7.0.0.tar.gz", hash = "sha256:5513527951aadb3ac4292a41a16cbc50dd1642432f5e8c20057d414bdafb4187", size = 805049, upload-time = "2025-10-11T13:30:59.107Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ef/7c/ec4ab396d31b3b395e2e999c8f46dec78c5e29209fac49d1f4dace04041d/isort-8.0.1.tar.gz", hash = "sha256:171ac4ff559cdc060bcfff550bc8404a486fee0caab245679c2abe7cb253c78d", size = 769592, upload-time = "2026-02-28T10:08:20.685Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/ed/e3705d6d02b4f7aea715a353c8ce193efd0b5db13e204df895d38734c244/isort-7.0.0-py3-none-any.whl", hash = "sha256:1bcabac8bc3c36c7fb7b98a76c8abb18e0f841a3ba81decac7691008592499c1", size = 94672, upload-time = "2025-10-11T13:30:57.665Z" }, + { url = "https://files.pythonhosted.org/packages/3e/95/c7c34aa53c16353c56d0b802fba48d5f5caa2cdee7958acbcb795c830416/isort-8.0.1-py3-none-any.whl", hash = "sha256:28b89bc70f751b559aeca209e6120393d43fbe2490de0559662be7a9787e3d75", size = 89733, upload-time = "2026-02-28T10:08:19.466Z" }, ] [[package]] @@ -540,45 +488,59 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] +[[package]] +name = "librt" +version = "0.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/40/08/9e7f6b5d2b5bed6ad055cdd5925f192bb403a51280f86b56554d9d0699a2/librt-0.11.0.tar.gz", hash = "sha256:075dc3ef4458a278e0195cbf6ac9d38808d9b906c5a6c7f7f79c3888276a3fb1", size = 200139, upload-time = "2026-05-10T18:17:25.138Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/61/e59168d4d0bf2bf90f4f0caf7a001bfc60254c3af4586013b04dc3ef517b/librt-0.11.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:78dc31f7fdfe9c9d0eb0e8f42d139db230e826415bbcabd9f0e9faaaee909894", size = 144119, upload-time = "2026-05-10T18:16:11.771Z" }, + { url = "https://files.pythonhosted.org/packages/61/fd/caa1d60b12f7dd79ccea23054e06eeaebe266a5f52c40a6b651069200ce5/librt-0.11.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fa475675db22290c3158e1d42326d0f5a65f04f44a0e68c3630a25b53560fb9c", size = 143565, upload-time = "2026-05-10T18:16:13.334Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a9/dc744f5c2b4978d48db970be29f22716d3413d28b14ad99740817315cf2c/librt-0.11.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:621db29691044bdeda22e789e482e1b0f3a985d90e3426c9c6d17606416205ea", size = 485395, upload-time = "2026-05-10T18:16:14.729Z" }, + { url = "https://files.pythonhosted.org/packages/8f/21/7f8e97a1e4dae952a5a95948f6f8507a173bc1e669f54340bba6ca1ca31b/librt-0.11.0-cp313-cp313-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:a9010e2ed5b3a9e158c5fd966b3ab7e834bb3d3aacc8f66c91dd4b57a3799230", size = 479383, upload-time = "2026-05-10T18:16:16.321Z" }, + { url = "https://files.pythonhosted.org/packages/a6/6d/d8ee9c114bebf2c50e29ec2aa940826fccb62a645c3e4c18760987d0e16d/librt-0.11.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c39513d8b7477a2e1ed8c43fc21c524e8d5a0f8d4e8b7b074dbdbe7820a08e2", size = 513010, upload-time = "2026-05-10T18:16:17.647Z" }, + { url = "https://files.pythonhosted.org/packages/f0/43/0b5708af2bd30a46400e72ba6bdaa8f066f15fb9a688527e34220e8d6c06/librt-0.11.0-cp313-cp313-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7aef3cf1d5af86e770ab04bfd993dfc4ae8b8c17f66fb77dd4a7d50de7bbb1a3", size = 508433, upload-time = "2026-05-10T18:16:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/4a/50/356187247d09013490481033183b3532b58acf8028bcb34b2b56a375c9b2/librt-0.11.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:557183ddc36babe46b27dd60facbd5adb4492181a5be887587d57cda6e092f21", size = 522595, upload-time = "2026-05-10T18:16:20.642Z" }, + { url = "https://files.pythonhosted.org/packages/40/e7/c6ac4240899c7f3248079d5a9900debe0dadb3fdeaf856684c987105ba47/librt-0.11.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:83d3e1f72bd42f6c5c0b7daec530c3f829bd02db42c70b8ddf0c2d90a2459930", size = 527255, upload-time = "2026-05-10T18:16:22.352Z" }, + { url = "https://files.pythonhosted.org/packages/eb/b5/a81322dbeedeeaf9c1ee6f001734d28a09d8383ac9e6779bc24bbd0743c6/librt-0.11.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4ce1f21fbe589bc1afd7872dece84fb0e1144f794a288e58a10d2c54a55c43be", size = 516847, upload-time = "2026-05-10T18:16:23.627Z" }, + { url = "https://files.pythonhosted.org/packages/ae/66/6e6323787d592b55204a42595ff1102da5115601b53a7e9ddebc889a6da5/librt-0.11.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:970b09f7044ea2b64c9da42fd3d335666518cfd1c6e8a182c95da73d0214b41e", size = 553920, upload-time = "2026-05-10T18:16:25.025Z" }, + { url = "https://files.pythonhosted.org/packages/9c/21/623f8ca230857102066d9ca8c6c1734995908c4d0d1bee7bb2ef0021cb33/librt-0.11.0-cp313-cp313-win32.whl", hash = "sha256:78fddc31cd4d3caa897ad5d31f856b1faadc9474021ad6cb182b9018793e254e", size = 101898, upload-time = "2026-05-10T18:16:26.649Z" }, + { url = "https://files.pythonhosted.org/packages/b3/1d/b4ebd44dd723f768469007515cb92251e0ae286c94c140f374801140fa74/librt-0.11.0-cp313-cp313-win_amd64.whl", hash = "sha256:8ca8aa88751a775870b764e93bad5135385f563cb8dcee399abf034ea4d3cb47", size = 119812, upload-time = "2026-05-10T18:16:27.859Z" }, + { url = "https://files.pythonhosted.org/packages/3b/e4/b2f4ca7965ca373b491cdb4bc25cdb30c1649ca81a8782056a83850292a9/librt-0.11.0-cp313-cp313-win_arm64.whl", hash = "sha256:96f044bb325fd9cf1a723015638c219e9143f0dfbc0ca54c565df2b7fc748b44", size = 103448, upload-time = "2026-05-10T18:16:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/29/eb/dbce197da4e227779e56b5735f2decc3eb36e55a1cdbf1bd65d6639d76c1/librt-0.11.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4a017a95e5837dc15a8c5661d60e05daa96b90908b1aa6b7acdf443cd25c8ebd", size = 143345, upload-time = "2026-05-10T18:16:30.674Z" }, + { url = "https://files.pythonhosted.org/packages/76/a3/254bebd0c11c8ba684018efb8006ff22e466abce445215cca6c778e7d9de/librt-0.11.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:b1ecbd9819deccc39b7542bf4d2a740d8a620694d39989e58661d3763458f8d4", size = 143131, upload-time = "2026-05-10T18:16:32.037Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3f/f77d6122d21ac7bf6ae8a7dfced1bd2a7ac545d3273ebdcaf8042f6d619f/librt-0.11.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7da327dacd7be8f8ec36547373550744a3cc0e536d54665cd83f8bcd961200e8", size = 477024, upload-time = "2026-05-10T18:16:33.493Z" }, + { url = "https://files.pythonhosted.org/packages/ac/0a/2c996dadebaa7d9bbbd43ef2d4f3e66b6da545f838a41694ef6172cebec8/librt-0.11.0-cp314-cp314-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:0dc56b1f8d06e60db362cc3fdae206681817f86ce4725d34511473487f12a34b", size = 474221, upload-time = "2026-05-10T18:16:34.864Z" }, + { url = "https://files.pythonhosted.org/packages/0a/7e/f5d92af8486b8272c23b3e686b46ff72d89c8169585eb61eef01a2ac7147/librt-0.11.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:05fb8fb2ab90e21c8d12ea240d744ad514da9baf381ebfa70d91d20d21713175", size = 505174, upload-time = "2026-05-10T18:16:36.705Z" }, + { url = "https://files.pythonhosted.org/packages/af/1a/cb0734fe86398eb33193ab753b7326255c74cac5eb09e76b9b16536e7adb/librt-0.11.0-cp314-cp314-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cae74872be221df4374d10fec61f93ed1513b9546ea84f2c0bf73ab3e9bd0b03", size = 497216, upload-time = "2026-05-10T18:16:38.418Z" }, + { url = "https://files.pythonhosted.org/packages/18/06/094820f91558b66e29943c0ec41c9914f460f48dd51fc503c3101e10842d/librt-0.11.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:32bcc918c0148eb7e3d57385125bac7e5f9e4359d05f07448b09f6f778c2f31c", size = 513921, upload-time = "2026-05-10T18:16:39.848Z" }, + { url = "https://files.pythonhosted.org/packages/0b/c2/00de9018871a282f530cacb457d5ec0428f6ac7e6fedde9aff7468d9fb04/librt-0.11.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:f9743fc99135d5f78d2454435615f6dec0473ca507c26ce9d92b10b562a280d3", size = 520850, upload-time = "2026-05-10T18:16:41.471Z" }, + { url = "https://files.pythonhosted.org/packages/51/9d/64631832348fd1834fb3a61b996434edddaaf25a31d03b0a76273159d2cf/librt-0.11.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:5ba067f4aadae8fda802d91d2124c90c42195ff32d9161d3549e6d05cfe26f96", size = 504237, upload-time = "2026-05-10T18:16:43.15Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ec/ae5525eb16edc827a044e7bb8777a455ff95d4bca9379e7e6bddd7383647/librt-0.11.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:de3bf945454d032f9e390b85c4072e0a0570bf825421c8be0e71209fa65e1abe", size = 546261, upload-time = "2026-05-10T18:16:44.408Z" }, + { url = "https://files.pythonhosted.org/packages/5a/09/adce371f27ca039411da9659f7430fcc2ba6cd0c7b3e4467a0f091be7fa9/librt-0.11.0-cp314-cp314-win32.whl", hash = "sha256:d2277a05f6dcb9fd13db9566aac4fabd68c3ea1ea46ee5567d4eef8efa495a2f", size = 96965, upload-time = "2026-05-10T18:16:46.039Z" }, + { url = "https://files.pythonhosted.org/packages/d6/ee/8ac720d98548f173c7ce2e632a7ca94673f74cacd5c8162a84af5b35958a/librt-0.11.0-cp314-cp314-win_amd64.whl", hash = "sha256:ab73e8db5e3f564d812c1f5c3a175930a5f9bc96ccb5e3b22a34d7858b401cf7", size = 115151, upload-time = "2026-05-10T18:16:47.133Z" }, + { url = "https://files.pythonhosted.org/packages/94/20/c900cf14efeb09b6bef2b2dff20779f73464b97fd58d1c6bccc379588ae3/librt-0.11.0-cp314-cp314-win_arm64.whl", hash = "sha256:aea3caa317752e3a466fa8af45d91ee0ea8c7fdd96e42b0a8dd9b76a7931eba1", size = 98850, upload-time = "2026-05-10T18:16:48.597Z" }, + { url = "https://files.pythonhosted.org/packages/0c/71/944bfe4b64e12abffcd3c15e1cce07f72f3d55655083786285f4dedeb532/librt-0.11.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d1b36540d7aaf9b9101b3a6f376c8d8e9f7a9aec93ed05918f2c69d493ffef72", size = 151138, upload-time = "2026-05-10T18:16:49.839Z" }, + { url = "https://files.pythonhosted.org/packages/b6/10/99e64a5c86989357fda078c8143c533389585f6473b7439172dd8f3b3b2d/librt-0.11.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:efbb343ab2ce3540f4ecbe6315d677ed70f37cd9a72b1e58066c918ca83acbaa", size = 151976, upload-time = "2026-05-10T18:16:51.062Z" }, + { url = "https://files.pythonhosted.org/packages/21/31/5072ad880946d83e5ea4147d6d018c78eefce85b77819b19bdd0ee229435/librt-0.11.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0dd688aab3f7914d3e6e5e3554978e0383312fb8e771d84be008a35b9ee548", size = 557927, upload-time = "2026-05-10T18:16:52.632Z" }, + { url = "https://files.pythonhosted.org/packages/5e/8d/70b5fb7cfbab60edbe7381614ab985da58e144fbf465c86d44c95f43cdca/librt-0.11.0-cp314-cp314t-manylinux2014_i686.manylinux_2_17_i686.manylinux_2_28_i686.whl", hash = "sha256:f5fb36b8c6c63fdcbb1d526d94c0d1331610d43f4118cc1beb4efef4f3faacb2", size = 539698, upload-time = "2026-05-10T18:16:53.934Z" }, + { url = "https://files.pythonhosted.org/packages/fa/a3/ba3495a0b3edbd24a4cae0d1d3c64f39a9fc45d06e812101289b50c1a619/librt-0.11.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4a9a237d13addb93715b6fee74023d5ee3469b53fce527626c0e088aa585805f", size = 577162, upload-time = "2026-05-10T18:16:55.589Z" }, + { url = "https://files.pythonhosted.org/packages/f7/db/36e25fb81f99937ff1b96612a1dc9fd66f039cb9cc3aee12c01fac31aab9/librt-0.11.0-cp314-cp314t-manylinux_2_34_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5ddd17bd87b2c56ddd60e546a7984a2e64c4e8eab92fb4cf3830a48ad5469d51", size = 566494, upload-time = "2026-05-10T18:16:56.975Z" }, + { url = "https://files.pythonhosted.org/packages/33/0d/3f622b47f0b013eeb9cf4cc07ae9bfe378d832a4eec998b2b209fe84244d/librt-0.11.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bd43992b4473d42f12ff9e68326079f0696d9d4e6000e8f39a0238d482ba6ee2", size = 596858, upload-time = "2026-05-10T18:16:58.374Z" }, + { url = "https://files.pythonhosted.org/packages/a9/02/71b90bc93039c46a2000651f6ad60122b114c8f54c4ad306e0e96f5b75ad/librt-0.11.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:f8e3e8056dd674e279741485e2e512d6e9a751c7455809d0114e6ebf8d781085", size = 590318, upload-time = "2026-05-10T18:16:59.676Z" }, + { url = "https://files.pythonhosted.org/packages/04/04/418cb3f75621e2b761fb1ab0f017f4d70a1a72a6e7c74ee4f7e8d198c2f3/librt-0.11.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:c1f708d8ae9c56cf38a903c44297243d2ec83fd82b396b977e0144a3e76217e3", size = 575115, upload-time = "2026-05-10T18:17:01.007Z" }, + { url = "https://files.pythonhosted.org/packages/cc/2c/5a2183ac58dd911f26b5d7e7d7d8f1d87fcecdddd99d6c12169a258ff62c/librt-0.11.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0add982e0e7b9fc14cf4b33789d5f13f66581889b88c2f58099f6ce8f92617bd", size = 617918, upload-time = "2026-05-10T18:17:02.682Z" }, + { url = "https://files.pythonhosted.org/packages/15/1f/dc6771a52592a4451be6effa200cbfc9cec61e4393d3033d81a9d307961d/librt-0.11.0-cp314-cp314t-win32.whl", hash = "sha256:2b481d846ac894c4e8403c5fd0e87c5d11d6499e404b474602508a224ff531c8", size = 103562, upload-time = "2026-05-10T18:17:03.99Z" }, + { url = "https://files.pythonhosted.org/packages/62/4a/7d1415567027286a75ba1093ec4aca11f073e0f559c530cf3e0a757ad55c/librt-0.11.0-cp314-cp314t-win_amd64.whl", hash = "sha256:28edb433edde181112a908c78907af28f964eabc15f4dd16c9d66c834302677c", size = 124327, upload-time = "2026-05-10T18:17:05.465Z" }, + { url = "https://files.pythonhosted.org/packages/ce/62/b40b382fa0c66fee1478073eb8db352a4a6beda4a1adccf1df911d8c289c/librt-0.11.0-cp314-cp314t-win_arm64.whl", hash = "sha256:dee008f20b542e3cd162ba338a7f9ec0f6d23d395f66fe8aeeec3c9d067ea253", size = 102572, upload-time = "2026-05-10T18:17:06.809Z" }, +] + [[package]] name = "markupsafe" version = "3.0.3" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/4b/3541d44f3937ba468b75da9eebcae497dcf67adb65caa16760b0a6807ebb/markupsafe-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559", size = 11631, upload-time = "2025-09-27T18:36:05.558Z" }, - { url = "https://files.pythonhosted.org/packages/98/1b/fbd8eed11021cabd9226c37342fa6ca4e8a98d8188a8d9b66740494960e4/markupsafe-3.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419", size = 12057, upload-time = "2025-09-27T18:36:07.165Z" }, - { url = "https://files.pythonhosted.org/packages/40/01/e560d658dc0bb8ab762670ece35281dec7b6c1b33f5fbc09ebb57a185519/markupsafe-3.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695", size = 22050, upload-time = "2025-09-27T18:36:08.005Z" }, - { url = "https://files.pythonhosted.org/packages/af/cd/ce6e848bbf2c32314c9b237839119c5a564a59725b53157c856e90937b7a/markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591", size = 20681, upload-time = "2025-09-27T18:36:08.881Z" }, - { url = "https://files.pythonhosted.org/packages/c9/2a/b5c12c809f1c3045c4d580b035a743d12fcde53cf685dbc44660826308da/markupsafe-3.0.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c", size = 20705, upload-time = "2025-09-27T18:36:10.131Z" }, - { url = "https://files.pythonhosted.org/packages/cf/e3/9427a68c82728d0a88c50f890d0fc072a1484de2f3ac1ad0bfc1a7214fd5/markupsafe-3.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f", size = 21524, upload-time = "2025-09-27T18:36:11.324Z" }, - { url = "https://files.pythonhosted.org/packages/bc/36/23578f29e9e582a4d0278e009b38081dbe363c5e7165113fad546918a232/markupsafe-3.0.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6", size = 20282, upload-time = "2025-09-27T18:36:12.573Z" }, - { url = "https://files.pythonhosted.org/packages/56/21/dca11354e756ebd03e036bd8ad58d6d7168c80ce1fe5e75218e4945cbab7/markupsafe-3.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1", size = 20745, upload-time = "2025-09-27T18:36:13.504Z" }, - { url = "https://files.pythonhosted.org/packages/87/99/faba9369a7ad6e4d10b6a5fbf71fa2a188fe4a593b15f0963b73859a1bbd/markupsafe-3.0.3-cp310-cp310-win32.whl", hash = "sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa", size = 14571, upload-time = "2025-09-27T18:36:14.779Z" }, - { url = "https://files.pythonhosted.org/packages/d6/25/55dc3ab959917602c96985cb1253efaa4ff42f71194bddeb61eb7278b8be/markupsafe-3.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8", size = 15056, upload-time = "2025-09-27T18:36:16.125Z" }, - { url = "https://files.pythonhosted.org/packages/d0/9e/0a02226640c255d1da0b8d12e24ac2aa6734da68bff14c05dd53b94a0fc3/markupsafe-3.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1", size = 13932, upload-time = "2025-09-27T18:36:17.311Z" }, - { url = "https://files.pythonhosted.org/packages/08/db/fefacb2136439fc8dd20e797950e749aa1f4997ed584c62cfb8ef7c2be0e/markupsafe-3.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad", size = 11631, upload-time = "2025-09-27T18:36:18.185Z" }, - { url = "https://files.pythonhosted.org/packages/e1/2e/5898933336b61975ce9dc04decbc0a7f2fee78c30353c5efba7f2d6ff27a/markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a", size = 12058, upload-time = "2025-09-27T18:36:19.444Z" }, - { url = "https://files.pythonhosted.org/packages/1d/09/adf2df3699d87d1d8184038df46a9c80d78c0148492323f4693df54e17bb/markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50", size = 24287, upload-time = "2025-09-27T18:36:20.768Z" }, - { url = "https://files.pythonhosted.org/packages/30/ac/0273f6fcb5f42e314c6d8cd99effae6a5354604d461b8d392b5ec9530a54/markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf", size = 22940, upload-time = "2025-09-27T18:36:22.249Z" }, - { url = "https://files.pythonhosted.org/packages/19/ae/31c1be199ef767124c042c6c3e904da327a2f7f0cd63a0337e1eca2967a8/markupsafe-3.0.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f", size = 21887, upload-time = "2025-09-27T18:36:23.535Z" }, - { url = "https://files.pythonhosted.org/packages/b2/76/7edcab99d5349a4532a459e1fe64f0b0467a3365056ae550d3bcf3f79e1e/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a", size = 23692, upload-time = "2025-09-27T18:36:24.823Z" }, - { url = "https://files.pythonhosted.org/packages/a4/28/6e74cdd26d7514849143d69f0bf2399f929c37dc2b31e6829fd2045b2765/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115", size = 21471, upload-time = "2025-09-27T18:36:25.95Z" }, - { url = "https://files.pythonhosted.org/packages/62/7e/a145f36a5c2945673e590850a6f8014318d5577ed7e5920a4b3448e0865d/markupsafe-3.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a", size = 22923, upload-time = "2025-09-27T18:36:27.109Z" }, - { url = "https://files.pythonhosted.org/packages/0f/62/d9c46a7f5c9adbeeeda52f5b8d802e1094e9717705a645efc71b0913a0a8/markupsafe-3.0.3-cp311-cp311-win32.whl", hash = "sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19", size = 14572, upload-time = "2025-09-27T18:36:28.045Z" }, - { url = "https://files.pythonhosted.org/packages/83/8a/4414c03d3f891739326e1783338e48fb49781cc915b2e0ee052aa490d586/markupsafe-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01", size = 15077, upload-time = "2025-09-27T18:36:29.025Z" }, - { url = "https://files.pythonhosted.org/packages/35/73/893072b42e6862f319b5207adc9ae06070f095b358655f077f69a35601f0/markupsafe-3.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c", size = 13876, upload-time = "2025-09-27T18:36:29.954Z" }, - { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, - { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, - { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, - { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, - { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, - { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, - { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, - { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, - { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, - { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, - { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, @@ -625,6 +587,91 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, ] +[[package]] +name = "mypy" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "ast-serialize" }, + { name = "librt", marker = "platform_python_implementation != 'PyPy'" }, + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/82/15/cca9d88503549ed6fedeaa1d448cdddd542ee8a490232d732e278036fbf2/mypy-2.1.0.tar.gz", hash = "sha256:81e76ad12c2d804512e9b13240d1588316531bfba07558286078bfbce9613633", size = 3898359, upload-time = "2026-05-11T18:37:36.237Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6e/dd/c7191469c777f07689c032a8f7326e393ea34c92d6d76eb7ce5ba57ea66d/mypy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:35aac3bb114e03888f535d5eb51b8bafbb3266586b599da1940f9b1be3ec5bd5", size = 14852174, upload-time = "2026-05-11T18:31:38.929Z" }, + { url = "https://files.pythonhosted.org/packages/55/8c/aed55408879043d72bb9135f4d0d19a02b886dd569631e113e3d2706cb8d/mypy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8de55a8c861f2a49331f807be98d90caeceeef520bde13d43a160207f8af613e", size = 13651542, upload-time = "2026-05-11T18:36:04.636Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8e/f371a824b1f1fa8ea6e3dbb8703d232977d572be2329554a3bc4d960302f/mypy-2.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5fdf2941a07434af755837d9880f7d7d25f1dacb1af9dcd4b9b66f2220a3024e", size = 14033929, upload-time = "2026-05-11T18:35:55.742Z" }, + { url = "https://files.pythonhosted.org/packages/94/21/f54be870d6dd53a82c674407e0f8eed7174b05ec78d42e5abd7b42e84fd5/mypy-2.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e195b817c13f02352a9c124301f9f30f078405444679b6753c1b96b6eed37285", size = 15039200, upload-time = "2026-05-11T18:33:10.281Z" }, + { url = "https://files.pythonhosted.org/packages/17/99/bf21748626a40ce59fd29a39386ab46afec88b7bd2f0fa6c3a97c995523f/mypy-2.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:5431d42af987ebd92ba2f71d45c85ed41d8e6ca9f5fd209a69f68f707d2469e5", size = 15272690, upload-time = "2026-05-11T18:32:07.205Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d7/9e90d2cf47100bea550ed2bc7b0d4de3a62181d84d5e37da0003e8462637/mypy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:767fe8c66dc3e01e19e1737d4c38ebefead16125e1b8e58ad421903b376f5c65", size = 11147435, upload-time = "2026-05-11T18:33:56.477Z" }, + { url = "https://files.pythonhosted.org/packages/ec/46/e5c449e858798e35ffc90946282a27c62a77be743fe17480e4977374eb91/mypy-2.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:ecfe70d43775ab99562ab128ce49854a362044c9f894961f68f898c23cb7429d", size = 10035052, upload-time = "2026-05-11T18:32:30.049Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ca/b279a672e874aedd5498ae25f722dacc8aa86bbffb939b3f97cbb1cf6686/mypy-2.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:7354c5a7f69d9345c3d6e69921d57088eea3ddeeb6b20d34c1b3855b02c36ec2", size = 14848422, upload-time = "2026-05-11T18:35:45.984Z" }, + { url = "https://files.pythonhosted.org/packages/27/e6/3efe56c631d959b9b4454e208b0ac4b7f4f58b404c89f8bec7b49efdfc21/mypy-2.1.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:49890d4f76ac9e06ec117f9e09f3174da70a620a0c300953d8595c926e80947f", size = 13677374, upload-time = "2026-05-11T18:36:57.188Z" }, + { url = "https://files.pythonhosted.org/packages/84/7f/8107ea87a44fd1f1b59882442f033c9c3488c127201b1d1d15f1cbd6022e/mypy-2.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:761be68e023ef5d94678772396a8af1220030f80837a3afd8d0aef3b419666f4", size = 14055743, upload-time = "2026-05-11T18:35:18.361Z" }, + { url = "https://files.pythonhosted.org/packages/51/4d/b6d34db183133b83761b9199a82d31557cdbb70a380d8c3b3438e11882a3/mypy-2.1.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c90345fc182dc363b891350457ec69c35140858538f38b4540845afcc32b1aef", size = 15020937, upload-time = "2026-05-11T18:34:59.618Z" }, + { url = "https://files.pythonhosted.org/packages/ff/d7/f08360c691d758acb02f45022c34d98b92892f4ea756644e1000d4b9f3d8/mypy-2.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b84802e7b5a6daf1f5e15bc9fcd7ddae77be13981ffab037f1c67bb84d67d135", size = 15253371, upload-time = "2026-05-11T18:36:41.081Z" }, + { url = "https://files.pythonhosted.org/packages/67/1b/09460a13719530a19bce27bd3bc8449e83569dd2ba7faf51c9c3c30c0b61/mypy-2.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:022c771234936ceac541ebaf836fe9e2abeb3f5e09aff21588fe543ff006fe21", size = 11326429, upload-time = "2026-05-11T18:34:13.526Z" }, + { url = "https://files.pythonhosted.org/packages/40/62/75dbf0f82f7b6680340efc614af29dd0b3c17b8a4f1cd09b8bd2fd6bc814/mypy-2.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:498207db725cec88829a6a5c2fc771205fd043719ef98bc49aba8fb9fc4e6d57", size = 10218799, upload-time = "2026-05-11T18:32:23.491Z" }, + { url = "https://files.pythonhosted.org/packages/b2/66/caca04ed7d972fb6eb6dd1ccd6df1de5c38fae8c5b3dc1c4e8e0d85ee6b9/mypy-2.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:7d5e5cad0efeba72b93cd17490cc0d69c5ac9ca132994fe3fb0314808aeeb83e", size = 15923458, upload-time = "2026-05-11T18:35:28.64Z" }, + { url = "https://files.pythonhosted.org/packages/ed/52/2d90cbe49d014b13ed7ff337930c30bad35893fe38a1e4641e756bb62191/mypy-2.1.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ff715050c127d724fd260a2e666e7747fdd83511c0c47d449d98238970aef780", size = 14757697, upload-time = "2026-05-11T18:36:14.208Z" }, + { url = "https://files.pythonhosted.org/packages/ac/37/d98f4a14e081b238992d0ed96b6d39c7cc0148c9699eb71eaa68629665ea/mypy-2.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:82208da9e09414d520e912d3e462d454854bed0810b71540bb016dcbca7308fd", size = 15405638, upload-time = "2026-05-11T18:33:48.249Z" }, + { url = "https://files.pythonhosted.org/packages/a3/c2/15c46613b24a84fad2aea1248bf9619b99c2767ae9071fe224c179a0b7d4/mypy-2.1.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e79ebc1b904b84f0310dff7469655a9c36c7a68bddb37bdd42b67a332df61d08", size = 16215852, upload-time = "2026-05-11T18:32:50.296Z" }, + { url = "https://files.pythonhosted.org/packages/5c/90/9c16a57f482c76d25f6379762b56bbf65c711d8158cf271fb2802cfb0640/mypy-2.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e583edc957cfb0deb142079162ae826f58449b116c1d442f2d91c69d9fced081", size = 16452695, upload-time = "2026-05-11T18:33:38.182Z" }, + { url = "https://files.pythonhosted.org/packages/0f/4c/215a4eeb63cacc5f17f516691ea7285d11e249802b942476bff15922a314/mypy-2.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b33b6cd332695bba180d55e717a79d3038e479a2c49cc5eb3d53603409b9a5d7", size = 12866622, upload-time = "2026-05-11T18:34:39.945Z" }, + { url = "https://files.pythonhosted.org/packages/4b/50/1043e1db5f455ffe4c9ab22747cd8ca2bc492b1e4f4e21b130a44ee2b217/mypy-2.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:4f910fe825376a7b66ef7ca8c98e5a149e8cd64c19ae71d84047a74ee060d4e6", size = 10610798, upload-time = "2026-05-11T18:36:31.444Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2a/13ca1f292f6db1b98ff495ef3467736b331621c5917cad984b7043e7348d/mypy-2.1.0-py3-none-any.whl", hash = "sha256:a663814603a5c563fb87a4f96fb473eeb30d1f5a4885afcf44f9db000a366289", size = 2693302, upload-time = "2026-05-11T18:31:29.246Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, +] + +[[package]] +name = "opentelemetry-api" +version = "1.44.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/8b/aa9e2d8b8dfa7c946f7dec5d1f8f6ba8eca062f43509a06bdb5ce93d26c0/opentelemetry_api-1.44.0.tar.gz", hash = "sha256:67647e5e9566edcf421166fdf022b3537f818635daa852b289e34604dc6fb33a", size = 72406, upload-time = "2026-07-16T15:25:32.678Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ca/6f/a04e900f465ff3221ccc395522503e2d10e79fa21f2723c8e177aae1e0d1/opentelemetry_api-1.44.0-py3-none-any.whl", hash = "sha256:94b98c893a91b88657eaac1e3ba89618cdb85be6918196705354f34728b2cdef", size = 60018, upload-time = "2026-07-16T15:25:11.657Z" }, +] + +[[package]] +name = "opentelemetry-sdk" +version = "1.44.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "opentelemetry-api" }, + { name = "opentelemetry-semantic-conventions" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5d/77/a6592cbc7c8d9bcc9d6757a9df45e04a7c585e3e6e7a13456da522b21109/opentelemetry_sdk-1.44.0.tar.gz", hash = "sha256:cebe7f65dc12f26ead75c6064de12fd2a9052e5060c0272d402cfa203aae123b", size = 208624, upload-time = "2026-07-16T15:25:46.078Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/23/ff077e61886ee020a17ce9c8b6fa11c601c8d8345b09ea24f605445df62a/opentelemetry_sdk-1.44.0-py3-none-any.whl", hash = "sha256:df081c4c6bcfdb1211e3e86140376792643128a25f8d72d1d27675936e7e96ad", size = 137221, upload-time = "2026-07-16T15:25:29.534Z" }, +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.65b0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "opentelemetry-api" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8f/73/0cbdebcb4cf545fdd328da14f5137e37d0770c3f26185e478b0d15d94f50/opentelemetry_semantic_conventions-0.65b0.tar.gz", hash = "sha256:f9b2b81e9d5b64f11bc952075e7e9c7fb0aab075c7fd1c46d597f1b919852d60", size = 148774, upload-time = "2026-07-16T15:25:46.902Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a6/0e/49df70d9b81fb5cbae4bbf2a49d865b09bcbcbc4eb53f5851b1027738d78/opentelemetry_semantic_conventions-0.65b0-py3-none-any.whl", hash = "sha256:1cacde7b0ad306f84c5ef08c3dbe1bbaf20165bba6f8bff43b670e555a086bcb", size = 204645, upload-time = "2026-07-16T15:25:30.688Z" }, +] + [[package]] name = "packaging" version = "25.0" @@ -634,6 +681,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, ] +[[package]] +name = "pathspec" +version = "1.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, +] + [[package]] name = "pip-requirements-parser" version = "32.0.1" @@ -647,15 +703,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/54/d0/d04f1d1e064ac901439699ee097f58688caadea42498ec9c4b4ad2ef84ab/pip_requirements_parser-32.0.1-py3-none-any.whl", hash = "sha256:4659bc2a667783e7a15d190f6fccf8b2486685b6dba4c19c3876314769c57526", size = 35648, upload-time = "2022-12-21T15:25:21.046Z" }, ] -[[package]] -name = "platformdirs" -version = "4.5.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/cf/86/0248f086a84f01b37aaec0fa567b397df1a119f73c16f6c7a9aac73ea309/platformdirs-4.5.1.tar.gz", hash = "sha256:61d5cdcc6065745cdd94f0f878977f8de9437be93de97c1c12f853c9c0cdcbda", size = 21715, upload-time = "2025-12-05T13:52:58.638Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/28/3bfe2fa5a7b9c46fe7e13c97bda14c895fb10fa2ebf1d0abb90e0cea7ee1/platformdirs-4.5.1-py3-none-any.whl", hash = "sha256:d03afa3963c806a9bed9d5125c8f4cb2fdaf74a55ab60e5d59b3fde758104d31", size = 18731, upload-time = "2025-12-05T13:52:56.823Z" }, -] - [[package]] name = "pluggy" version = "1.6.0" @@ -667,11 +714,11 @@ wheels = [ [[package]] name = "pycparser" -version = "2.23" +version = "3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/fe/cf/d2d3b9f5699fb1e4615c8e32ff220203e43b248e1dfcc6736ad9057731ca/pycparser-2.23.tar.gz", hash = "sha256:78816d4f24add8f10a06d6f05b4d424ad9e96cfebf68a4ddc99c65c0720d00c2", size = 173734, upload-time = "2025-09-09T13:23:47.91Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/e3/59cd50310fc9b59512193629e1984c1f95e5c8ae6e5d8c69532ccc65a7fe/pycparser-2.23-py3-none-any.whl", hash = "sha256:e5c6e8d3fbad53479cab09ac03729e0a9faf2bee3db8208a550daf5af81a5934", size = 118140, upload-time = "2025-09-09T13:23:46.651Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, ] [[package]] @@ -689,6 +736,11 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, ] +[package.optional-dependencies] +email = [ + { name = "email-validator" }, +] + [[package]] name = "pydantic-core" version = "2.41.5" @@ -698,47 +750,6 @@ dependencies = [ ] sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c6/90/32c9941e728d564b411d574d8ee0cf09b12ec978cb22b294995bae5549a5/pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146", size = 2107298, upload-time = "2025-11-04T13:39:04.116Z" }, - { url = "https://files.pythonhosted.org/packages/fb/a8/61c96a77fe28993d9a6fb0f4127e05430a267b235a124545d79fea46dd65/pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2", size = 1901475, upload-time = "2025-11-04T13:39:06.055Z" }, - { url = "https://files.pythonhosted.org/packages/5d/b6/338abf60225acc18cdc08b4faef592d0310923d19a87fba1faf05af5346e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97", size = 1918815, upload-time = "2025-11-04T13:39:10.41Z" }, - { url = "https://files.pythonhosted.org/packages/d1/1c/2ed0433e682983d8e8cba9c8d8ef274d4791ec6a6f24c58935b90e780e0a/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9", size = 2065567, upload-time = "2025-11-04T13:39:12.244Z" }, - { url = "https://files.pythonhosted.org/packages/b3/24/cf84974ee7d6eae06b9e63289b7b8f6549d416b5c199ca2d7ce13bbcf619/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52", size = 2230442, upload-time = "2025-11-04T13:39:13.962Z" }, - { url = "https://files.pythonhosted.org/packages/fd/21/4e287865504b3edc0136c89c9c09431be326168b1eb7841911cbc877a995/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941", size = 2350956, upload-time = "2025-11-04T13:39:15.889Z" }, - { url = "https://files.pythonhosted.org/packages/a8/76/7727ef2ffa4b62fcab916686a68a0426b9b790139720e1934e8ba797e238/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a", size = 2068253, upload-time = "2025-11-04T13:39:17.403Z" }, - { url = "https://files.pythonhosted.org/packages/d5/8c/a4abfc79604bcb4c748e18975c44f94f756f08fb04218d5cb87eb0d3a63e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c", size = 2177050, upload-time = "2025-11-04T13:39:19.351Z" }, - { url = "https://files.pythonhosted.org/packages/67/b1/de2e9a9a79b480f9cb0b6e8b6ba4c50b18d4e89852426364c66aa82bb7b3/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2", size = 2147178, upload-time = "2025-11-04T13:39:21Z" }, - { url = "https://files.pythonhosted.org/packages/16/c1/dfb33f837a47b20417500efaa0378adc6635b3c79e8369ff7a03c494b4ac/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556", size = 2341833, upload-time = "2025-11-04T13:39:22.606Z" }, - { url = "https://files.pythonhosted.org/packages/47/36/00f398642a0f4b815a9a558c4f1dca1b4020a7d49562807d7bc9ff279a6c/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49", size = 2321156, upload-time = "2025-11-04T13:39:25.843Z" }, - { url = "https://files.pythonhosted.org/packages/7e/70/cad3acd89fde2010807354d978725ae111ddf6d0ea46d1ea1775b5c1bd0c/pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba", size = 1989378, upload-time = "2025-11-04T13:39:27.92Z" }, - { url = "https://files.pythonhosted.org/packages/76/92/d338652464c6c367e5608e4488201702cd1cbb0f33f7b6a85a60fe5f3720/pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9", size = 2013622, upload-time = "2025-11-04T13:39:29.848Z" }, - { url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" }, - { url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" }, - { url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" }, - { url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" }, - { url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" }, - { url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" }, - { url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" }, - { url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" }, - { url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" }, - { url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" }, - { url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" }, - { url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" }, - { url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" }, - { url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" }, - { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, - { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, - { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, - { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, - { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, - { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, - { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, - { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, - { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, - { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, - { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, - { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, - { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, - { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, @@ -781,30 +792,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, - { url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" }, - { url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" }, - { url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" }, - { url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" }, - { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, - { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, - { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, - { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, - { url = "https://files.pythonhosted.org/packages/e6/b0/1a2aa41e3b5a4ba11420aba2d091b2d17959c8d1519ece3627c371951e73/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8", size = 2103351, upload-time = "2025-11-04T13:43:02.058Z" }, - { url = "https://files.pythonhosted.org/packages/a4/ee/31b1f0020baaf6d091c87900ae05c6aeae101fa4e188e1613c80e4f1ea31/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a", size = 1925363, upload-time = "2025-11-04T13:43:05.159Z" }, - { url = "https://files.pythonhosted.org/packages/e1/89/ab8e86208467e467a80deaca4e434adac37b10a9d134cd2f99b28a01e483/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b", size = 2135615, upload-time = "2025-11-04T13:43:08.116Z" }, - { url = "https://files.pythonhosted.org/packages/99/0a/99a53d06dd0348b2008f2f30884b34719c323f16c3be4e6cc1203b74a91d/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2", size = 2175369, upload-time = "2025-11-04T13:43:12.49Z" }, - { url = "https://files.pythonhosted.org/packages/6d/94/30ca3b73c6d485b9bb0bc66e611cff4a7138ff9736b7e66bcf0852151636/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093", size = 2144218, upload-time = "2025-11-04T13:43:15.431Z" }, - { url = "https://files.pythonhosted.org/packages/87/57/31b4f8e12680b739a91f472b5671294236b82586889ef764b5fbc6669238/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a", size = 2329951, upload-time = "2025-11-04T13:43:18.062Z" }, - { url = "https://files.pythonhosted.org/packages/7d/73/3c2c8edef77b8f7310e6fb012dbc4b8551386ed575b9eb6fb2506e28a7eb/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963", size = 2318428, upload-time = "2025-11-04T13:43:20.679Z" }, - { url = "https://files.pythonhosted.org/packages/2f/02/8559b1f26ee0d502c74f9cca5c0d2fd97e967e083e006bbbb4e97f3a043a/pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a", size = 2147009, upload-time = "2025-11-04T13:43:23.286Z" }, - { url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" }, - { url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" }, - { url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" }, - { url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" }, - { url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" }, - { url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" }, - { url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" }, - { url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" }, ] [[package]] @@ -817,25 +804,26 @@ wheels = [ ] [[package]] -name = "pyparsing" -version = "3.2.5" +name = "pyjwt" +version = "2.13.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f2/a5/181488fc2b9d093e3972d2a472855aae8a03f000592dbfce716a512b3359/pyparsing-3.2.5.tar.gz", hash = "sha256:2df8d5b7b2802ef88e8d016a2eb9c7aeaa923529cd251ed0fe4608275d4105b6", size = 1099274, upload-time = "2025-09-21T04:11:06.277Z" } +sdist = { url = "https://files.pythonhosted.org/packages/3b/81/58d0ac84e1ef3a3843791d6954d94c0b33d526c75eeb1efbce9d0a4c4077/pyjwt-2.13.0.tar.gz", hash = "sha256:41571c89ca91598c79e8ef18a2d07367d4810fbbd6f637794879baf1b7703423", size = 107515, upload-time = "2026-05-21T19:54:36.618Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/10/5e/1aa9a93198c6b64513c9d7752de7422c06402de6600a8767da1524f9570b/pyparsing-3.2.5-py3-none-any.whl", hash = "sha256:e38a4f02064cf41fe6593d328d0512495ad1f3d8a91c4f73fc401b3079a59a5e", size = 113890, upload-time = "2025-09-21T04:11:04.117Z" }, + { url = "https://files.pythonhosted.org/packages/a3/5e/ecf12fdb62546d64385c158514e9b2b671f7832108ef2ecd2020ce0af2d1/pyjwt-2.13.0-py3-none-any.whl", hash = "sha256:66adcc2aff09b3f1bbd95fc1e1577df8ac8723c978552fd43304c8a290ac5728", size = 31274, upload-time = "2026-05-21T19:54:35.362Z" }, +] + +[package.optional-dependencies] +crypto = [ + { name = "cryptography" }, ] [[package]] -name = "pyproject-api" -version = "1.10.0" +name = "pyparsing" +version = "3.3.2" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "packaging" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/45/7b/c0e1333b61d41c69e59e5366e727b18c4992688caf0de1be10b3e5265f6b/pyproject_api-1.10.0.tar.gz", hash = "sha256:40c6f2d82eebdc4afee61c773ed208c04c19db4c4a60d97f8d7be3ebc0bbb330", size = 22785, upload-time = "2025-10-09T19:12:27.21Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/91/9c6ee907786a473bf81c5f53cf703ba0957b23ab84c264080fb5a450416f/pyparsing-3.3.2.tar.gz", hash = "sha256:c777f4d763f140633dcb6d8a3eda953bf7a214dc4eff598413c070bcdc117cbc", size = 6851574, upload-time = "2026-01-21T03:57:59.36Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/54/cc/cecf97be298bee2b2a37dd360618c819a2a7fd95251d8e480c1f0eb88f3b/pyproject_api-1.10.0-py3-none-any.whl", hash = "sha256:8757c41a79c0f4ab71b99abed52b97ecf66bd20b04fa59da43b5840bac105a09", size = 13218, upload-time = "2025-10-09T19:12:24.428Z" }, + { url = "https://files.pythonhosted.org/packages/10/bd/c038d7cc38edc1aa5bf91ab8068b63d4308c66c4c8bb3cbba7dfbc049f9c/pyparsing-3.3.2-py3-none-any.whl", hash = "sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d", size = 122781, upload-time = "2026-01-21T03:57:55.912Z" }, ] [[package]] @@ -844,24 +832,34 @@ version = "9.0.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "iniconfig" }, { name = "packaging" }, { name = "pluggy" }, { name = "pygments" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" }, ] +[[package]] +name = "pytest-asyncio" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" }, +] + [[package]] name = "pytest-cov" version = "7.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "coverage", extra = ["toml"] }, + { name = "coverage" }, { name = "pluggy" }, { name = "pytest" }, ] @@ -893,24 +891,18 @@ wheels = [ [[package]] name = "pywin32" -version = "311" +version = "312" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7b/40/44efbb0dfbd33aca6a6483191dae0716070ed99e2ecb0c53683f400a0b4f/pywin32-311-cp310-cp310-win32.whl", hash = "sha256:d03ff496d2a0cd4a5893504789d4a15399133fe82517455e78bad62efbb7f0a3", size = 8760432, upload-time = "2025-07-14T20:13:05.9Z" }, - { url = "https://files.pythonhosted.org/packages/5e/bf/360243b1e953bd254a82f12653974be395ba880e7ec23e3731d9f73921cc/pywin32-311-cp310-cp310-win_amd64.whl", hash = "sha256:797c2772017851984b97180b0bebe4b620bb86328e8a884bb626156295a63b3b", size = 9590103, upload-time = "2025-07-14T20:13:07.698Z" }, - { url = "https://files.pythonhosted.org/packages/57/38/d290720e6f138086fb3d5ffe0b6caa019a791dd57866940c82e4eeaf2012/pywin32-311-cp310-cp310-win_arm64.whl", hash = "sha256:0502d1facf1fed4839a9a51ccbcc63d952cf318f78ffc00a7e78528ac27d7a2b", size = 8778557, upload-time = "2025-07-14T20:13:11.11Z" }, - { url = "https://files.pythonhosted.org/packages/7c/af/449a6a91e5d6db51420875c54f6aff7c97a86a3b13a0b4f1a5c13b988de3/pywin32-311-cp311-cp311-win32.whl", hash = "sha256:184eb5e436dea364dcd3d2316d577d625c0351bf237c4e9a5fabbcfa5a58b151", size = 8697031, upload-time = "2025-07-14T20:13:13.266Z" }, - { url = "https://files.pythonhosted.org/packages/51/8f/9bb81dd5bb77d22243d33c8397f09377056d5c687aa6d4042bea7fbf8364/pywin32-311-cp311-cp311-win_amd64.whl", hash = "sha256:3ce80b34b22b17ccbd937a6e78e7225d80c52f5ab9940fe0506a1a16f3dab503", size = 9508308, upload-time = "2025-07-14T20:13:15.147Z" }, - { url = "https://files.pythonhosted.org/packages/44/7b/9c2ab54f74a138c491aba1b1cd0795ba61f144c711daea84a88b63dc0f6c/pywin32-311-cp311-cp311-win_arm64.whl", hash = "sha256:a733f1388e1a842abb67ffa8e7aad0e70ac519e09b0f6a784e65a136ec7cefd2", size = 8703930, upload-time = "2025-07-14T20:13:16.945Z" }, - { url = "https://files.pythonhosted.org/packages/e7/ab/01ea1943d4eba0f850c3c61e78e8dd59757ff815ff3ccd0a84de5f541f42/pywin32-311-cp312-cp312-win32.whl", hash = "sha256:750ec6e621af2b948540032557b10a2d43b0cee2ae9758c54154d711cc852d31", size = 8706543, upload-time = "2025-07-14T20:13:20.765Z" }, - { url = "https://files.pythonhosted.org/packages/d1/a8/a0e8d07d4d051ec7502cd58b291ec98dcc0c3fff027caad0470b72cfcc2f/pywin32-311-cp312-cp312-win_amd64.whl", hash = "sha256:b8c095edad5c211ff31c05223658e71bf7116daa0ecf3ad85f3201ea3190d067", size = 9495040, upload-time = "2025-07-14T20:13:22.543Z" }, - { url = "https://files.pythonhosted.org/packages/ba/3a/2ae996277b4b50f17d61f0603efd8253cb2d79cc7ae159468007b586396d/pywin32-311-cp312-cp312-win_arm64.whl", hash = "sha256:e286f46a9a39c4a18b319c28f59b61de793654af2f395c102b4f819e584b5852", size = 8710102, upload-time = "2025-07-14T20:13:24.682Z" }, - { url = "https://files.pythonhosted.org/packages/a5/be/3fd5de0979fcb3994bfee0d65ed8ca9506a8a1260651b86174f6a86f52b3/pywin32-311-cp313-cp313-win32.whl", hash = "sha256:f95ba5a847cba10dd8c4d8fefa9f2a6cf283b8b88ed6178fa8a6c1ab16054d0d", size = 8705700, upload-time = "2025-07-14T20:13:26.471Z" }, - { url = "https://files.pythonhosted.org/packages/e3/28/e0a1909523c6890208295a29e05c2adb2126364e289826c0a8bc7297bd5c/pywin32-311-cp313-cp313-win_amd64.whl", hash = "sha256:718a38f7e5b058e76aee1c56ddd06908116d35147e133427e59a3983f703a20d", size = 9494700, upload-time = "2025-07-14T20:13:28.243Z" }, - { url = "https://files.pythonhosted.org/packages/04/bf/90339ac0f55726dce7d794e6d79a18a91265bdf3aa70b6b9ca52f35e022a/pywin32-311-cp313-cp313-win_arm64.whl", hash = "sha256:7b4075d959648406202d92a2310cb990fea19b535c7f4a78d3f5e10b926eeb8a", size = 8709318, upload-time = "2025-07-14T20:13:30.348Z" }, - { url = "https://files.pythonhosted.org/packages/c9/31/097f2e132c4f16d99a22bfb777e0fd88bd8e1c634304e102f313af69ace5/pywin32-311-cp314-cp314-win32.whl", hash = "sha256:b7a2c10b93f8986666d0c803ee19b5990885872a7de910fc460f9b0c2fbf92ee", size = 8840714, upload-time = "2025-07-14T20:13:32.449Z" }, - { url = "https://files.pythonhosted.org/packages/90/4b/07c77d8ba0e01349358082713400435347df8426208171ce297da32c313d/pywin32-311-cp314-cp314-win_amd64.whl", hash = "sha256:3aca44c046bd2ed8c90de9cb8427f581c479e594e99b5c0bb19b29c10fd6cb87", size = 9656800, upload-time = "2025-07-14T20:13:34.312Z" }, - { url = "https://files.pythonhosted.org/packages/c0/d2/21af5c535501a7233e734b8af901574572da66fcc254cb35d0609c9080dd/pywin32-311-cp314-cp314-win_arm64.whl", hash = "sha256:a508e2d9025764a8270f93111a970e1d0fbfc33f4153b388bb649b7eec4f9b42", size = 8932540, upload-time = "2025-07-14T20:13:36.379Z" }, + { url = "https://files.pythonhosted.org/packages/2d/41/12fbfd7f36ed2146d8bc9de96c2741296bf0d490b98508496cff322e274c/pywin32-312-cp313-cp313-win32.whl", hash = "sha256:7a27df850933d16a8eabfbaeb73d52b273e2da667f80d70b01a89d1f6828d02c", size = 6370184, upload-time = "2026-06-04T07:49:36.253Z" }, + { url = "https://files.pythonhosted.org/packages/ba/db/36a78e3403099d31d9746d13fdcde5accc43c1155f375a34d15983a479a7/pywin32-312-cp313-cp313-win_amd64.whl", hash = "sha256:c53e878d15a1c44788082bfe712a905433473aa38f86375b7cf8b45e3acbaaf9", size = 6914298, upload-time = "2026-06-04T07:49:38.876Z" }, + { url = "https://files.pythonhosted.org/packages/84/37/c1697194092b76de9ed47ca124323f02c57ffc8a45c06f88a3d5acaf01eb/pywin32-312-cp313-cp313-win_arm64.whl", hash = "sha256:59aba5d5940842075343a5ddc6b11f1cdf0d1567fe745290359dfbcc7c2eb831", size = 6727640, upload-time = "2026-06-04T07:49:41.083Z" }, + { url = "https://files.pythonhosted.org/packages/fc/2b/1f3cded5822fd49c02f40544cbb5f58c7cfd6b1694869fd476cb6170ee97/pywin32-312-cp314-cp314-win32.whl", hash = "sha256:a77a90fbb6881238d2ca9c6fd797b25817f3768fe78d214a90137ff055a75f5b", size = 6468928, upload-time = "2026-06-04T07:49:43.188Z" }, + { url = "https://files.pythonhosted.org/packages/21/82/3bf86d2e2808902013132e1ce905a7da0da53790f3836c64bf44d55e24f3/pywin32-312-cp314-cp314-win_amd64.whl", hash = "sha256:a4dd3a848290ef724347b19f301045831d8e802fa4464f491b98b1e0a081432e", size = 7024157, upload-time = "2026-06-04T07:49:45.34Z" }, + { url = "https://files.pythonhosted.org/packages/a4/0e/73f6d6800b4f27655abd9e9f6aaeaefcddb2b946e4674efa2bab184a7f7b/pywin32-312-cp314-cp314-win_arm64.whl", hash = "sha256:9fce94568364e0155e6dfb781ac5d95903be8baf28670632beab1b523f300daa", size = 6839598, upload-time = "2026-06-04T07:49:47.613Z" }, + { url = "https://files.pythonhosted.org/packages/eb/61/caa39686032d2ebdd04ff0ab5cbe163126c0066d98e00c9018646e42393b/pywin32-312-cp315-cp315-win32.whl", hash = "sha256:5c1fbe4a937a73ae9297384a3da38518cbc694c68ad8a809b2e19acd350f03ed", size = 6471159, upload-time = "2026-06-04T07:49:50.035Z" }, + { url = "https://files.pythonhosted.org/packages/0f/cd/7e1de64a4a6f69c04214169657ccab0d93a670ea50e35eb8f489d7378249/pywin32-312-cp315-cp315-win_amd64.whl", hash = "sha256:c2f03a0f73f804a13c2735b99392b0cd426bb4f2c4d0178e5ac966a0f21618d5", size = 7025293, upload-time = "2026-06-04T07:49:54.857Z" }, + { url = "https://files.pythonhosted.org/packages/23/ed/4532e9388e65fa16b46776ef47ad631a64eda1631884488af707666350ed/pywin32-312-cp315-cp315-win_arm64.whl", hash = "sha256:a8597d28f267b39074aef51fa593530082b39cbe5a074226096857b1fed2dfb9", size = 6840337, upload-time = "2026-06-04T07:49:57.531Z" }, ] [[package]] @@ -919,34 +911,6 @@ version = "6.0.3" source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f4/a0/39350dd17dd6d6c6507025c0e53aef67a9293a6d37d3511f23ea510d5800/pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b", size = 184227, upload-time = "2025-09-25T21:31:46.04Z" }, - { url = "https://files.pythonhosted.org/packages/05/14/52d505b5c59ce73244f59c7a50ecf47093ce4765f116cdb98286a71eeca2/pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956", size = 174019, upload-time = "2025-09-25T21:31:47.706Z" }, - { url = "https://files.pythonhosted.org/packages/43/f7/0e6a5ae5599c838c696adb4e6330a59f463265bfa1e116cfd1fbb0abaaae/pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8", size = 740646, upload-time = "2025-09-25T21:31:49.21Z" }, - { url = "https://files.pythonhosted.org/packages/2f/3a/61b9db1d28f00f8fd0ae760459a5c4bf1b941baf714e207b6eb0657d2578/pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198", size = 840793, upload-time = "2025-09-25T21:31:50.735Z" }, - { url = "https://files.pythonhosted.org/packages/7a/1e/7acc4f0e74c4b3d9531e24739e0ab832a5edf40e64fbae1a9c01941cabd7/pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b", size = 770293, upload-time = "2025-09-25T21:31:51.828Z" }, - { url = "https://files.pythonhosted.org/packages/8b/ef/abd085f06853af0cd59fa5f913d61a8eab65d7639ff2a658d18a25d6a89d/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0", size = 732872, upload-time = "2025-09-25T21:31:53.282Z" }, - { url = "https://files.pythonhosted.org/packages/1f/15/2bc9c8faf6450a8b3c9fc5448ed869c599c0a74ba2669772b1f3a0040180/pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69", size = 758828, upload-time = "2025-09-25T21:31:54.807Z" }, - { url = "https://files.pythonhosted.org/packages/a3/00/531e92e88c00f4333ce359e50c19b8d1de9fe8d581b1534e35ccfbc5f393/pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e", size = 142415, upload-time = "2025-09-25T21:31:55.885Z" }, - { url = "https://files.pythonhosted.org/packages/2a/fa/926c003379b19fca39dd4634818b00dec6c62d87faf628d1394e137354d4/pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c", size = 158561, upload-time = "2025-09-25T21:31:57.406Z" }, - { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, - { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, - { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, - { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, - { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, - { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, - { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, - { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, - { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, - { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, - { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, - { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, - { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, - { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, - { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, - { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, - { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, - { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, - { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, { url = "https://files.pythonhosted.org/packages/d1/11/0fd08f8192109f7169db964b5707a2f1e8b745d4e239b784a5a1dd80d1db/pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8", size = 181669, upload-time = "2025-09-25T21:32:23.673Z" }, { url = "https://files.pythonhosted.org/packages/b1/16/95309993f1d3748cd644e02e38b75d50cbc0d9561d21f390a76242ce073f/pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1", size = 173252, upload-time = "2025-09-25T21:32:25.149Z" }, { url = "https://files.pythonhosted.org/packages/50/31/b20f376d3f810b9b2371e72ef5adb33879b25edb7a6d072cb7ca0c486398/pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c", size = 767081, upload-time = "2025-09-25T21:32:26.575Z" }, @@ -994,28 +958,27 @@ wheels = [ [[package]] name = "ruff" -version = "0.14.10" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/57/08/52232a877978dd8f9cf2aeddce3e611b40a63287dfca29b6b8da791f5e8d/ruff-0.14.10.tar.gz", hash = "sha256:9a2e830f075d1a42cd28420d7809ace390832a490ed0966fe373ba288e77aaf4", size = 5859763, upload-time = "2025-12-18T19:28:57.98Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/60/01/933704d69f3f05ee16ef11406b78881733c186fe14b6a46b05cfcaf6d3b2/ruff-0.14.10-py3-none-linux_armv6l.whl", hash = "sha256:7a3ce585f2ade3e1f29ec1b92df13e3da262178df8c8bdf876f48fa0e8316c49", size = 13527080, upload-time = "2025-12-18T19:29:25.642Z" }, - { url = "https://files.pythonhosted.org/packages/df/58/a0349197a7dfa603ffb7f5b0470391efa79ddc327c1e29c4851e85b09cc5/ruff-0.14.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:674f9be9372907f7257c51f1d4fc902cb7cf014b9980152b802794317941f08f", size = 13797320, upload-time = "2025-12-18T19:29:02.571Z" }, - { url = "https://files.pythonhosted.org/packages/7b/82/36be59f00a6082e38c23536df4e71cdbc6af8d7c707eade97fcad5c98235/ruff-0.14.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d85713d522348837ef9df8efca33ccb8bd6fcfc86a2cde3ccb4bc9d28a18003d", size = 12918434, upload-time = "2025-12-18T19:28:51.202Z" }, - { url = "https://files.pythonhosted.org/packages/a6/00/45c62a7f7e34da92a25804f813ebe05c88aa9e0c25e5cb5a7d23dd7450e3/ruff-0.14.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6987ebe0501ae4f4308d7d24e2d0fe3d7a98430f5adfd0f1fead050a740a3a77", size = 13371961, upload-time = "2025-12-18T19:29:04.991Z" }, - { url = "https://files.pythonhosted.org/packages/40/31/a5906d60f0405f7e57045a70f2d57084a93ca7425f22e1d66904769d1628/ruff-0.14.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:16a01dfb7b9e4eee556fbfd5392806b1b8550c9b4a9f6acd3dbe6812b193c70a", size = 13275629, upload-time = "2025-12-18T19:29:21.381Z" }, - { url = "https://files.pythonhosted.org/packages/3e/60/61c0087df21894cf9d928dc04bcd4fb10e8b2e8dca7b1a276ba2155b2002/ruff-0.14.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7165d31a925b7a294465fa81be8c12a0e9b60fb02bf177e79067c867e71f8b1f", size = 14029234, upload-time = "2025-12-18T19:29:00.132Z" }, - { url = "https://files.pythonhosted.org/packages/44/84/77d911bee3b92348b6e5dab5a0c898d87084ea03ac5dc708f46d88407def/ruff-0.14.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:c561695675b972effb0c0a45db233f2c816ff3da8dcfbe7dfc7eed625f218935", size = 15449890, upload-time = "2025-12-18T19:28:53.573Z" }, - { url = "https://files.pythonhosted.org/packages/e9/36/480206eaefa24a7ec321582dda580443a8f0671fdbf6b1c80e9c3e93a16a/ruff-0.14.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4bb98fcbbc61725968893682fd4df8966a34611239c9fd07a1f6a07e7103d08e", size = 15123172, upload-time = "2025-12-18T19:29:23.453Z" }, - { url = "https://files.pythonhosted.org/packages/5c/38/68e414156015ba80cef5473d57919d27dfb62ec804b96180bafdeaf0e090/ruff-0.14.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f24b47993a9d8cb858429e97bdf8544c78029f09b520af615c1d261bf827001d", size = 14460260, upload-time = "2025-12-18T19:29:27.808Z" }, - { url = "https://files.pythonhosted.org/packages/b3/19/9e050c0dca8aba824d67cc0db69fb459c28d8cd3f6855b1405b3f29cc91d/ruff-0.14.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59aabd2e2c4fd614d2862e7939c34a532c04f1084476d6833dddef4afab87e9f", size = 14229978, upload-time = "2025-12-18T19:29:11.32Z" }, - { url = "https://files.pythonhosted.org/packages/51/eb/e8dd1dd6e05b9e695aa9dd420f4577debdd0f87a5ff2fedda33c09e9be8c/ruff-0.14.10-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:213db2b2e44be8625002dbea33bb9c60c66ea2c07c084a00d55732689d697a7f", size = 14338036, upload-time = "2025-12-18T19:29:09.184Z" }, - { url = "https://files.pythonhosted.org/packages/6a/12/f3e3a505db7c19303b70af370d137795fcfec136d670d5de5391e295c134/ruff-0.14.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b914c40ab64865a17a9a5b67911d14df72346a634527240039eb3bd650e5979d", size = 13264051, upload-time = "2025-12-18T19:29:13.431Z" }, - { url = "https://files.pythonhosted.org/packages/08/64/8c3a47eaccfef8ac20e0484e68e0772013eb85802f8a9f7603ca751eb166/ruff-0.14.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1484983559f026788e3a5c07c81ef7d1e97c1c78ed03041a18f75df104c45405", size = 13283998, upload-time = "2025-12-18T19:29:06.994Z" }, - { url = "https://files.pythonhosted.org/packages/12/84/534a5506f4074e5cc0529e5cd96cfc01bb480e460c7edf5af70d2bcae55e/ruff-0.14.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c70427132db492d25f982fffc8d6c7535cc2fd2c83fc8888f05caaa248521e60", size = 13601891, upload-time = "2025-12-18T19:28:55.811Z" }, - { url = "https://files.pythonhosted.org/packages/0d/1e/14c916087d8598917dbad9b2921d340f7884824ad6e9c55de948a93b106d/ruff-0.14.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5bcf45b681e9f1ee6445d317ce1fa9d6cba9a6049542d1c3d5b5958986be8830", size = 14336660, upload-time = "2025-12-18T19:29:16.531Z" }, - { url = "https://files.pythonhosted.org/packages/f2/1c/d7b67ab43f30013b47c12b42d1acd354c195351a3f7a1d67f59e54227ede/ruff-0.14.10-py3-none-win32.whl", hash = "sha256:104c49fc7ab73f3f3a758039adea978869a918f31b73280db175b43a2d9b51d6", size = 13196187, upload-time = "2025-12-18T19:29:19.006Z" }, - { url = "https://files.pythonhosted.org/packages/fb/9c/896c862e13886fae2af961bef3e6312db9ebc6adc2b156fe95e615dee8c1/ruff-0.14.10-py3-none-win_amd64.whl", hash = "sha256:466297bd73638c6bdf06485683e812db1c00c7ac96d4ddd0294a338c62fdc154", size = 14661283, upload-time = "2025-12-18T19:29:30.16Z" }, - { url = "https://files.pythonhosted.org/packages/74/31/b0e29d572670dca3674eeee78e418f20bdf97fa8aa9ea71380885e175ca0/ruff-0.14.10-py3-none-win_arm64.whl", hash = "sha256:e51d046cf6dda98a4633b8a8a771451107413b0f07183b2bef03f075599e44e6", size = 13729839, upload-time = "2025-12-18T19:28:48.636Z" }, +version = "0.15.16" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/5f7ec371001337d8fa61701c186ff8b613ecac1651848c5950f4c4d5f2e9/ruff-0.15.16.tar.gz", hash = "sha256:d05e78d38c78caf020b03789e25106c93017db5a0cb6e2819885018c61343b78", size = 4714267, upload-time = "2026-06-04T16:33:09.974Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/42/53ef1c3953f157956db9bf7861e3bc50b9b887ce93300aa48cdba8336fe6/ruff-0.15.16-py3-none-linux_armv6l.whl", hash = "sha256:6ac3c0b3969cc6cf6b158c4e2f8f682acb58e7d700d8a44b65ecdc72d66ab0b2", size = 10709025, upload-time = "2026-06-04T16:32:51.935Z" }, + { url = "https://files.pythonhosted.org/packages/93/9a/a79159346f19134a956607754e57d8d128f7a4c00f4ad2f7514d224c172c/ruff-0.15.16-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:197c207ed75ffba54a0dec23db4aa939a27a3053073e085e0042433cbdc58e4a", size = 11063550, upload-time = "2026-06-04T16:32:42.24Z" }, + { url = "https://files.pythonhosted.org/packages/bc/72/3ce2ac000a5299ec238e01f51397b3b653c93b077d9b1bfe8715bb895f20/ruff-0.15.16-py3-none-macosx_11_0_arm64.whl", hash = "sha256:3a39fec45ab316cc23e7558f23fea4a70403ddb5648ea9a4a3854a16973d0071", size = 10421345, upload-time = "2026-06-04T16:32:37.251Z" }, + { url = "https://files.pythonhosted.org/packages/b0/c2/cc7fad3ec9169373f5b6a18f1917b91080feec40c3f9658334a1d28e2f03/ruff-0.15.16-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba93191d79003116b95128c9d306e045200fdbd0bccb782b110f3cd1d4abc5cf", size = 10757217, upload-time = "2026-06-04T16:32:54.722Z" }, + { url = "https://files.pythonhosted.org/packages/69/d2/3474009eaa0a65b31fa7152a2fad5e2f050c640ceb1e6b02ee6922e94c82/ruff-0.15.16-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c6ee4b90520630120ef032aa5cc10db483852dff950e78b1d717e2993a61ac8d", size = 10507035, upload-time = "2026-06-04T16:33:05.343Z" }, + { url = "https://files.pythonhosted.org/packages/ca/81/b7ae6ccbd11f0c8dc3d5d67fc4be9b57ff57ca86ba56152021378e1277f2/ruff-0.15.16-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e4215bc938bc3c8215c1472c1aa437e310fee20cd427335fec9d7e609563628", size = 11255291, upload-time = "2026-06-04T16:32:49.49Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e1/46e526f1a7cc90857ce6ddf25fbb77eb6568651ac38d71b033af07076dd5/ruff-0.15.16-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7c8d26be963b090f10e29abc8b3e74a2a321f6fa34e02424e30b5af89350ecbb", size = 12124922, upload-time = "2026-06-04T16:33:07.821Z" }, + { url = "https://files.pythonhosted.org/packages/1a/da/5c791b088b596b24d0deb967fa28ae02ad751a140c0b9ea81c5ab915d6c0/ruff-0.15.16-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f198cf4123602a2280ed46c307bcbafe41758d6fee5b456b6b6058ca1514b3b4", size = 11332186, upload-time = "2026-06-04T16:33:02.971Z" }, + { url = "https://files.pythonhosted.org/packages/72/11/5da87abe20047c8962361473923ebb2f62b595250126aadfad8c20649c1e/ruff-0.15.16-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bb27515fa6240fb586ae82b901a59e67d24acff86f2190b433dc542fe0435aeb", size = 11373541, upload-time = "2026-06-04T16:32:47.007Z" }, + { url = "https://files.pythonhosted.org/packages/fe/2a/8554754c23a854ae3fd6b507e36ad61ddb121e298c6d5d617dec94ed0f14/ruff-0.15.16-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a267c46ba1593fc26b8eecbea050b39d40c0b6bb7781ee11c90a02cd10032951", size = 11353014, upload-time = "2026-06-04T16:32:34.795Z" }, + { url = "https://files.pythonhosted.org/packages/62/25/62ea41529ec89f742ea3fed9cb1059c72877ec7cf9b9e99ac9cf3294d1d9/ruff-0.15.16-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:528c68f39a91498a8d50e91ff5985df3d105782bab49cc378e73ac26bff083e8", size = 10737467, upload-time = "2026-06-04T16:32:26.348Z" }, + { url = "https://files.pythonhosted.org/packages/90/17/334d3ad9de4d40f9dd58fdd09e35ce64553bb501e2f19a839e2fb6be14fc/ruff-0.15.16-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7ed55c58950df60589a9a7a5d2f8fa5f54ebd287163be805adfe6ee95a9de123", size = 10521910, upload-time = "2026-06-04T16:32:32.54Z" }, + { url = "https://files.pythonhosted.org/packages/4d/bd/3ac7c6ae77a885c1004b3dda2446ea401768d24f851c14b4ad4b24f6639c/ruff-0.15.16-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d482feaf51512b50f9790ceb417a56a61dd1e9d9bf967662b9ed27c01b34f53a", size = 10979190, upload-time = "2026-06-04T16:32:57.492Z" }, + { url = "https://files.pythonhosted.org/packages/33/d7/609546e6a413c3f216fbf2a50c928f97c80939154f6a0503114094a86191/ruff-0.15.16-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1e15bc8c94513dae2a40cc9ef07c94fdd4ecc9e29dabebeebe170f952322c9e3", size = 11477014, upload-time = "2026-06-04T16:32:44.687Z" }, + { url = "https://files.pythonhosted.org/packages/74/0d/f2cd247ad32633a5c36e97141a2c21b11c6279f7957bc2ff360b1e08fddd/ruff-0.15.16-py3-none-win32.whl", hash = "sha256:580378f7bd4aa25f72e74aa54948a9622f142b1e509521dd10902e886681cc1e", size = 10735541, upload-time = "2026-06-04T16:32:30.145Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9e/02e845ef151b1dee585e55c4739f8e1734ae1d9f1221dff65761c162208b/ruff-0.15.16-py3-none-win_amd64.whl", hash = "sha256:408256017284eddf98fff77b29aa4fb30f586042d535b2d9befc6512f400aaec", size = 11843403, upload-time = "2026-06-04T16:32:39.76Z" }, + { url = "https://files.pythonhosted.org/packages/15/19/016553f86f207450aebebc2b2b5088d086b901cc8186c02ac4284db3bd88/ruff-0.15.16-py3-none-win_arm64.whl", hash = "sha256:8cd61783afb39638a7133ef0d2dfb1e91277593962f81b5a8423eb0b888a6121", size = 11134555, upload-time = "2026-06-04T16:33:00.136Z" }, ] [[package]] @@ -1036,6 +999,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/78/3565d011c61f5a43488987ee32b6f3f656e7f107ac2782dd57bdd7d91d9a/snowballstemmer-3.0.1-py3-none-any.whl", hash = "sha256:6cd7b3897da8d6c9ffb968a6781fa6532dce9c3618a4b127d920dab764a19064", size = 103274, upload-time = "2025-05-09T16:34:50.371Z" }, ] +[[package]] +name = "soupsieve" +version = "2.9.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/69/99/a6ca3beb3ccacb41fb3321d8a60e5566f9e6467601ef8eba6a17e1b89778/soupsieve-2.9.2.tar.gz", hash = "sha256:4a55d8cf158a9c2e587fa4922f1bbb91d68ac829e2d6f25403a85747c71daf74", size = 122445, upload-time = "2026-08-07T00:57:24.801Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/eb/dc/ad025c1ee131eba60c69f4dd5779b18fcf1e6b21a343e2162a84d5d133c7/soupsieve-2.9.2-py3-none-any.whl", hash = "sha256:8089a26fd974ca7a1f30276d3d8492ab266ab15af581642dfe8aa162e0c1c823", size = 37370, upload-time = "2026-08-07T00:57:23.524Z" }, +] + [[package]] name = "sphinx" version = "7.4.7" @@ -1057,13 +1029,24 @@ dependencies = [ { name = "sphinxcontrib-jsmath" }, { name = "sphinxcontrib-qthelp" }, { name = "sphinxcontrib-serializinghtml" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/5b/be/50e50cb4f2eff47df05673d361095cafd95521d2a22521b920c67a372dcb/sphinx-7.4.7.tar.gz", hash = "sha256:242f92a7ea7e6c5b406fdc2615413890ba9f699114a9c09192d7dfead2ee9cfe", size = 8067911, upload-time = "2024-07-20T14:46:56.059Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/0d/ef/153f6803c5d5f8917dbb7f7fcf6d34a871ede3296fa89c2c703f5f8a6c8e/sphinx-7.4.7-py3-none-any.whl", hash = "sha256:c2419e2135d11f1951cd994d6eb18a1835bd8fdd8429f9ca375dc1f3281bd239", size = 3401624, upload-time = "2024-07-20T14:46:52.142Z" }, ] +[[package]] +name = "sphinx-basic-ng" +version = "1.0.0b2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "sphinx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/98/0b/a866924ded68efec7a1759587a4e478aec7559d8165fac8b2ad1c0e774d6/sphinx_basic_ng-1.0.0b2.tar.gz", hash = "sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9", size = 20736, upload-time = "2023-07-08T18:40:54.166Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3c/dd/018ce05c532a22007ac58d4f45232514cd9d6dd0ee1dc374e309db830983/sphinx_basic_ng-1.0.0b2-py3-none-any.whl", hash = "sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b", size = 22496, upload-time = "2023-07-08T18:40:52.659Z" }, +] + [[package]] name = "sphinxcontrib-applehelp" version = "2.0.0" @@ -1120,7 +1103,7 @@ wheels = [ [[package]] name = "testcontainers" -version = "4.14.1" +version = "4.14.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "docker" }, @@ -1129,114 +1112,39 @@ dependencies = [ { name = "urllib3" }, { name = "wrapt" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8b/02/ef62dec9e4f804189c44df23f0b86897c738d38e9c48282fcd410308632f/testcontainers-4.14.1.tar.gz", hash = "sha256:316f1bb178d829c003acd650233e3ff3c59a833a08d8661c074f58a4fbd42a64", size = 80148, upload-time = "2026-01-31T23:13:46.915Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ca/ac/a597c3a0e02b26cbed6dd07df68be1e57684766fd1c381dee9b170a99690/testcontainers-4.14.2.tar.gz", hash = "sha256:1340ccf16fe3acd9389a6c9e1d9ab21d9fe99a8afdf8165f89c3e69c1967d239", size = 166841, upload-time = "2026-03-18T05:19:16.696Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c8/31/5e7b23f9e43ff7fd46d243808d70c5e8daf3bc08ecf5a7fb84d5e38f7603/testcontainers-4.14.1-py3-none-any.whl", hash = "sha256:03dfef4797b31c82e7b762a454b6afec61a2a512ad54af47ab41e4fa5415f891", size = 125640, upload-time = "2026-01-31T23:13:45.464Z" }, + { url = "https://files.pythonhosted.org/packages/13/2d/26b8b30067d94339afee62c3edc9b803a6eb9332f521ba77d8aaab5de873/testcontainers-4.14.2-py3-none-any.whl", hash = "sha256:0d0522c3cd8f8d9627cda41f7a6b51b639fa57bdc492923c045117933c668d68", size = 125712, upload-time = "2026-03-18T05:19:15.29Z" }, ] [[package]] -name = "tomli" -version = "2.3.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, - { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, - { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, - { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, - { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, - { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, - { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, - { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, - { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, - { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, - { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, - { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, - { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, - { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, - { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, - { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, - { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, - { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, - { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, - { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, - { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, - { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, - { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, - { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, - { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, - { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, - { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, - { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, - { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, - { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, - { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, - { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, - { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, - { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, - { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, - { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, - { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, - { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, - { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, - { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, -] - -[[package]] -name = "tox" -version = "4.32.0" +name = "types-python-dateutil" +version = "2.9.0.20251115" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cachetools" }, - { name = "chardet" }, - { name = "colorama" }, - { name = "filelock" }, - { name = "packaging" }, - { name = "platformdirs" }, - { name = "pluggy" }, - { name = "pyproject-api" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, - { name = "virtualenv" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/59/bf/0e4dbd42724cbae25959f0e34c95d0c730df03ab03f54d52accd9abfc614/tox-4.32.0.tar.gz", hash = "sha256:1ad476b5f4d3679455b89a992849ffc3367560bbc7e9495ee8a3963542e7c8ff", size = 203330, upload-time = "2025-10-24T18:03:38.132Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/36/06d01fb52c0d57e9ad0c237654990920fa41195e4b3d640830dabf9eeb2f/types_python_dateutil-2.9.0.20251115.tar.gz", hash = "sha256:8a47f2c3920f52a994056b8786309b43143faa5a64d4cbb2722d6addabdf1a58", size = 16363, upload-time = "2025-11-15T03:00:13.717Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fc/cc/e09c0d663a004945f82beecd4f147053567910479314e8d01ba71e5d5dea/tox-4.32.0-py3-none-any.whl", hash = "sha256:451e81dc02ba8d1ed20efd52ee409641ae4b5d5830e008af10fe8823ef1bd551", size = 175905, upload-time = "2025-10-24T18:03:36.337Z" }, + { url = "https://files.pythonhosted.org/packages/43/0b/56961d3ba517ed0df9b3a27bfda6514f3d01b28d499d1bce9068cfe4edd1/types_python_dateutil-2.9.0.20251115-py3-none-any.whl", hash = "sha256:9cf9c1c582019753b8639a081deefd7e044b9fa36bd8217f565c6c4e36ee0624", size = 18251, upload-time = "2025-11-15T03:00:12.317Z" }, ] [[package]] -name = "ty" -version = "0.0.5" +name = "types-requests" +version = "2.33.0.20260518" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/9e/db/6299d478000f4f1c6f9bf2af749359381610ffc4cbe6713b66e436ecf6e7/ty-0.0.5.tar.gz", hash = "sha256:983da6330773ff71e2b249810a19c689f9a0372f6e21bbf7cde37839d05b4346", size = 4806218, upload-time = "2025-12-20T21:19:17.24Z" } +dependencies = [ + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e0/01/c5a19253fe1ac159159ddf9a3a07cec8bb5e486ec4d9002ad2821da0e5d2/types_requests-2.33.0.20260518.tar.gz", hash = "sha256:df7bd3bfe0ca8402dfb841e7d9be714bb5578203283d66d7dc4ef69343449a5e", size = 24752, upload-time = "2026-05-18T06:07:37.966Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7c/98/c1f61ba378b4191e641bb36c07b7fcc70ff844d61be7a4bf2fea7472b4a9/ty-0.0.5-py3-none-linux_armv6l.whl", hash = "sha256:1594cd9bb68015eb2f5a3c68a040860f3c9306dc6667d7a0e5f4df9967b460e2", size = 9785554, upload-time = "2025-12-20T21:19:05.024Z" }, - { url = "https://files.pythonhosted.org/packages/ab/f9/b37b77c03396bd779c1397dae4279b7ad79315e005b3412feed8812a4256/ty-0.0.5-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7c0140ba980233d28699d9ddfe8f43d0b3535d6a3bbff9935df625a78332a3cf", size = 9603995, upload-time = "2025-12-20T21:19:15.256Z" }, - { url = "https://files.pythonhosted.org/packages/7d/70/4e75c11903b0e986c0203040472627cb61d6a709e1797fb08cdf9d565743/ty-0.0.5-py3-none-macosx_11_0_arm64.whl", hash = "sha256:15de414712cde92048ae4b1a77c4dc22920bd23653fe42acaf73028bad88f6b9", size = 9145815, upload-time = "2025-12-20T21:19:36.481Z" }, - { url = "https://files.pythonhosted.org/packages/89/05/93983dfcf871a41dfe58e5511d28e6aa332a1f826cc67333f77ae41a2f8a/ty-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:438aa51ad6c5fae64191f8d58876266e26f9250cf09f6624b6af47a22fa88618", size = 9619849, upload-time = "2025-12-20T21:19:19.084Z" }, - { url = "https://files.pythonhosted.org/packages/82/b6/896ab3aad59f846823f202e94be6016fb3f72434d999d2ae9bd0f28b3af9/ty-0.0.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1b3d373fd96af1564380caf153600481c676f5002ee76ba8a7c3508cdff82ee0", size = 9606611, upload-time = "2025-12-20T21:19:24.583Z" }, - { url = "https://files.pythonhosted.org/packages/ca/ae/098e33fc92330285ed843e2750127e896140c4ebd2d73df7732ea496f588/ty-0.0.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8453692503212ad316cf8b99efbe85a91e5f63769c43be5345e435a1b16cba5a", size = 10029523, upload-time = "2025-12-20T21:19:07.055Z" }, - { url = "https://files.pythonhosted.org/packages/04/5a/f4b4c33758b9295e9aca0de9645deca0f4addd21d38847228723a6e780fc/ty-0.0.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:2e4c454139473abbd529767b0df7a795ed828f780aef8d0d4b144558c0dc4446", size = 10870892, upload-time = "2025-12-20T21:19:34.495Z" }, - { url = "https://files.pythonhosted.org/packages/c3/c5/4e3e7e88389365aa1e631c99378711cf0c9d35a67478cb4720584314cf44/ty-0.0.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:426d4f3b82475b1ec75f3cc9ee5a667c8a4ae8441a09fcd8e823a53b706d00c7", size = 10599291, upload-time = "2025-12-20T21:19:26.557Z" }, - { url = "https://files.pythonhosted.org/packages/c1/5d/138f859ea87bd95e17b9818e386ae25a910e46521c41d516bf230ed83ffc/ty-0.0.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5710817b67c6b2e4c0224e4f319b7decdff550886e9020f6d46aa1ce8f89a609", size = 10413515, upload-time = "2025-12-20T21:19:11.094Z" }, - { url = "https://files.pythonhosted.org/packages/27/21/1cbcd0d3b1182172f099e88218137943e0970603492fb10c7c9342369d9a/ty-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e23c55ef08882c7c5ced1ccb90b4eeefa97f690aea254f58ac0987896c590f76", size = 10144992, upload-time = "2025-12-20T21:19:13.225Z" }, - { url = "https://files.pythonhosted.org/packages/ad/30/fdac06a5470c09ad2659a0806497b71f338b395d59e92611f71b623d05a0/ty-0.0.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b9e4c1a28a23b14cf8f4f793f4da396939f16c30bfa7323477c8cc234e352ac4", size = 9606408, upload-time = "2025-12-20T21:19:09.212Z" }, - { url = "https://files.pythonhosted.org/packages/09/93/e99dcd7f53295192d03efd9cbcec089a916f49cad4935c0160ea9adbd53d/ty-0.0.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4e9ebb61529b9745af662e37c37a01ad743cdd2c95f0d1421705672874d806cd", size = 9630040, upload-time = "2025-12-20T21:19:38.165Z" }, - { url = "https://files.pythonhosted.org/packages/d7/f8/6d1e87186e4c35eb64f28000c1df8fd5f73167ce126c5e3dd21fd1204a23/ty-0.0.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:5eb191a8e332f50f56dfe45391bdd7d43dd4ef6e60884710fd7ce84c5d8c1eb5", size = 9754016, upload-time = "2025-12-20T21:19:32.79Z" }, - { url = "https://files.pythonhosted.org/packages/28/e6/20f989342cb3115852dda404f1d89a10a3ce93f14f42b23f095a3d1a00c9/ty-0.0.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:92ed7451a1e82ee134a2c24ca43b74dd31e946dff2b08e5c34473e6b051de542", size = 10252877, upload-time = "2025-12-20T21:19:20.787Z" }, - { url = "https://files.pythonhosted.org/packages/57/9d/fc66fa557443233dfad9ae197ff3deb70ae0efcfb71d11b30ef62f5cdcc3/ty-0.0.5-py3-none-win32.whl", hash = "sha256:71f6707e4c1c010c158029a688a498220f28bb22fdb6707e5c20e09f11a5e4f2", size = 9212640, upload-time = "2025-12-20T21:19:30.817Z" }, - { url = "https://files.pythonhosted.org/packages/68/b6/05c35f6dea29122e54af0e9f8dfedd0a100c721affc8cc801ebe2bc2ed13/ty-0.0.5-py3-none-win_amd64.whl", hash = "sha256:2b8b754a0d7191e94acdf0c322747fec34371a4d0669f5b4e89549aef28814ae", size = 10034701, upload-time = "2025-12-20T21:19:28.311Z" }, - { url = "https://files.pythonhosted.org/packages/df/ca/4201ed5cb2af73912663d0c6ded927c28c28b3c921c9348aa8d2cfef4853/ty-0.0.5-py3-none-win_arm64.whl", hash = "sha256:83bea5a5296caac20d52b790ded2b830a7ff91c4ed9f36730fe1f393ceed6654", size = 9566474, upload-time = "2025-12-20T21:19:22.518Z" }, + { url = "https://files.pythonhosted.org/packages/1c/bc/b139710a3b6018f7fb2b9508b35c8af564e61bf2bf4fa619d088f3e16f85/types_requests-2.33.0.20260518-py3-none-any.whl", hash = "sha256:626d697d1adaaff76e2044dc8c5c051d8f21abc157bdfe204a75558076fe0bf0", size = 21391, upload-time = "2026-05-18T06:07:37.044Z" }, ] [[package]] -name = "types-python-dateutil" -version = "2.9.0.20251115" +name = "types-urllib3" +version = "1.26.25.14" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6a/36/06d01fb52c0d57e9ad0c237654990920fa41195e4b3d640830dabf9eeb2f/types_python_dateutil-2.9.0.20251115.tar.gz", hash = "sha256:8a47f2c3920f52a994056b8786309b43143faa5a64d4cbb2722d6addabdf1a58", size = 16363, upload-time = "2025-11-15T03:00:13.717Z" } +sdist = { url = "https://files.pythonhosted.org/packages/73/de/b9d7a68ad39092368fb21dd6194b362b98a1daeea5dcfef5e1adb5031c7e/types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f", size = 11239, upload-time = "2023-07-20T15:19:31.307Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/43/0b/56961d3ba517ed0df9b3a27bfda6514f3d01b28d499d1bce9068cfe4edd1/types_python_dateutil-2.9.0.20251115-py3-none-any.whl", hash = "sha256:9cf9c1c582019753b8639a081deefd7e044b9fa36bd8217f565c6c4e36ee0624", size = 18251, upload-time = "2025-11-15T03:00:12.317Z" }, + { url = "https://files.pythonhosted.org/packages/11/7b/3fc711b2efea5e85a7a0bbfe269ea944aa767bbba5ec52f9ee45d362ccf3/types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e", size = 15377, upload-time = "2023-07-20T15:19:30.379Z" }, ] [[package]] @@ -1270,171 +1178,166 @@ wheels = [ ] [[package]] -name = "virtualenv" -version = "20.36.1" +name = "wrapt" +version = "2.2.1" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "distlib" }, - { name = "filelock" }, - { name = "platformdirs" }, - { name = "typing-extensions", marker = "python_full_version < '3.11'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/aa/a3/4d310fa5f00863544e1d0f4de93bddec248499ccf97d4791bc3122c9d4f3/virtualenv-20.36.1.tar.gz", hash = "sha256:8befb5c81842c641f8ee658481e42641c68b5eab3521d8e092d18320902466ba", size = 6032239, upload-time = "2026-01-09T18:21:01.296Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/9f/06263fcd8ad6c405f05a3905fd7a84dd3176eb5ad46e44bccc0cd16348bb/wrapt-2.2.1.tar.gz", hash = "sha256:6744f504375775d7609c82c8d3d94af1c9a6f05586984536905908ba905277b9", size = 127620, upload-time = "2026-05-22T14:49:43.056Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6a/2a/dc2228b2888f51192c7dc766106cd475f1b768c10caaf9727659726f7391/virtualenv-20.36.1-py3-none-any.whl", hash = "sha256:575a8d6b124ef88f6f51d56d656132389f961062a9177016a50e4f507bbcc19f", size = 6008258, upload-time = "2026-01-09T18:20:59.425Z" }, -] - -[[package]] -name = "wrapt" -version = "2.0.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/49/2a/6de8a50cb435b7f42c46126cf1a54b2aab81784e74c8595c8e025e8f36d3/wrapt-2.0.1.tar.gz", hash = "sha256:9c9c635e78497cacb81e84f8b11b23e0aacac7a136e73b8e5b2109a1d9fc468f", size = 82040, upload-time = "2025-11-07T00:45:33.312Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/61/0d/12d8c803ed2ce4e5e7d5b9f5f602721f9dfef82c95959f3ce97fa584bb5c/wrapt-2.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:64b103acdaa53b7caf409e8d45d39a8442fe6dcfec6ba3f3d141e0cc2b5b4dbd", size = 77481, upload-time = "2025-11-07T00:43:11.103Z" }, - { url = "https://files.pythonhosted.org/packages/05/3e/4364ebe221ebf2a44d9fc8695a19324692f7dd2795e64bd59090856ebf12/wrapt-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:91bcc576260a274b169c3098e9a3519fb01f2989f6d3d386ef9cbf8653de1374", size = 60692, upload-time = "2025-11-07T00:43:13.697Z" }, - { url = "https://files.pythonhosted.org/packages/1f/ff/ae2a210022b521f86a8ddcdd6058d137c051003812b0388a5e9a03d3fe10/wrapt-2.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ab594f346517010050126fcd822697b25a7031d815bb4fbc238ccbe568216489", size = 61574, upload-time = "2025-11-07T00:43:14.967Z" }, - { url = "https://files.pythonhosted.org/packages/c6/93/5cf92edd99617095592af919cb81d4bff61c5dbbb70d3c92099425a8ec34/wrapt-2.0.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:36982b26f190f4d737f04a492a68accbfc6fa042c3f42326fdfbb6c5b7a20a31", size = 113688, upload-time = "2025-11-07T00:43:18.275Z" }, - { url = "https://files.pythonhosted.org/packages/a0/0a/e38fc0cee1f146c9fb266d8ef96ca39fb14a9eef165383004019aa53f88a/wrapt-2.0.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:23097ed8bc4c93b7bf36fa2113c6c733c976316ce0ee2c816f64ca06102034ef", size = 115698, upload-time = "2025-11-07T00:43:19.407Z" }, - { url = "https://files.pythonhosted.org/packages/b0/85/bef44ea018b3925fb0bcbe9112715f665e4d5309bd945191da814c314fd1/wrapt-2.0.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8bacfe6e001749a3b64db47bcf0341da757c95959f592823a93931a422395013", size = 112096, upload-time = "2025-11-07T00:43:16.5Z" }, - { url = "https://files.pythonhosted.org/packages/7c/0b/733a2376e413117e497aa1a5b1b78e8f3a28c0e9537d26569f67d724c7c5/wrapt-2.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:8ec3303e8a81932171f455f792f8df500fc1a09f20069e5c16bd7049ab4e8e38", size = 114878, upload-time = "2025-11-07T00:43:20.81Z" }, - { url = "https://files.pythonhosted.org/packages/da/03/d81dcb21bbf678fcda656495792b059f9d56677d119ca022169a12542bd0/wrapt-2.0.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:3f373a4ab5dbc528a94334f9fe444395b23c2f5332adab9ff4ea82f5a9e33bc1", size = 111298, upload-time = "2025-11-07T00:43:22.229Z" }, - { url = "https://files.pythonhosted.org/packages/c9/d5/5e623040e8056e1108b787020d56b9be93dbbf083bf2324d42cde80f3a19/wrapt-2.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f49027b0b9503bf6c8cdc297ca55006b80c2f5dd36cecc72c6835ab6e10e8a25", size = 113361, upload-time = "2025-11-07T00:43:24.301Z" }, - { url = "https://files.pythonhosted.org/packages/a1/f3/de535ccecede6960e28c7b722e5744846258111d6c9f071aa7578ea37ad3/wrapt-2.0.1-cp310-cp310-win32.whl", hash = "sha256:8330b42d769965e96e01fa14034b28a2a7600fbf7e8f0cc90ebb36d492c993e4", size = 58035, upload-time = "2025-11-07T00:43:28.96Z" }, - { url = "https://files.pythonhosted.org/packages/21/15/39d3ca5428a70032c2ec8b1f1c9d24c32e497e7ed81aed887a4998905fcc/wrapt-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:1218573502a8235bb8a7ecaed12736213b22dcde9feab115fa2989d42b5ded45", size = 60383, upload-time = "2025-11-07T00:43:25.804Z" }, - { url = "https://files.pythonhosted.org/packages/43/c2/dfd23754b7f7a4dce07e08f4309c4e10a40046a83e9ae1800f2e6b18d7c1/wrapt-2.0.1-cp310-cp310-win_arm64.whl", hash = "sha256:eda8e4ecd662d48c28bb86be9e837c13e45c58b8300e43ba3c9b4fa9900302f7", size = 58894, upload-time = "2025-11-07T00:43:27.074Z" }, - { url = "https://files.pythonhosted.org/packages/98/60/553997acf3939079dab022e37b67b1904b5b0cc235503226898ba573b10c/wrapt-2.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0e17283f533a0d24d6e5429a7d11f250a58d28b4ae5186f8f47853e3e70d2590", size = 77480, upload-time = "2025-11-07T00:43:30.573Z" }, - { url = "https://files.pythonhosted.org/packages/2d/50/e5b3d30895d77c52105c6d5cbf94d5b38e2a3dd4a53d22d246670da98f7c/wrapt-2.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:85df8d92158cb8f3965aecc27cf821461bb5f40b450b03facc5d9f0d4d6ddec6", size = 60690, upload-time = "2025-11-07T00:43:31.594Z" }, - { url = "https://files.pythonhosted.org/packages/f0/40/660b2898703e5cbbb43db10cdefcc294274458c3ca4c68637c2b99371507/wrapt-2.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1be685ac7700c966b8610ccc63c3187a72e33cab53526a27b2a285a662cd4f7", size = 61578, upload-time = "2025-11-07T00:43:32.918Z" }, - { url = "https://files.pythonhosted.org/packages/5b/36/825b44c8a10556957bc0c1d84c7b29a40e05fcf1873b6c40aa9dbe0bd972/wrapt-2.0.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:df0b6d3b95932809c5b3fecc18fda0f1e07452d05e2662a0b35548985f256e28", size = 114115, upload-time = "2025-11-07T00:43:35.605Z" }, - { url = "https://files.pythonhosted.org/packages/83/73/0a5d14bb1599677304d3c613a55457d34c344e9b60eda8a737c2ead7619e/wrapt-2.0.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4da7384b0e5d4cae05c97cd6f94faaf78cc8b0f791fc63af43436d98c4ab37bb", size = 116157, upload-time = "2025-11-07T00:43:37.058Z" }, - { url = "https://files.pythonhosted.org/packages/01/22/1c158fe763dbf0a119f985d945711d288994fe5514c0646ebe0eb18b016d/wrapt-2.0.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ec65a78fbd9d6f083a15d7613b2800d5663dbb6bb96003899c834beaa68b242c", size = 112535, upload-time = "2025-11-07T00:43:34.138Z" }, - { url = "https://files.pythonhosted.org/packages/5c/28/4f16861af67d6de4eae9927799b559c20ebdd4fe432e89ea7fe6fcd9d709/wrapt-2.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7de3cc939be0e1174969f943f3b44e0d79b6f9a82198133a5b7fc6cc92882f16", size = 115404, upload-time = "2025-11-07T00:43:39.214Z" }, - { url = "https://files.pythonhosted.org/packages/a0/8b/7960122e625fad908f189b59c4aae2d50916eb4098b0fb2819c5a177414f/wrapt-2.0.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:fb1a5b72cbd751813adc02ef01ada0b0d05d3dcbc32976ce189a1279d80ad4a2", size = 111802, upload-time = "2025-11-07T00:43:40.476Z" }, - { url = "https://files.pythonhosted.org/packages/3e/73/7881eee5ac31132a713ab19a22c9e5f1f7365c8b1df50abba5d45b781312/wrapt-2.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3fa272ca34332581e00bf7773e993d4f632594eb2d1b0b162a9038df0fd971dd", size = 113837, upload-time = "2025-11-07T00:43:42.921Z" }, - { url = "https://files.pythonhosted.org/packages/45/00/9499a3d14e636d1f7089339f96c4409bbc7544d0889f12264efa25502ae8/wrapt-2.0.1-cp311-cp311-win32.whl", hash = "sha256:fc007fdf480c77301ab1afdbb6ab22a5deee8885f3b1ed7afcb7e5e84a0e27be", size = 58028, upload-time = "2025-11-07T00:43:47.369Z" }, - { url = "https://files.pythonhosted.org/packages/70/5d/8f3d7eea52f22638748f74b102e38fdf88cb57d08ddeb7827c476a20b01b/wrapt-2.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:47434236c396d04875180171ee1f3815ca1eada05e24a1ee99546320d54d1d1b", size = 60385, upload-time = "2025-11-07T00:43:44.34Z" }, - { url = "https://files.pythonhosted.org/packages/14/e2/32195e57a8209003587bbbad44d5922f13e0ced2a493bb46ca882c5b123d/wrapt-2.0.1-cp311-cp311-win_arm64.whl", hash = "sha256:837e31620e06b16030b1d126ed78e9383815cbac914693f54926d816d35d8edf", size = 58893, upload-time = "2025-11-07T00:43:46.161Z" }, - { url = "https://files.pythonhosted.org/packages/cb/73/8cb252858dc8254baa0ce58ce382858e3a1cf616acebc497cb13374c95c6/wrapt-2.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1fdbb34da15450f2b1d735a0e969c24bdb8d8924892380126e2a293d9902078c", size = 78129, upload-time = "2025-11-07T00:43:48.852Z" }, - { url = "https://files.pythonhosted.org/packages/19/42/44a0db2108526ee6e17a5ab72478061158f34b08b793df251d9fbb9a7eb4/wrapt-2.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3d32794fe940b7000f0519904e247f902f0149edbe6316c710a8562fb6738841", size = 61205, upload-time = "2025-11-07T00:43:50.402Z" }, - { url = "https://files.pythonhosted.org/packages/4d/8a/5b4b1e44b791c22046e90d9b175f9a7581a8cc7a0debbb930f81e6ae8e25/wrapt-2.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:386fb54d9cd903ee0012c09291336469eb7b244f7183d40dc3e86a16a4bace62", size = 61692, upload-time = "2025-11-07T00:43:51.678Z" }, - { url = "https://files.pythonhosted.org/packages/11/53/3e794346c39f462bcf1f58ac0487ff9bdad02f9b6d5ee2dc84c72e0243b2/wrapt-2.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7b219cb2182f230676308cdcacd428fa837987b89e4b7c5c9025088b8a6c9faf", size = 121492, upload-time = "2025-11-07T00:43:55.017Z" }, - { url = "https://files.pythonhosted.org/packages/c6/7e/10b7b0e8841e684c8ca76b462a9091c45d62e8f2de9c4b1390b690eadf16/wrapt-2.0.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:641e94e789b5f6b4822bb8d8ebbdfc10f4e4eae7756d648b717d980f657a9eb9", size = 123064, upload-time = "2025-11-07T00:43:56.323Z" }, - { url = "https://files.pythonhosted.org/packages/0e/d1/3c1e4321fc2f5ee7fd866b2d822aa89b84495f28676fd976c47327c5b6aa/wrapt-2.0.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fe21b118b9f58859b5ebaa4b130dee18669df4bd111daad082b7beb8799ad16b", size = 117403, upload-time = "2025-11-07T00:43:53.258Z" }, - { url = "https://files.pythonhosted.org/packages/a4/b0/d2f0a413cf201c8c2466de08414a15420a25aa83f53e647b7255cc2fab5d/wrapt-2.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:17fb85fa4abc26a5184d93b3efd2dcc14deb4b09edcdb3535a536ad34f0b4dba", size = 121500, upload-time = "2025-11-07T00:43:57.468Z" }, - { url = "https://files.pythonhosted.org/packages/bd/45/bddb11d28ca39970a41ed48a26d210505120f925918592283369219f83cc/wrapt-2.0.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:b89ef9223d665ab255ae42cc282d27d69704d94be0deffc8b9d919179a609684", size = 116299, upload-time = "2025-11-07T00:43:58.877Z" }, - { url = "https://files.pythonhosted.org/packages/81/af/34ba6dd570ef7a534e7eec0c25e2615c355602c52aba59413411c025a0cb/wrapt-2.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a453257f19c31b31ba593c30d997d6e5be39e3b5ad9148c2af5a7314061c63eb", size = 120622, upload-time = "2025-11-07T00:43:59.962Z" }, - { url = "https://files.pythonhosted.org/packages/e2/3e/693a13b4146646fb03254636f8bafd20c621955d27d65b15de07ab886187/wrapt-2.0.1-cp312-cp312-win32.whl", hash = "sha256:3e271346f01e9c8b1130a6a3b0e11908049fe5be2d365a5f402778049147e7e9", size = 58246, upload-time = "2025-11-07T00:44:03.169Z" }, - { url = "https://files.pythonhosted.org/packages/a7/36/715ec5076f925a6be95f37917b66ebbeaa1372d1862c2ccd7a751574b068/wrapt-2.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:2da620b31a90cdefa9cd0c2b661882329e2e19d1d7b9b920189956b76c564d75", size = 60492, upload-time = "2025-11-07T00:44:01.027Z" }, - { url = "https://files.pythonhosted.org/packages/ef/3e/62451cd7d80f65cc125f2b426b25fbb6c514bf6f7011a0c3904fc8c8df90/wrapt-2.0.1-cp312-cp312-win_arm64.whl", hash = "sha256:aea9c7224c302bc8bfc892b908537f56c430802560e827b75ecbde81b604598b", size = 58987, upload-time = "2025-11-07T00:44:02.095Z" }, - { url = "https://files.pythonhosted.org/packages/ad/fe/41af4c46b5e498c90fc87981ab2972fbd9f0bccda597adb99d3d3441b94b/wrapt-2.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:47b0f8bafe90f7736151f61482c583c86b0693d80f075a58701dd1549b0010a9", size = 78132, upload-time = "2025-11-07T00:44:04.628Z" }, - { url = "https://files.pythonhosted.org/packages/1c/92/d68895a984a5ebbbfb175512b0c0aad872354a4a2484fbd5552e9f275316/wrapt-2.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:cbeb0971e13b4bd81d34169ed57a6dda017328d1a22b62fda45e1d21dd06148f", size = 61211, upload-time = "2025-11-07T00:44:05.626Z" }, - { url = "https://files.pythonhosted.org/packages/e8/26/ba83dc5ae7cf5aa2b02364a3d9cf74374b86169906a1f3ade9a2d03cf21c/wrapt-2.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:eb7cffe572ad0a141a7886a1d2efa5bef0bf7fe021deeea76b3ab334d2c38218", size = 61689, upload-time = "2025-11-07T00:44:06.719Z" }, - { url = "https://files.pythonhosted.org/packages/cf/67/d7a7c276d874e5d26738c22444d466a3a64ed541f6ef35f740dbd865bab4/wrapt-2.0.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c8d60527d1ecfc131426b10d93ab5d53e08a09c5fa0175f6b21b3252080c70a9", size = 121502, upload-time = "2025-11-07T00:44:09.557Z" }, - { url = "https://files.pythonhosted.org/packages/0f/6b/806dbf6dd9579556aab22fc92908a876636e250f063f71548a8660382184/wrapt-2.0.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c654eafb01afac55246053d67a4b9a984a3567c3808bb7df2f8de1c1caba2e1c", size = 123110, upload-time = "2025-11-07T00:44:10.64Z" }, - { url = "https://files.pythonhosted.org/packages/e5/08/cdbb965fbe4c02c5233d185d070cabed2ecc1f1e47662854f95d77613f57/wrapt-2.0.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:98d873ed6c8b4ee2418f7afce666751854d6d03e3c0ec2a399bb039cd2ae89db", size = 117434, upload-time = "2025-11-07T00:44:08.138Z" }, - { url = "https://files.pythonhosted.org/packages/2d/d1/6aae2ce39db4cb5216302fa2e9577ad74424dfbe315bd6669725569e048c/wrapt-2.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:c9e850f5b7fc67af856ff054c71690d54fa940c3ef74209ad9f935b4f66a0233", size = 121533, upload-time = "2025-11-07T00:44:12.142Z" }, - { url = "https://files.pythonhosted.org/packages/79/35/565abf57559fbe0a9155c29879ff43ce8bd28d2ca61033a3a3dd67b70794/wrapt-2.0.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e505629359cb5f751e16e30cf3f91a1d3ddb4552480c205947da415d597f7ac2", size = 116324, upload-time = "2025-11-07T00:44:13.28Z" }, - { url = "https://files.pythonhosted.org/packages/e1/e0/53ff5e76587822ee33e560ad55876d858e384158272cd9947abdd4ad42ca/wrapt-2.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2879af909312d0baf35f08edeea918ee3af7ab57c37fe47cb6a373c9f2749c7b", size = 120627, upload-time = "2025-11-07T00:44:14.431Z" }, - { url = "https://files.pythonhosted.org/packages/7c/7b/38df30fd629fbd7612c407643c63e80e1c60bcc982e30ceeae163a9800e7/wrapt-2.0.1-cp313-cp313-win32.whl", hash = "sha256:d67956c676be5a24102c7407a71f4126d30de2a569a1c7871c9f3cabc94225d7", size = 58252, upload-time = "2025-11-07T00:44:17.814Z" }, - { url = "https://files.pythonhosted.org/packages/85/64/d3954e836ea67c4d3ad5285e5c8fd9d362fd0a189a2db622df457b0f4f6a/wrapt-2.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:9ca66b38dd642bf90c59b6738af8070747b610115a39af2498535f62b5cdc1c3", size = 60500, upload-time = "2025-11-07T00:44:15.561Z" }, - { url = "https://files.pythonhosted.org/packages/89/4e/3c8b99ac93527cfab7f116089db120fef16aac96e5f6cdb724ddf286086d/wrapt-2.0.1-cp313-cp313-win_arm64.whl", hash = "sha256:5a4939eae35db6b6cec8e7aa0e833dcca0acad8231672c26c2a9ab7a0f8ac9c8", size = 58993, upload-time = "2025-11-07T00:44:16.65Z" }, - { url = "https://files.pythonhosted.org/packages/f9/f4/eff2b7d711cae20d220780b9300faa05558660afb93f2ff5db61fe725b9a/wrapt-2.0.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a52f93d95c8d38fed0669da2ebdb0b0376e895d84596a976c15a9eb45e3eccb3", size = 82028, upload-time = "2025-11-07T00:44:18.944Z" }, - { url = "https://files.pythonhosted.org/packages/0c/67/cb945563f66fd0f61a999339460d950f4735c69f18f0a87ca586319b1778/wrapt-2.0.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:4e54bbf554ee29fcceee24fa41c4d091398b911da6e7f5d7bffda963c9aed2e1", size = 62949, upload-time = "2025-11-07T00:44:20.074Z" }, - { url = "https://files.pythonhosted.org/packages/ec/ca/f63e177f0bbe1e5cf5e8d9b74a286537cd709724384ff20860f8f6065904/wrapt-2.0.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:908f8c6c71557f4deaa280f55d0728c3bca0960e8c3dd5ceeeafb3c19942719d", size = 63681, upload-time = "2025-11-07T00:44:21.345Z" }, - { url = "https://files.pythonhosted.org/packages/39/a1/1b88fcd21fd835dca48b556daef750952e917a2794fa20c025489e2e1f0f/wrapt-2.0.1-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:e2f84e9af2060e3904a32cea9bb6db23ce3f91cfd90c6b426757cf7cc01c45c7", size = 152696, upload-time = "2025-11-07T00:44:24.318Z" }, - { url = "https://files.pythonhosted.org/packages/62/1c/d9185500c1960d9f5f77b9c0b890b7fc62282b53af7ad1b6bd779157f714/wrapt-2.0.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e3612dc06b436968dfb9142c62e5dfa9eb5924f91120b3c8ff501ad878f90eb3", size = 158859, upload-time = "2025-11-07T00:44:25.494Z" }, - { url = "https://files.pythonhosted.org/packages/91/60/5d796ed0f481ec003220c7878a1d6894652efe089853a208ea0838c13086/wrapt-2.0.1-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6d2d947d266d99a1477cd005b23cbd09465276e302515e122df56bb9511aca1b", size = 146068, upload-time = "2025-11-07T00:44:22.81Z" }, - { url = "https://files.pythonhosted.org/packages/04/f8/75282dd72f102ddbfba137e1e15ecba47b40acff32c08ae97edbf53f469e/wrapt-2.0.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:7d539241e87b650cbc4c3ac9f32c8d1ac8a54e510f6dca3f6ab60dcfd48c9b10", size = 155724, upload-time = "2025-11-07T00:44:26.634Z" }, - { url = "https://files.pythonhosted.org/packages/5a/27/fe39c51d1b344caebb4a6a9372157bdb8d25b194b3561b52c8ffc40ac7d1/wrapt-2.0.1-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:4811e15d88ee62dbf5c77f2c3ff3932b1e3ac92323ba3912f51fc4016ce81ecf", size = 144413, upload-time = "2025-11-07T00:44:27.939Z" }, - { url = "https://files.pythonhosted.org/packages/83/2b/9f6b643fe39d4505c7bf926d7c2595b7cb4b607c8c6b500e56c6b36ac238/wrapt-2.0.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c1c91405fcf1d501fa5d55df21e58ea49e6b879ae829f1039faaf7e5e509b41e", size = 150325, upload-time = "2025-11-07T00:44:29.29Z" }, - { url = "https://files.pythonhosted.org/packages/bb/b6/20ffcf2558596a7f58a2e69c89597128781f0b88e124bf5a4cadc05b8139/wrapt-2.0.1-cp313-cp313t-win32.whl", hash = "sha256:e76e3f91f864e89db8b8d2a8311d57df93f01ad6bb1e9b9976d1f2e83e18315c", size = 59943, upload-time = "2025-11-07T00:44:33.211Z" }, - { url = "https://files.pythonhosted.org/packages/87/6a/0e56111cbb3320151eed5d3821ee1373be13e05b376ea0870711f18810c3/wrapt-2.0.1-cp313-cp313t-win_amd64.whl", hash = "sha256:83ce30937f0ba0d28818807b303a412440c4b63e39d3d8fc036a94764b728c92", size = 63240, upload-time = "2025-11-07T00:44:30.935Z" }, - { url = "https://files.pythonhosted.org/packages/1d/54/5ab4c53ea1f7f7e5c3e7c1095db92932cc32fd62359d285486d00c2884c3/wrapt-2.0.1-cp313-cp313t-win_arm64.whl", hash = "sha256:4b55cacc57e1dc2d0991dbe74c6419ffd415fb66474a02335cb10efd1aa3f84f", size = 60416, upload-time = "2025-11-07T00:44:32.002Z" }, - { url = "https://files.pythonhosted.org/packages/73/81/d08d83c102709258e7730d3cd25befd114c60e43ef3891d7e6877971c514/wrapt-2.0.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:5e53b428f65ece6d9dad23cb87e64506392b720a0b45076c05354d27a13351a1", size = 78290, upload-time = "2025-11-07T00:44:34.691Z" }, - { url = "https://files.pythonhosted.org/packages/f6/14/393afba2abb65677f313aa680ff0981e829626fed39b6a7e3ec807487790/wrapt-2.0.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:ad3ee9d0f254851c71780966eb417ef8e72117155cff04821ab9b60549694a55", size = 61255, upload-time = "2025-11-07T00:44:35.762Z" }, - { url = "https://files.pythonhosted.org/packages/c4/10/a4a1f2fba205a9462e36e708ba37e5ac95f4987a0f1f8fd23f0bf1fc3b0f/wrapt-2.0.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:d7b822c61ed04ee6ad64bc90d13368ad6eb094db54883b5dde2182f67a7f22c0", size = 61797, upload-time = "2025-11-07T00:44:37.22Z" }, - { url = "https://files.pythonhosted.org/packages/12/db/99ba5c37cf1c4fad35349174f1e38bd8d992340afc1ff27f526729b98986/wrapt-2.0.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7164a55f5e83a9a0b031d3ffab4d4e36bbec42e7025db560f225489fa929e509", size = 120470, upload-time = "2025-11-07T00:44:39.425Z" }, - { url = "https://files.pythonhosted.org/packages/30/3f/a1c8d2411eb826d695fc3395a431757331582907a0ec59afce8fe8712473/wrapt-2.0.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e60690ba71a57424c8d9ff28f8d006b7ad7772c22a4af432188572cd7fa004a1", size = 122851, upload-time = "2025-11-07T00:44:40.582Z" }, - { url = "https://files.pythonhosted.org/packages/b3/8d/72c74a63f201768d6a04a8845c7976f86be6f5ff4d74996c272cefc8dafc/wrapt-2.0.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:3cd1a4bd9a7a619922a8557e1318232e7269b5fb69d4ba97b04d20450a6bf970", size = 117433, upload-time = "2025-11-07T00:44:38.313Z" }, - { url = "https://files.pythonhosted.org/packages/c7/5a/df37cf4042cb13b08256f8e27023e2f9b3d471d553376616591bb99bcb31/wrapt-2.0.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b4c2e3d777e38e913b8ce3a6257af72fb608f86a1df471cb1d4339755d0a807c", size = 121280, upload-time = "2025-11-07T00:44:41.69Z" }, - { url = "https://files.pythonhosted.org/packages/54/34/40d6bc89349f9931e1186ceb3e5fbd61d307fef814f09fbbac98ada6a0c8/wrapt-2.0.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3d366aa598d69416b5afedf1faa539fac40c1d80a42f6b236c88c73a3c8f2d41", size = 116343, upload-time = "2025-11-07T00:44:43.013Z" }, - { url = "https://files.pythonhosted.org/packages/70/66/81c3461adece09d20781dee17c2366fdf0cb8754738b521d221ca056d596/wrapt-2.0.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:c235095d6d090aa903f1db61f892fffb779c1eaeb2a50e566b52001f7a0f66ed", size = 119650, upload-time = "2025-11-07T00:44:44.523Z" }, - { url = "https://files.pythonhosted.org/packages/46/3a/d0146db8be8761a9e388cc9cc1c312b36d583950ec91696f19bbbb44af5a/wrapt-2.0.1-cp314-cp314-win32.whl", hash = "sha256:bfb5539005259f8127ea9c885bdc231978c06b7a980e63a8a61c8c4c979719d0", size = 58701, upload-time = "2025-11-07T00:44:48.277Z" }, - { url = "https://files.pythonhosted.org/packages/1a/38/5359da9af7d64554be63e9046164bd4d8ff289a2dd365677d25ba3342c08/wrapt-2.0.1-cp314-cp314-win_amd64.whl", hash = "sha256:4ae879acc449caa9ed43fc36ba08392b9412ee67941748d31d94e3cedb36628c", size = 60947, upload-time = "2025-11-07T00:44:46.086Z" }, - { url = "https://files.pythonhosted.org/packages/aa/3f/96db0619276a833842bf36343685fa04f987dd6e3037f314531a1e00492b/wrapt-2.0.1-cp314-cp314-win_arm64.whl", hash = "sha256:8639b843c9efd84675f1e100ed9e99538ebea7297b62c4b45a7042edb84db03e", size = 59359, upload-time = "2025-11-07T00:44:47.164Z" }, - { url = "https://files.pythonhosted.org/packages/71/49/5f5d1e867bf2064bf3933bc6cf36ade23505f3902390e175e392173d36a2/wrapt-2.0.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:9219a1d946a9b32bb23ccae66bdb61e35c62773ce7ca6509ceea70f344656b7b", size = 82031, upload-time = "2025-11-07T00:44:49.4Z" }, - { url = "https://files.pythonhosted.org/packages/2b/89/0009a218d88db66ceb83921e5685e820e2c61b59bbbb1324ba65342668bc/wrapt-2.0.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:fa4184e74197af3adad3c889a1af95b53bb0466bced92ea99a0c014e48323eec", size = 62952, upload-time = "2025-11-07T00:44:50.74Z" }, - { url = "https://files.pythonhosted.org/packages/ae/18/9b968e920dd05d6e44bcc918a046d02afea0fb31b2f1c80ee4020f377cbe/wrapt-2.0.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c5ef2f2b8a53b7caee2f797ef166a390fef73979b15778a4a153e4b5fedce8fa", size = 63688, upload-time = "2025-11-07T00:44:52.248Z" }, - { url = "https://files.pythonhosted.org/packages/a6/7d/78bdcb75826725885d9ea26c49a03071b10c4c92da93edda612910f150e4/wrapt-2.0.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:e042d653a4745be832d5aa190ff80ee4f02c34b21f4b785745eceacd0907b815", size = 152706, upload-time = "2025-11-07T00:44:54.613Z" }, - { url = "https://files.pythonhosted.org/packages/dd/77/cac1d46f47d32084a703df0d2d29d47e7eb2a7d19fa5cbca0e529ef57659/wrapt-2.0.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2afa23318136709c4b23d87d543b425c399887b4057936cd20386d5b1422b6fa", size = 158866, upload-time = "2025-11-07T00:44:55.79Z" }, - { url = "https://files.pythonhosted.org/packages/8a/11/b521406daa2421508903bf8d5e8b929216ec2af04839db31c0a2c525eee0/wrapt-2.0.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6c72328f668cf4c503ffcf9434c2b71fdd624345ced7941bc6693e61bbe36bef", size = 146148, upload-time = "2025-11-07T00:44:53.388Z" }, - { url = "https://files.pythonhosted.org/packages/0c/c0/340b272bed297baa7c9ce0c98ef7017d9c035a17a6a71dce3184b8382da2/wrapt-2.0.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3793ac154afb0e5b45d1233cb94d354ef7a983708cc3bb12563853b1d8d53747", size = 155737, upload-time = "2025-11-07T00:44:56.971Z" }, - { url = "https://files.pythonhosted.org/packages/f3/93/bfcb1fb2bdf186e9c2883a4d1ab45ab099c79cbf8f4e70ea453811fa3ea7/wrapt-2.0.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:fec0d993ecba3991645b4857837277469c8cc4c554a7e24d064d1ca291cfb81f", size = 144451, upload-time = "2025-11-07T00:44:58.515Z" }, - { url = "https://files.pythonhosted.org/packages/d2/6b/dca504fb18d971139d232652656180e3bd57120e1193d9a5899c3c0b7cdd/wrapt-2.0.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:949520bccc1fa227274da7d03bf238be15389cd94e32e4297b92337df9b7a349", size = 150353, upload-time = "2025-11-07T00:44:59.753Z" }, - { url = "https://files.pythonhosted.org/packages/1d/f6/a1de4bd3653afdf91d250ca5c721ee51195df2b61a4603d4b373aa804d1d/wrapt-2.0.1-cp314-cp314t-win32.whl", hash = "sha256:be9e84e91d6497ba62594158d3d31ec0486c60055c49179edc51ee43d095f79c", size = 60609, upload-time = "2025-11-07T00:45:03.315Z" }, - { url = "https://files.pythonhosted.org/packages/01/3a/07cd60a9d26fe73efead61c7830af975dfdba8537632d410462672e4432b/wrapt-2.0.1-cp314-cp314t-win_amd64.whl", hash = "sha256:61c4956171c7434634401db448371277d07032a81cc21c599c22953374781395", size = 64038, upload-time = "2025-11-07T00:45:00.948Z" }, - { url = "https://files.pythonhosted.org/packages/41/99/8a06b8e17dddbf321325ae4eb12465804120f699cd1b8a355718300c62da/wrapt-2.0.1-cp314-cp314t-win_arm64.whl", hash = "sha256:35cdbd478607036fee40273be8ed54a451f5f23121bd9d4be515158f9498f7ad", size = 60634, upload-time = "2025-11-07T00:45:02.087Z" }, - { url = "https://files.pythonhosted.org/packages/15/d1/b51471c11592ff9c012bd3e2f7334a6ff2f42a7aed2caffcf0bdddc9cb89/wrapt-2.0.1-py3-none-any.whl", hash = "sha256:4d2ce1bf1a48c5277d7969259232b57645aae5686dba1eaeade39442277afbca", size = 44046, upload-time = "2025-11-07T00:45:32.116Z" }, + { url = "https://files.pythonhosted.org/packages/88/d1/a1b08f8f4fac8cbb156fa51cf64ee2c7f7f74f9875ba3cf70b3c58368694/wrapt-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d2beb1c7cab10603aecdc42f8edd6ff013f9a32e4543474e38e6b77ce9975aeb", size = 80831, upload-time = "2026-05-22T14:48:15.598Z" }, + { url = "https://files.pythonhosted.org/packages/54/ce/57890814991446a845e09b3445ce8b694f27eb0577004f2c2a36a9772ed4/wrapt-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e0cb7e4dd71f4c32e5e84843cd3c4cd65dda034314004bbe1d7f99af2426ab80", size = 81375, upload-time = "2026-05-22T14:48:17.071Z" }, + { url = "https://files.pythonhosted.org/packages/38/65/08d7a6c76ac4493bdb668205ee9c1de1bd5daca61717c3e9aa49b4c01499/wrapt-2.2.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95821352042722cd9f1108874579a47989d0a7e12a37d87d2fc4af20fd99ab8a", size = 167417, upload-time = "2026-05-22T14:48:18.303Z" }, + { url = "https://files.pythonhosted.org/packages/62/ce/f1ccbee7a1bfe5cdc6b3da6bab4b45713d628b9294da32a39f563d648140/wrapt-2.2.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:abd621552ede77c4c69be7fac44ba911225b0c812b6ba604e5964cf98085b474", size = 166948, upload-time = "2026-05-22T14:48:19.768Z" }, + { url = "https://files.pythonhosted.org/packages/86/2a/f85d48d1cd4869aee6704028d257d740a47c1c467b457ce396b4b5b55d07/wrapt-2.2.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e3677c7146ce694874941ba82b57092cc4875445aadf29d72807351023105143", size = 158148, upload-time = "2026-05-22T14:48:21.96Z" }, + { url = "https://files.pythonhosted.org/packages/fe/5c/93939ad11d4a12358ab1aab219a2ef5efa5612e0db6b9fc65af8af1a891b/wrapt-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:9a5934eaea872e17936b5f45501eba5ab0bce9a74122e172b663d7c28c459c4a", size = 165905, upload-time = "2026-05-22T14:48:23.373Z" }, + { url = "https://files.pythonhosted.org/packages/e0/22/b8c2aa89862ff58605934d7abf4b70e6a5a1c33df96656f49035ccdf1c8a/wrapt-2.2.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:f5b9daf6b629fce418e0cc3dd0436eac045188fa35deadb7a7f3941d5b8203f9", size = 156712, upload-time = "2026-05-22T14:48:24.767Z" }, + { url = "https://files.pythonhosted.org/packages/5d/78/bf00a7b02239c12bb02ddcc3c0b971bfcc36e578c5a44f1ccfef5b458545/wrapt-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:f53ac9f3ef573326d009ed809beff4efcac6451931c2b8132586da4b9e53ff31", size = 166560, upload-time = "2026-05-22T14:48:26.83Z" }, + { url = "https://files.pythonhosted.org/packages/fe/93/6390ca9c5b787683cef588d04f57c8d41b9a2323b5597a65f18638c90ef2/wrapt-2.2.1-cp313-cp313-win32.whl", hash = "sha256:1ffa9cfd4bdb581539951b14ae661ff20ed0c3599b3e911a131ee0ec5ac11337", size = 77817, upload-time = "2026-05-22T14:48:28.221Z" }, + { url = "https://files.pythonhosted.org/packages/97/73/ce10f0e71c0cfaa1a65faadb8efd4852028b3bb9ba28932b8889df769d38/wrapt-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:368eac1e20fd0bb03dd3cc42bf9887154c3861b60989389ccb5fac032617d215", size = 80736, upload-time = "2026-05-22T14:48:30.139Z" }, + { url = "https://files.pythonhosted.org/packages/c7/4c/89f4a6818fafbbd840330e4fa3873073e1bfc166133a64cac7f8fde7a5e3/wrapt-2.2.1-cp313-cp313-win_arm64.whl", hash = "sha256:c754dafdf5aaf0b401b644a90a30046929a0dd1a536e0ff0ec959a59155d9c7f", size = 79099, upload-time = "2026-05-22T14:48:31.405Z" }, + { url = "https://files.pythonhosted.org/packages/bf/f2/9a8741c46f8c208ac0a45b25ba170bcb4fb72a2781d5fb97dbd7b6be73cb/wrapt-2.2.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ed928d0fda15fc0adc8d13305c8b3c0f2fba5b0669950c9e6d019d9162a3b3e8", size = 82802, upload-time = "2026-05-22T14:48:33.307Z" }, + { url = "https://files.pythonhosted.org/packages/9c/0d/e9c855716a3705eef1416456bdf062b60620726fdc59428ff670fc3c60dc/wrapt-2.2.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:fafb4e739e43544d12cb4abd1605fd4683b6ca6a9ad682b7fd8f4d21973eafa8", size = 83329, upload-time = "2026-05-22T14:48:34.593Z" }, + { url = "https://files.pythonhosted.org/packages/3b/d6/a88f1c13112b7831adac75cea65d8310e0d696d570c8961844c90a57b865/wrapt-2.2.1-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:74d6a0c31472fe5d814917266b9f46495d7c61ed890af08b468acea92fb89a8d", size = 202937, upload-time = "2026-05-22T14:48:35.859Z" }, + { url = "https://files.pythonhosted.org/packages/42/65/e29d54aef06a4d898a5b8a25589a0b3769bde454f922fad8f6f89fbfb650/wrapt-2.2.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ab5be648d5a0b86b7438864f8df3c705a65cef35a2fd3e5561e3e203167e0f27", size = 209997, upload-time = "2026-05-22T14:48:38.153Z" }, + { url = "https://files.pythonhosted.org/packages/2a/91/e4454263516cf0e12640912fbca9a83654e424f0a6ddb79f5cd7ce14bf33/wrapt-2.2.1-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9d8f204c8e3a8bf9ece17e0a83d137fd807440977f8a5e762d59306795011440", size = 194856, upload-time = "2026-05-22T14:48:39.69Z" }, + { url = "https://files.pythonhosted.org/packages/de/d0/fe0ee202286afdf4a7f77dd29f195703145764d572aec209c5086e57d924/wrapt-2.2.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:d047f6498c973874ba08ac3f97c69a2c4b2211c8de6f4c205f75cb1c9522596e", size = 205654, upload-time = "2026-05-22T14:48:43.456Z" }, + { url = "https://files.pythonhosted.org/packages/23/b6/87d860dfc6460c246af70b1fd5c8b76df77571b42a493459423ded94fd7d/wrapt-2.2.1-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:7a4fdb9326aab4a5a477a1640e5ad786a8495901009d7e7b038371edd23a9d2b", size = 192206, upload-time = "2026-05-22T14:48:44.858Z" }, + { url = "https://files.pythonhosted.org/packages/df/46/3eea8cde077d985f239a38c0257087b8064fd9ee9b1a99e282d2c86da4ef/wrapt-2.2.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c8cc5094b08abeae52da9c73c8a32003623be691a5193df2f4e3eac3d557c394", size = 198428, upload-time = "2026-05-22T14:48:46.319Z" }, + { url = "https://files.pythonhosted.org/packages/18/dc/b927ee9c7fc67adc3a5658f246a0d275425eb840ba36e7b702e70f18bde8/wrapt-2.2.1-cp313-cp313t-win32.whl", hash = "sha256:9907a4402ab6db12b7077a0ea5d7a4d028ecb22c8eee2b53527080d347cd1562", size = 79448, upload-time = "2026-05-22T14:48:47.901Z" }, + { url = "https://files.pythonhosted.org/packages/ec/b3/fd30b473fe498c70e6b9a5f328b8d3fbaf1b8c3c481465f59724bba8eb70/wrapt-2.2.1-cp313-cp313t-win_amd64.whl", hash = "sha256:5590d63f5243251641cf543009b4c9314a79d0598fdb8a8e4cfc918494536c53", size = 83021, upload-time = "2026-05-22T14:48:49.201Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f3/96c39153a8737a6e9aa85adef254ac4195bea3f2d24efc60472ccc3c9e2e/wrapt-2.2.1-cp313-cp313t-win_arm64.whl", hash = "sha256:c318a64b53d97b841d7b5e637517e50a27be64bc695128422953d4b21710954e", size = 80295, upload-time = "2026-05-22T14:48:50.479Z" }, + { url = "https://files.pythonhosted.org/packages/0a/a3/11d7f34ebbf3231bc907a3e6d5ee051b14d034c1bc7b65a97d5cc00516df/wrapt-2.2.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6f56a647e4eaf5f0ca40330fb070f566bdf9f7b0db89a1af20d71c28dcd7a0ab", size = 80879, upload-time = "2026-05-22T14:48:51.802Z" }, + { url = "https://files.pythonhosted.org/packages/13/3c/b74cfd984cef560b900fb1a727af20352d89e1f06bf2e1114dd3f00f5f5a/wrapt-2.2.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:64b7deeda4b70408e382328d8bbe52a256fe9bc63ae3db86d804608367e5422c", size = 81462, upload-time = "2026-05-22T14:48:53.18Z" }, + { url = "https://files.pythonhosted.org/packages/15/a3/7c8f704b8dc07dfe0a5d01c2edbfd88317aa8e5e3fa7c743eb7a085ae767/wrapt-2.2.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b9cf53ba90717db2e292401de290776c498d4bbfb0d4a559ca2895db8b9dcb5c", size = 167251, upload-time = "2026-05-22T14:48:54.562Z" }, + { url = "https://files.pythonhosted.org/packages/80/85/a34d1888d97247da6c2ff6118c3a721c73ed8cc4dd198c00208bb73b6f80/wrapt-2.2.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cf3638274ab9d9b724c9baa0b4c04e132cd6faefb78b4dd3dd1a02a4bdaad41e", size = 166316, upload-time = "2026-05-22T14:48:56.065Z" }, + { url = "https://files.pythonhosted.org/packages/e9/d7/72ffaeb01eebc704afe3fb99e840480f4bda45f0fa66e3381b6a39251c8f/wrapt-2.2.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aed9658797d0b45d6c49adcfc6b41f66e6f2d0c6de3ec79e16cf4b1855df240f", size = 157952, upload-time = "2026-05-22T14:48:57.924Z" }, + { url = "https://files.pythonhosted.org/packages/24/5b/36f5d6b024e4edfdd90b140742d11ebcf7836daf5c9daf326c55c24db412/wrapt-2.2.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:1d676ee388bc42a04d56dd7deb5605244dac2e35cc2fadbb43c9fa25bbd93508", size = 166130, upload-time = "2026-05-22T14:48:59.384Z" }, + { url = "https://files.pythonhosted.org/packages/81/06/9296d9e97bfdef5483dfcc859d57b095b257144b2bc5300ab521e06f4bc7/wrapt-2.2.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:e395f7bc31851ef9b612050368cb446e9bc14cd7454b025018980349caf25ae5", size = 156604, upload-time = "2026-05-22T14:49:00.921Z" }, + { url = "https://files.pythonhosted.org/packages/53/37/16953929ed6776175720e58fc966e779926d8d71e2c7b2273230590ca71f/wrapt-2.2.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5f1845c2a8cc1180ccccfa45785dd06f562730d19ef75be180334254012b6283", size = 166007, upload-time = "2026-05-22T14:49:02.332Z" }, + { url = "https://files.pythonhosted.org/packages/b9/73/20ee58c0612dae7c31131a7095345812ed2c7b389019e175f68cde34e5b4/wrapt-2.2.1-cp314-cp314-win32.whl", hash = "sha256:436addbc4bb4fc0a88c702577f51195d7d73683a7f3e0e5b253d8404d7847243", size = 78327, upload-time = "2026-05-22T14:49:03.722Z" }, + { url = "https://files.pythonhosted.org/packages/22/b3/ef7c3295d02e0448a71c639a36a057f46d524d057c9486291a7a3039e65c/wrapt-2.2.1-cp314-cp314-win_amd64.whl", hash = "sha256:50972a1d974ea07725a7f6b1cec5f8759008afd030a0024843ebe7d52de47f2b", size = 81144, upload-time = "2026-05-22T14:49:05.093Z" }, + { url = "https://files.pythonhosted.org/packages/ac/dc/7bdf336953f99f4ceb0a584bb8870e42c8f26f93ea10c87834dad62f1668/wrapt-2.2.1-cp314-cp314-win_arm64.whl", hash = "sha256:1c9934ea5d92957e3cd0adbc0845539dccfd62710ebe16195a8c66c53954db36", size = 79569, upload-time = "2026-05-22T14:49:06.413Z" }, + { url = "https://files.pythonhosted.org/packages/6a/6d/6dfae80150ff1919c356d1dd528f049bcdfaae29b4d284bc957e022caef4/wrapt-2.2.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:17de18fc12cea55b8a9587314cb830573e37fb33b247a7515696350863714188", size = 82892, upload-time = "2026-05-22T14:49:07.925Z" }, + { url = "https://files.pythonhosted.org/packages/82/7b/4e34766a7d7804ffce9e71befe47e9b3225dc350c49c94493c4ab39fd3a5/wrapt-2.2.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:a9dec1aca52dddde7df94818310fa2fe79739c8f385b2014c4cb1035f5508199", size = 83333, upload-time = "2026-05-22T14:49:09.257Z" }, + { url = "https://files.pythonhosted.org/packages/9d/57/0b34db3e8de44ccfece62d7b337abd1631dd810f5adc5f3db571727836b5/wrapt-2.2.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:69f2e9244542cb34dd59c7f073445b9e54ad9f3fce8d93606c368a1b499fc413", size = 202899, upload-time = "2026-05-22T14:49:10.572Z" }, + { url = "https://files.pythonhosted.org/packages/e5/45/ac0c459f154b99d92789a6cba7ca727185b83513b986f8ec7fe2aacddcbf/wrapt-2.2.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2d83966dc7f4f45e8b97b5933685ac2e6e67fc0e19246ea314bceb9a8970c956", size = 209986, upload-time = "2026-05-22T14:49:12.229Z" }, + { url = "https://files.pythonhosted.org/packages/b7/e4/77e37ff33ad018fa81ade52c25fa327b80b56f81d734279a63614fcb4cbc/wrapt-2.2.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:78b0aa6bfb7be8deed0ab23e7aa028cc5210c29bc2d32a04d52b50e517a7307e", size = 194893, upload-time = "2026-05-22T14:49:14.139Z" }, + { url = "https://files.pythonhosted.org/packages/dd/9d/7ea651d1ab032fc5fa222fbec91d0f8a1397f6ae04ebb93fa7219aa921d7/wrapt-2.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:05d5cb74d1b232ec8cfa130a8f900708699ff2491d97b8f85a4cdc5996294b85", size = 205636, upload-time = "2026-05-22T14:49:15.714Z" }, + { url = "https://files.pythonhosted.org/packages/09/af/8e88031a701275b9085c54e64bc88c0b1cd55c77eadd400691c371cd76c4/wrapt-2.2.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f6518b94edb9150452e9aba08027d4cc293433753ec1fbefb4629a21cbc74181", size = 192267, upload-time = "2026-05-22T14:49:17.283Z" }, + { url = "https://files.pythonhosted.org/packages/bf/a8/e657ca876b06710194f243d81c4b0896ade646e244bdbec2d87c8c56a8bd/wrapt-2.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ed55af48b3eb28f43228ca2306788892bcb629eb2b5c4876e2a3659872c2f17a", size = 198378, upload-time = "2026-05-22T14:49:18.785Z" }, + { url = "https://files.pythonhosted.org/packages/c8/59/822efe4ea722a3961331bfa35b7d90937790d2c20f0616de1997ccc3aebd/wrapt-2.2.1-cp314-cp314t-win32.whl", hash = "sha256:2e08688ab16525897da6589d56d0aebaf417bbe91c2d8e3b96203b1efa596e85", size = 80226, upload-time = "2026-05-22T14:49:20.264Z" }, + { url = "https://files.pythonhosted.org/packages/ab/31/2a7dc5f6abb2fca0b6e1610e120419f603650aceb4f1d3ac4cae0354e162/wrapt-2.2.1-cp314-cp314t-win_amd64.whl", hash = "sha256:fd0135d34387f5fd087d9be368ea77ea89cf2451dc1cd1c622d35021bcb3ab50", size = 83835, upload-time = "2026-05-22T14:49:21.634Z" }, + { url = "https://files.pythonhosted.org/packages/9f/c0/782b86e28d1ceebeb74cccea12d2cd3d2ba0bd68e3dec20b1bc5873f6127/wrapt-2.2.1-cp314-cp314t-win_arm64.whl", hash = "sha256:f70db64e8266d7c45d3b735f2e08eeb434b5e03da9a479ae42b2e2e486a21a00", size = 80722, upload-time = "2026-05-22T14:49:23.59Z" }, + { url = "https://files.pythonhosted.org/packages/53/46/29ac9daf11a86c22a8c38cd9236c62928ccae83f7ceb06bd3b0467cf9d05/wrapt-2.2.1-py3-none-any.whl", hash = "sha256:3aafea2975caef8ca49400640dde02cc7426e798f24870ed01f490bc3cffd32f", size = 61000, upload-time = "2026-05-22T14:49:41.593Z" }, ] [[package]] name = "zipp" -version = "3.23.0" +version = "4.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e3/02/0f2892c661036d50ede074e376733dca2ae7c6eb617489437771209d4180/zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166", size = 25547, upload-time = "2025-06-08T17:06:39.4Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b9/d8/eab98a517c14134c0b2eb4e2387bc5f457334293ec5d2dd3857ec2966802/zipp-4.1.0.tar.gz", hash = "sha256:4cb57381f544315db7688e976e922a2b18cdb513d21cc194eb42232ba2a3e602", size = 26214, upload-time = "2026-05-18T20:08:57.967Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e", size = 10276, upload-time = "2025-06-08T17:06:38.034Z" }, + { url = "https://files.pythonhosted.org/packages/3a/13/547360d81e6d88d58492968ffda9f9542854f11310ee556fef14260cc886/zipp-4.1.0-py3-none-any.whl", hash = "sha256:25ad4e16390cd314347dd8f1de67a2ac538ae658ed4ab9db16029c07c188e97f", size = 10238, upload-time = "2026-05-18T20:08:57.045Z" }, ] [[package]] name = "zitadel-client" -version = "4.1.8" +version = "0.0.1" source = { editable = "." } dependencies = [ - { name = "authlib" }, - { name = "pydantic" }, + { name = "brotli" }, + { name = "isodate" }, + { name = "pydantic", extra = ["email"] }, + { name = "pyjwt", extra = ["crypto"] }, { name = "python-dateutil" }, - { name = "requests" }, - { name = "typing-extensions" }, { name = "urllib3" }, + { name = "zstandard" }, ] [package.dev-dependencies] dev = [ { name = "cryptography" }, { name = "fawltydeps" }, + { name = "furo" }, + { name = "mypy" }, + { name = "opentelemetry-sdk" }, { name = "pytest" }, + { name = "pytest-asyncio" }, { name = "pytest-cov" }, { name = "python-dotenv" }, { name = "ruff" }, { name = "sphinx" }, { name = "testcontainers" }, - { name = "tox" }, - { name = "ty" }, { name = "types-python-dateutil" }, + { name = "types-requests" }, + { name = "types-urllib3" }, ] [package.metadata] requires-dist = [ - { name = "authlib", specifier = ">=1.3.2,<2.0.0" }, - { name = "pydantic", specifier = ">=2" }, + { name = "brotli", specifier = ">=1.0.0" }, + { name = "isodate", specifier = ">=0.6.1" }, + { name = "pydantic", extras = ["email"], specifier = ">=2,<3" }, + { name = "pyjwt", extras = ["crypto"], specifier = ">=2.0.0" }, { name = "python-dateutil", specifier = ">=2.8.2" }, - { name = "requests", specifier = ">=2.32.4,<3.0.0" }, - { name = "typing-extensions", specifier = ">=4.7.1" }, - { name = "urllib3", specifier = ">=1.25.3,<3.0.0" }, + { name = "urllib3", specifier = ">=2.1.0,<3.0.0" }, + { name = "zstandard", specifier = ">=0.19.0" }, ] [package.metadata.requires-dev] dev = [ { name = "cryptography", specifier = ">=46.0.6,<51.0.0" }, - { name = "fawltydeps", specifier = "==0.19.0" }, - { name = "pytest", specifier = ">=7.2.1" }, - { name = "pytest-cov", specifier = ">=2.8.1" }, - { name = "python-dotenv", specifier = "==1.2.2" }, - { name = "ruff", specifier = ">=0.12.4" }, - { name = "sphinx", specifier = "==7.4.7" }, + { name = "fawltydeps", specifier = ">=0.20,<0.21" }, + { name = "furo", specifier = ">=2024.1.29" }, + { name = "mypy", specifier = ">=1,<3" }, + { name = "opentelemetry-sdk", specifier = ">=1.20.0" }, + { name = "pytest", specifier = ">=7.0.0" }, + { name = "pytest-asyncio", specifier = ">=0.21.0" }, + { name = "pytest-cov", specifier = ">=4.0.0" }, + { name = "python-dotenv", specifier = ">=1.2.2" }, + { name = "ruff", specifier = ">=0.15,<0.16" }, + { name = "sphinx", specifier = ">=7,<10" }, { name = "testcontainers", specifier = ">=4.14.0,<5.0.0" }, - { name = "tox", specifier = ">=3.9.0" }, - { name = "ty", specifier = ">=0.0.4" }, - { name = "types-python-dateutil", specifier = ">=2.8.19.14" }, + { name = "types-python-dateutil", specifier = ">=2.8.0" }, + { name = "types-requests", specifier = ">=2.28.0" }, + { name = "types-urllib3", specifier = ">=1.26.0" }, +] + +[[package]] +name = "zstandard" +version = "0.25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fd/aa/3e0508d5a5dd96529cdc5a97011299056e14c6505b678fd58938792794b1/zstandard-0.25.0.tar.gz", hash = "sha256:7713e1179d162cf5c7906da876ec2ccb9c3a9dcbdffef0cc7f70c3667a205f0b", size = 711513, upload-time = "2025-09-14T22:15:54.002Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/0b/8df9c4ad06af91d39e94fa96cc010a24ac4ef1378d3efab9223cc8593d40/zstandard-0.25.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ec996f12524f88e151c339688c3897194821d7f03081ab35d31d1e12ec975e94", size = 795735, upload-time = "2025-09-14T22:17:26.042Z" }, + { url = "https://files.pythonhosted.org/packages/3f/06/9ae96a3e5dcfd119377ba33d4c42a7d89da1efabd5cb3e366b156c45ff4d/zstandard-0.25.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a1a4ae2dec3993a32247995bdfe367fc3266da832d82f8438c8570f989753de1", size = 640440, upload-time = "2025-09-14T22:17:27.366Z" }, + { url = "https://files.pythonhosted.org/packages/d9/14/933d27204c2bd404229c69f445862454dcc101cd69ef8c6068f15aaec12c/zstandard-0.25.0-cp313-cp313-manylinux2010_i686.manylinux2014_i686.manylinux_2_12_i686.manylinux_2_17_i686.whl", hash = "sha256:e96594a5537722fdfb79951672a2a63aec5ebfb823e7560586f7484819f2a08f", size = 5343070, upload-time = "2025-09-14T22:17:28.896Z" }, + { url = "https://files.pythonhosted.org/packages/6d/db/ddb11011826ed7db9d0e485d13df79b58586bfdec56e5c84a928a9a78c1c/zstandard-0.25.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:bfc4e20784722098822e3eee42b8e576b379ed72cca4a7cb856ae733e62192ea", size = 5063001, upload-time = "2025-09-14T22:17:31.044Z" }, + { url = "https://files.pythonhosted.org/packages/db/00/87466ea3f99599d02a5238498b87bf84a6348290c19571051839ca943777/zstandard-0.25.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.whl", hash = "sha256:457ed498fc58cdc12fc48f7950e02740d4f7ae9493dd4ab2168a47c93c31298e", size = 5394120, upload-time = "2025-09-14T22:17:32.711Z" }, + { url = "https://files.pythonhosted.org/packages/2b/95/fc5531d9c618a679a20ff6c29e2b3ef1d1f4ad66c5e161ae6ff847d102a9/zstandard-0.25.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.whl", hash = "sha256:fd7a5004eb1980d3cefe26b2685bcb0b17989901a70a1040d1ac86f1d898c551", size = 5451230, upload-time = "2025-09-14T22:17:34.41Z" }, + { url = "https://files.pythonhosted.org/packages/63/4b/e3678b4e776db00f9f7b2fe58e547e8928ef32727d7a1ff01dea010f3f13/zstandard-0.25.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8e735494da3db08694d26480f1493ad2cf86e99bdd53e8e9771b2752a5c0246a", size = 5547173, upload-time = "2025-09-14T22:17:36.084Z" }, + { url = "https://files.pythonhosted.org/packages/4e/d5/ba05ed95c6b8ec30bd468dfeab20589f2cf709b5c940483e31d991f2ca58/zstandard-0.25.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3a39c94ad7866160a4a46d772e43311a743c316942037671beb264e395bdd611", size = 5046736, upload-time = "2025-09-14T22:17:37.891Z" }, + { url = "https://files.pythonhosted.org/packages/50/d5/870aa06b3a76c73eced65c044b92286a3c4e00554005ff51962deef28e28/zstandard-0.25.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:172de1f06947577d3a3005416977cce6168f2261284c02080e7ad0185faeced3", size = 5576368, upload-time = "2025-09-14T22:17:40.206Z" }, + { url = "https://files.pythonhosted.org/packages/5d/35/398dc2ffc89d304d59bc12f0fdd931b4ce455bddf7038a0a67733a25f550/zstandard-0.25.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3c83b0188c852a47cd13ef3bf9209fb0a77fa5374958b8c53aaa699398c6bd7b", size = 4954022, upload-time = "2025-09-14T22:17:41.879Z" }, + { url = "https://files.pythonhosted.org/packages/9a/5c/36ba1e5507d56d2213202ec2b05e8541734af5f2ce378c5d1ceaf4d88dc4/zstandard-0.25.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1673b7199bbe763365b81a4f3252b8e80f44c9e323fc42940dc8843bfeaf9851", size = 5267889, upload-time = "2025-09-14T22:17:43.577Z" }, + { url = "https://files.pythonhosted.org/packages/70/e8/2ec6b6fb7358b2ec0113ae202647ca7c0e9d15b61c005ae5225ad0995df5/zstandard-0.25.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:0be7622c37c183406f3dbf0cba104118eb16a4ea7359eeb5752f0794882fc250", size = 5433952, upload-time = "2025-09-14T22:17:45.271Z" }, + { url = "https://files.pythonhosted.org/packages/7b/01/b5f4d4dbc59ef193e870495c6f1275f5b2928e01ff5a81fecb22a06e22fb/zstandard-0.25.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:5f5e4c2a23ca271c218ac025bd7d635597048b366d6f31f420aaeb715239fc98", size = 5814054, upload-time = "2025-09-14T22:17:47.08Z" }, + { url = "https://files.pythonhosted.org/packages/b2/e5/fbd822d5c6f427cf158316d012c5a12f233473c2f9c5fe5ab1ae5d21f3d8/zstandard-0.25.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4f187a0bb61b35119d1926aee039524d1f93aaf38a9916b8c4b78ac8514a0aaf", size = 5360113, upload-time = "2025-09-14T22:17:48.893Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e0/69a553d2047f9a2c7347caa225bb3a63b6d7704ad74610cb7823baa08ed7/zstandard-0.25.0-cp313-cp313-win32.whl", hash = "sha256:7030defa83eef3e51ff26f0b7bfb229f0204b66fe18e04359ce3474ac33cbc09", size = 436936, upload-time = "2025-09-14T22:17:52.658Z" }, + { url = "https://files.pythonhosted.org/packages/d9/82/b9c06c870f3bd8767c201f1edbdf9e8dc34be5b0fbc5682c4f80fe948475/zstandard-0.25.0-cp313-cp313-win_amd64.whl", hash = "sha256:1f830a0dac88719af0ae43b8b2d6aef487d437036468ef3c2ea59c51f9d55fd5", size = 506232, upload-time = "2025-09-14T22:17:50.402Z" }, + { url = "https://files.pythonhosted.org/packages/d4/57/60c3c01243bb81d381c9916e2a6d9e149ab8627c0c7d7abb2d73384b3c0c/zstandard-0.25.0-cp313-cp313-win_arm64.whl", hash = "sha256:85304a43f4d513f5464ceb938aa02c1e78c2943b29f44a750b48b25ac999a049", size = 462671, upload-time = "2025-09-14T22:17:51.533Z" }, + { url = "https://files.pythonhosted.org/packages/3d/5c/f8923b595b55fe49e30612987ad8bf053aef555c14f05bb659dd5dbe3e8a/zstandard-0.25.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:e29f0cf06974c899b2c188ef7f783607dbef36da4c242eb6c82dcd8b512855e3", size = 795887, upload-time = "2025-09-14T22:17:54.198Z" }, + { url = "https://files.pythonhosted.org/packages/8d/09/d0a2a14fc3439c5f874042dca72a79c70a532090b7ba0003be73fee37ae2/zstandard-0.25.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:05df5136bc5a011f33cd25bc9f506e7426c0c9b3f9954f056831ce68f3b6689f", size = 640658, upload-time = "2025-09-14T22:17:55.423Z" }, + { url = "https://files.pythonhosted.org/packages/5d/7c/8b6b71b1ddd517f68ffb55e10834388d4f793c49c6b83effaaa05785b0b4/zstandard-0.25.0-cp314-cp314-manylinux2010_i686.manylinux_2_12_i686.manylinux_2_28_i686.whl", hash = "sha256:f604efd28f239cc21b3adb53eb061e2a205dc164be408e553b41ba2ffe0ca15c", size = 5379849, upload-time = "2025-09-14T22:17:57.372Z" }, + { url = "https://files.pythonhosted.org/packages/a4/86/a48e56320d0a17189ab7a42645387334fba2200e904ee47fc5a26c1fd8ca/zstandard-0.25.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:223415140608d0f0da010499eaa8ccdb9af210a543fac54bce15babbcfc78439", size = 5058095, upload-time = "2025-09-14T22:17:59.498Z" }, + { url = "https://files.pythonhosted.org/packages/f8/ad/eb659984ee2c0a779f9d06dbfe45e2dc39d99ff40a319895df2d3d9a48e5/zstandard-0.25.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2e54296a283f3ab5a26fc9b8b5d4978ea0532f37b231644f367aa588930aa043", size = 5551751, upload-time = "2025-09-14T22:18:01.618Z" }, + { url = "https://files.pythonhosted.org/packages/61/b3/b637faea43677eb7bd42ab204dfb7053bd5c4582bfe6b1baefa80ac0c47b/zstandard-0.25.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ca54090275939dc8ec5dea2d2afb400e0f83444b2fc24e07df7fdef677110859", size = 6364818, upload-time = "2025-09-14T22:18:03.769Z" }, + { url = "https://files.pythonhosted.org/packages/31/dc/cc50210e11e465c975462439a492516a73300ab8caa8f5e0902544fd748b/zstandard-0.25.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e09bb6252b6476d8d56100e8147b803befa9a12cea144bbe629dd508800d1ad0", size = 5560402, upload-time = "2025-09-14T22:18:05.954Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ae/56523ae9c142f0c08efd5e868a6da613ae76614eca1305259c3bf6a0ed43/zstandard-0.25.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:a9ec8c642d1ec73287ae3e726792dd86c96f5681eb8df274a757bf62b750eae7", size = 4955108, upload-time = "2025-09-14T22:18:07.68Z" }, + { url = "https://files.pythonhosted.org/packages/98/cf/c899f2d6df0840d5e384cf4c4121458c72802e8bda19691f3b16619f51e9/zstandard-0.25.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:a4089a10e598eae6393756b036e0f419e8c1d60f44a831520f9af41c14216cf2", size = 5269248, upload-time = "2025-09-14T22:18:09.753Z" }, + { url = "https://files.pythonhosted.org/packages/1b/c0/59e912a531d91e1c192d3085fc0f6fb2852753c301a812d856d857ea03c6/zstandard-0.25.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f67e8f1a324a900e75b5e28ffb152bcac9fbed1cc7b43f99cd90f395c4375344", size = 5430330, upload-time = "2025-09-14T22:18:11.966Z" }, + { url = "https://files.pythonhosted.org/packages/a0/1d/7e31db1240de2df22a58e2ea9a93fc6e38cc29353e660c0272b6735d6669/zstandard-0.25.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:9654dbc012d8b06fc3d19cc825af3f7bf8ae242226df5f83936cb39f5fdc846c", size = 5811123, upload-time = "2025-09-14T22:18:13.907Z" }, + { url = "https://files.pythonhosted.org/packages/f6/49/fac46df5ad353d50535e118d6983069df68ca5908d4d65b8c466150a4ff1/zstandard-0.25.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:4203ce3b31aec23012d3a4cf4a2ed64d12fea5269c49aed5e4c3611b938e4088", size = 5359591, upload-time = "2025-09-14T22:18:16.465Z" }, + { url = "https://files.pythonhosted.org/packages/c2/38/f249a2050ad1eea0bb364046153942e34abba95dd5520af199aed86fbb49/zstandard-0.25.0-cp314-cp314-win32.whl", hash = "sha256:da469dc041701583e34de852d8634703550348d5822e66a0c827d39b05365b12", size = 444513, upload-time = "2025-09-14T22:18:20.61Z" }, + { url = "https://files.pythonhosted.org/packages/3a/43/241f9615bcf8ba8903b3f0432da069e857fc4fd1783bd26183db53c4804b/zstandard-0.25.0-cp314-cp314-win_amd64.whl", hash = "sha256:c19bcdd826e95671065f8692b5a4aa95c52dc7a02a4c5a0cac46deb879a017a2", size = 516118, upload-time = "2025-09-14T22:18:17.849Z" }, + { url = "https://files.pythonhosted.org/packages/f0/ef/da163ce2450ed4febf6467d77ccb4cd52c4c30ab45624bad26ca0a27260c/zstandard-0.25.0-cp314-cp314-win_arm64.whl", hash = "sha256:d7541afd73985c630bafcd6338d2518ae96060075f9463d7dc14cfb33514383d", size = 476940, upload-time = "2025-09-14T22:18:19.088Z" }, ] diff --git a/zitadel_client/__init__.py b/zitadel_client/__init__.py index 2a35cec6..81d02120 100644 --- a/zitadel_client/__init__.py +++ b/zitadel_client/__init__.py @@ -1,12 +1,5580 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + __version__ = "0.0.1" -from .api_client import ApiClient # noqa F401 -from .api_response import ApiResponse # noqa F401 -from .configuration import Configuration # noqa F401 -from .exceptions import ( - ApiError, # noqa F401 - ZitadelError, # noqa F401 +# Define package exports +__all__ = [ + "ActionServiceApi", + "ApplicationServiceApi", + "AuthorizationServiceApi", + "BetaActionServiceApi", + "BetaAppServiceApi", + "BetaAuthorizationServiceApi", + "BetaFeatureServiceApi", + "BetaInstanceServiceApi", + "BetaInternalPermissionServiceApi", + "BetaOIDCServiceApi", + "BetaOrganizationServiceApi", + "BetaProjectServiceApi", + "BetaSessionServiceApi", + "BetaSettingsServiceApi", + "BetaTelemetryServiceApi", + "BetaUserServiceApi", + "BetaWebKeyServiceApi", + "FeatureServiceApi", + "IdentityProviderServiceApi", + "InstanceServiceApi", + "InternalPermissionServiceApi", + "OIDCServiceApi", + "OrganizationServiceApi", + "ProjectServiceApi", + "SAMLServiceApi", + "SessionServiceApi", + "SettingsServiceApi", + "UserServiceApi", + "WebKeyServiceApi", + "Authenticator", + "Zitadel", + "ApiClient", + "Configuration", + "TransportOptions", + "ServerConfiguration", + "ServerVariable", + "ZitadelException", + "ApiException", + "ClientException", + "ServerException", + "BadRequestException", + "UnauthorizedException", + "ForbiddenException", + "NotFoundException", + "ConflictException", + "UnprocessableEntityException", + "InternalServerErrorException", + "NetworkException", + "NetworkTimeoutException", + "SerializationException", + "OAuth2ServerException", + "OAuth2TokenException", + "ActionServiceActivatePublicKeyRequest", + "ActionServiceActivatePublicKeyResponse", + "ActionServiceAddPublicKeyRequest", + "ActionServiceAddPublicKeyResponse", + "ActionServiceAny", + "ActionServiceCondition", + "ActionServiceConnectError", + "ActionServiceCreateTargetRequest", + "ActionServiceCreateTargetResponse", + "ActionServiceDeactivatePublicKeyRequest", + "ActionServiceDeactivatePublicKeyResponse", + "ActionServiceDeleteTargetRequest", + "ActionServiceDeleteTargetResponse", + "ActionServiceEventExecution", + "ActionServiceExecution", + "ActionServiceExecutionFieldName", + "ActionServiceExecutionSearchFilter", + "ActionServiceExecutionType", + "ActionServiceExecutionTypeFilter", + "ActionServiceFunctionExecution", + "ActionServiceGetTargetRequest", + "ActionServiceGetTargetResponse", + "ActionServiceInConditionsFilter", + "ActionServiceInIDsFilter", + "ActionServiceInTargetIDsFilter", + "ActionServiceListExecutionFunctionsResponse", + "ActionServiceListExecutionMethodsResponse", + "ActionServiceListExecutionServicesResponse", + "ActionServiceListExecutionsRequest", + "ActionServiceListExecutionsResponse", + "ActionServiceListPublicKeysRequest", + "ActionServiceListPublicKeysResponse", + "ActionServiceListTargetsRequest", + "ActionServiceListTargetsResponse", + "ActionServicePaginationRequest", + "ActionServicePaginationResponse", + "ActionServicePayloadType", + "ActionServicePublicKey", + "ActionServicePublicKeyFieldName", + "ActionServicePublicKeySearchFilter", + "ActionServiceRESTCall", + "ActionServiceRESTWebhook", + "ActionServiceRemovePublicKeyRequest", + "ActionServiceRemovePublicKeyResponse", + "ActionServiceRequestExecution", + "ActionServiceResponseExecution", + "ActionServiceSetExecutionRequest", + "ActionServiceSetExecutionResponse", + "ActionServiceTarget", + "ActionServiceTargetFieldName", + "ActionServiceTargetFilter", + "ActionServiceTargetNameFilter", + "ActionServiceTargetSearchFilter", + "ActionServiceTextFilterMethod", + "ActionServiceTimestampFilter", + "ActionServiceTimestampFilterMethod", + "ActionServiceUpdateTargetRequest", + "ActionServiceUpdateTargetResponse", + "ApplicationServiceAPIAuthMethodType", + "ApplicationServiceAPIConfiguration", + "ApplicationServiceAny", + "ApplicationServiceApplication", + "ApplicationServiceApplicationKey", + "ApplicationServiceApplicationKeyApplicationIDFilter", + "ApplicationServiceApplicationKeyOrganizationIDFilter", + "ApplicationServiceApplicationKeyProjectIDFilter", + "ApplicationServiceApplicationKeySearchFilter", + "ApplicationServiceApplicationKeysSorting", + "ApplicationServiceApplicationNameFilter", + "ApplicationServiceApplicationSearchFilter", + "ApplicationServiceApplicationSorting", + "ApplicationServiceApplicationState", + "ApplicationServiceApplicationType", + "ApplicationServiceClientIDFilter", + "ApplicationServiceConnectError", + "ApplicationServiceCreateAPIApplicationRequest", + "ApplicationServiceCreateAPIApplicationResponse", + "ApplicationServiceCreateApplicationKeyRequest", + "ApplicationServiceCreateApplicationKeyResponse", + "ApplicationServiceCreateApplicationRequest", + "ApplicationServiceCreateApplicationResponse", + "ApplicationServiceCreateOIDCApplicationRequest", + "ApplicationServiceCreateOIDCApplicationResponse", + "ApplicationServiceCreateSAMLApplicationRequest", + "ApplicationServiceDeactivateApplicationRequest", + "ApplicationServiceDeactivateApplicationResponse", + "ApplicationServiceDeleteApplicationKeyRequest", + "ApplicationServiceDeleteApplicationKeyResponse", + "ApplicationServiceDeleteApplicationRequest", + "ApplicationServiceDeleteApplicationResponse", + "ApplicationServiceEntityIDFilter", + "ApplicationServiceGenerateClientSecretRequest", + "ApplicationServiceGenerateClientSecretResponse", + "ApplicationServiceGetApplicationKeyRequest", + "ApplicationServiceGetApplicationKeyResponse", + "ApplicationServiceGetApplicationRequest", + "ApplicationServiceGetApplicationResponse", + "ApplicationServiceListApplicationKeysRequest", + "ApplicationServiceListApplicationKeysResponse", + "ApplicationServiceListApplicationsRequest", + "ApplicationServiceListApplicationsResponse", + "ApplicationServiceLoginV2", + "ApplicationServiceLoginVersion", + "ApplicationServiceOIDCApplicationType", + "ApplicationServiceOIDCAuthMethodType", + "ApplicationServiceOIDCConfiguration", + "ApplicationServiceOIDCGrantType", + "ApplicationServiceOIDCLocalizedMessage", + "ApplicationServiceOIDCResponseType", + "ApplicationServiceOIDCTokenType", + "ApplicationServiceOIDCVersion", + "ApplicationServicePaginationRequest", + "ApplicationServicePaginationResponse", + "ApplicationServiceProjectIDFilter", + "ApplicationServiceReactivateApplicationRequest", + "ApplicationServiceReactivateApplicationResponse", + "ApplicationServiceSAMLConfiguration", + "ApplicationServiceTextFilterMethod", + "ApplicationServiceUpdateAPIApplicationConfigurationRequest", + "ApplicationServiceUpdateApplicationRequest", + "ApplicationServiceUpdateApplicationResponse", + "ApplicationServiceUpdateOIDCApplicationConfigurationRequest", + "ApplicationServiceUpdateSAMLApplicationConfigurationRequest", + "AuthorizationServiceActivateAuthorizationRequest", + "AuthorizationServiceActivateAuthorizationResponse", + "AuthorizationServiceAny", + "AuthorizationServiceAuthorization", + "AuthorizationServiceAuthorizationFieldName", + "AuthorizationServiceAuthorizationsSearchFilter", + "AuthorizationServiceConnectError", + "AuthorizationServiceCreateAuthorizationRequest", + "AuthorizationServiceCreateAuthorizationResponse", + "AuthorizationServiceDeactivateAuthorizationRequest", + "AuthorizationServiceDeactivateAuthorizationResponse", + "AuthorizationServiceDeleteAuthorizationRequest", + "AuthorizationServiceDeleteAuthorizationResponse", + "AuthorizationServiceIDFilter", + "AuthorizationServiceInIDsFilter", + "AuthorizationServiceListAuthorizationsRequest", + "AuthorizationServiceListAuthorizationsResponse", + "AuthorizationServiceOrganization", + "AuthorizationServicePaginationRequest", + "AuthorizationServicePaginationResponse", + "AuthorizationServiceProject", + "AuthorizationServiceProjectNameQuery", + "AuthorizationServiceRole", + "AuthorizationServiceRoleKeyQuery", + "AuthorizationServiceState", + "AuthorizationServiceStateQuery", + "AuthorizationServiceTextFilterMethod", + "AuthorizationServiceUpdateAuthorizationRequest", + "AuthorizationServiceUpdateAuthorizationResponse", + "AuthorizationServiceUser", + "AuthorizationServiceUserDisplayNameQuery", + "AuthorizationServiceUserPreferredLoginNameQuery", + "BetaActionServiceAny", + "BetaActionServiceCondition", + "BetaActionServiceConnectError", + "BetaActionServiceCreateTargetRequest", + "BetaActionServiceCreateTargetResponse", + "BetaActionServiceDeleteTargetRequest", + "BetaActionServiceDeleteTargetResponse", + "BetaActionServiceEventExecution", + "BetaActionServiceExecution", + "BetaActionServiceExecutionFieldName", + "BetaActionServiceExecutionSearchFilter", + "BetaActionServiceExecutionType", + "BetaActionServiceExecutionTypeFilter", + "BetaActionServiceFunctionExecution", + "BetaActionServiceGetTargetRequest", + "BetaActionServiceGetTargetResponse", + "BetaActionServiceInConditionsFilter", + "BetaActionServiceInTargetIDsFilter", + "BetaActionServiceListExecutionFunctionsResponse", + "BetaActionServiceListExecutionMethodsResponse", + "BetaActionServiceListExecutionServicesResponse", + "BetaActionServiceListExecutionsRequest", + "BetaActionServiceListExecutionsResponse", + "BetaActionServiceListTargetsRequest", + "BetaActionServiceListTargetsResponse", + "BetaActionServicePaginationRequest", + "BetaActionServicePaginationResponse", + "BetaActionServiceRESTCall", + "BetaActionServiceRESTWebhook", + "BetaActionServiceRequestExecution", + "BetaActionServiceResponseExecution", + "BetaActionServiceSetExecutionRequest", + "BetaActionServiceSetExecutionResponse", + "BetaActionServiceTarget", + "BetaActionServiceTargetFieldName", + "BetaActionServiceTargetFilter", + "BetaActionServiceTargetNameFilter", + "BetaActionServiceTargetSearchFilter", + "BetaActionServiceTextFilterMethod", + "BetaActionServiceUpdateTargetRequest", + "BetaActionServiceUpdateTargetResponse", + "BetaAppServiceAPIAuthMethodType", + "BetaAppServiceAPIConfig", + "BetaAppServiceAny", + "BetaAppServiceAppSorting", + "BetaAppServiceAppState", + "BetaAppServiceApplication", + "BetaAppServiceApplicationKey", + "BetaAppServiceApplicationKeysSorting", + "BetaAppServiceApplicationNameQuery", + "BetaAppServiceApplicationSearchFilter", + "BetaAppServiceConnectError", + "BetaAppServiceCreateAPIApplicationRequest", + "BetaAppServiceCreateAPIApplicationResponse", + "BetaAppServiceCreateApplicationKeyRequest", + "BetaAppServiceCreateApplicationKeyResponse", + "BetaAppServiceCreateApplicationRequest", + "BetaAppServiceCreateApplicationResponse", + "BetaAppServiceCreateOIDCApplicationRequest", + "BetaAppServiceCreateOIDCApplicationResponse", + "BetaAppServiceCreateSAMLApplicationRequest", + "BetaAppServiceDeactivateApplicationRequest", + "BetaAppServiceDeactivateApplicationResponse", + "BetaAppServiceDeleteApplicationKeyRequest", + "BetaAppServiceDeleteApplicationKeyResponse", + "BetaAppServiceDeleteApplicationRequest", + "BetaAppServiceDeleteApplicationResponse", + "BetaAppServiceGetApplicationKeyRequest", + "BetaAppServiceGetApplicationKeyResponse", + "BetaAppServiceGetApplicationRequest", + "BetaAppServiceGetApplicationResponse", + "BetaAppServiceListApplicationKeysRequest", + "BetaAppServiceListApplicationKeysResponse", + "BetaAppServiceListApplicationsRequest", + "BetaAppServiceListApplicationsResponse", + "BetaAppServiceLoginV2", + "BetaAppServiceLoginVersion", + "BetaAppServiceOIDCAppType", + "BetaAppServiceOIDCAuthMethodType", + "BetaAppServiceOIDCConfig", + "BetaAppServiceOIDCGrantType", + "BetaAppServiceOIDCLocalizedMessage", + "BetaAppServiceOIDCResponseType", + "BetaAppServiceOIDCTokenType", + "BetaAppServiceOIDCVersion", + "BetaAppServicePaginationRequest", + "BetaAppServicePaginationResponse", + "BetaAppServiceReactivateApplicationRequest", + "BetaAppServiceReactivateApplicationResponse", + "BetaAppServiceRegenerateClientSecretRequest", + "BetaAppServiceRegenerateClientSecretResponse", + "BetaAppServiceSAMLConfig", + "BetaAppServiceTextFilterMethod", + "BetaAppServiceUpdateAPIApplicationConfigurationRequest", + "BetaAppServiceUpdateApplicationRequest", + "BetaAppServiceUpdateApplicationResponse", + "BetaAppServiceUpdateOIDCApplicationConfigurationRequest", + "BetaAppServiceUpdateSAMLApplicationConfigurationRequest", + "BetaAuthorizationServiceActivateAuthorizationRequest", + "BetaAuthorizationServiceActivateAuthorizationResponse", + "BetaAuthorizationServiceAny", + "BetaAuthorizationServiceAuthorization", + "BetaAuthorizationServiceAuthorizationFieldName", + "BetaAuthorizationServiceAuthorizationsSearchFilter", + "BetaAuthorizationServiceConnectError", + "BetaAuthorizationServiceCreateAuthorizationRequest", + "BetaAuthorizationServiceCreateAuthorizationResponse", + "BetaAuthorizationServiceDeactivateAuthorizationRequest", + "BetaAuthorizationServiceDeactivateAuthorizationResponse", + "BetaAuthorizationServiceDeleteAuthorizationRequest", + "BetaAuthorizationServiceDeleteAuthorizationResponse", + "BetaAuthorizationServiceIDFilter", + "BetaAuthorizationServiceInIDsFilter", + "BetaAuthorizationServiceListAuthorizationsRequest", + "BetaAuthorizationServiceListAuthorizationsResponse", + "BetaAuthorizationServicePaginationRequest", + "BetaAuthorizationServicePaginationResponse", + "BetaAuthorizationServiceProjectNameQuery", + "BetaAuthorizationServiceRoleKeyQuery", + "BetaAuthorizationServiceState", + "BetaAuthorizationServiceStateQuery", + "BetaAuthorizationServiceTextFilterMethod", + "BetaAuthorizationServiceUpdateAuthorizationRequest", + "BetaAuthorizationServiceUpdateAuthorizationResponse", + "BetaAuthorizationServiceUser", + "BetaAuthorizationServiceUserDisplayNameQuery", + "BetaAuthorizationServiceUserPreferredLoginNameQuery", + "BetaFeatureServiceAny", + "BetaFeatureServiceConnectError", + "BetaFeatureServiceDetails", + "BetaFeatureServiceFeatureFlag", + "BetaFeatureServiceGetInstanceFeaturesRequest", + "BetaFeatureServiceGetInstanceFeaturesResponse", + "BetaFeatureServiceGetOrganizationFeaturesRequest", + "BetaFeatureServiceGetOrganizationFeaturesResponse", + "BetaFeatureServiceGetSystemFeaturesResponse", + "BetaFeatureServiceGetUserFeaturesRequest", + "BetaFeatureServiceGetUserFeaturesResponse", + "BetaFeatureServiceImprovedPerformance", + "BetaFeatureServiceImprovedPerformanceFeatureFlag", + "BetaFeatureServiceResetInstanceFeaturesResponse", + "BetaFeatureServiceResetOrganizationFeaturesRequest", + "BetaFeatureServiceResetOrganizationFeaturesResponse", + "BetaFeatureServiceResetSystemFeaturesResponse", + "BetaFeatureServiceResetUserFeaturesRequest", + "BetaFeatureServiceResetUserFeaturesResponse", + "BetaFeatureServiceSetInstanceFeaturesRequest", + "BetaFeatureServiceSetInstanceFeaturesResponse", + "BetaFeatureServiceSetOrganizationFeaturesRequest", + "BetaFeatureServiceSetOrganizationFeaturesResponse", + "BetaFeatureServiceSetSystemFeaturesRequest", + "BetaFeatureServiceSetSystemFeaturesResponse", + "BetaFeatureServiceSetUserFeatureRequest", + "BetaFeatureServiceSetUserFeaturesResponse", + "BetaFeatureServiceSource", + "BetaInstanceServiceAddCustomDomainRequest", + "BetaInstanceServiceAddCustomDomainResponse", + "BetaInstanceServiceAddTrustedDomainRequest", + "BetaInstanceServiceAddTrustedDomainResponse", + "BetaInstanceServiceAny", + "BetaInstanceServiceConnectError", + "BetaInstanceServiceDeleteInstanceRequest", + "BetaInstanceServiceDeleteInstanceResponse", + "BetaInstanceServiceDomain", + "BetaInstanceServiceDomainFieldName", + "BetaInstanceServiceDomainGeneratedQuery", + "BetaInstanceServiceDomainPrimaryQuery", + "BetaInstanceServiceDomainQuery", + "BetaInstanceServiceDomainSearchQuery", + "BetaInstanceServiceDomainsQuery", + "BetaInstanceServiceFieldName", + "BetaInstanceServiceGetInstanceRequest", + "BetaInstanceServiceGetInstanceResponse", + "BetaInstanceServiceIdsQuery", + "BetaInstanceServiceInstance", + "BetaInstanceServiceListCustomDomainsRequest", + "BetaInstanceServiceListCustomDomainsResponse", + "BetaInstanceServiceListInstancesRequest", + "BetaInstanceServiceListInstancesResponse", + "BetaInstanceServiceListTrustedDomainsRequest", + "BetaInstanceServiceListTrustedDomainsResponse", + "BetaInstanceServicePaginationRequest", + "BetaInstanceServicePaginationResponse", + "BetaInstanceServiceQuery", + "BetaInstanceServiceRemoveCustomDomainRequest", + "BetaInstanceServiceRemoveCustomDomainResponse", + "BetaInstanceServiceRemoveTrustedDomainRequest", + "BetaInstanceServiceRemoveTrustedDomainResponse", + "BetaInstanceServiceState", + "BetaInstanceServiceTextQueryMethod", + "BetaInstanceServiceTrustedDomain", + "BetaInstanceServiceTrustedDomainFieldName", + "BetaInstanceServiceTrustedDomainSearchQuery", + "BetaInstanceServiceUpdateInstanceRequest", + "BetaInstanceServiceUpdateInstanceResponse", + "BetaInternalPermissionServiceAdministrator", + "BetaInternalPermissionServiceAdministratorFieldName", + "BetaInternalPermissionServiceAdministratorSearchFilter", + "BetaInternalPermissionServiceAndFilter", + "BetaInternalPermissionServiceAny", + "BetaInternalPermissionServiceConnectError", + "BetaInternalPermissionServiceCreateAdministratorRequest", + "BetaInternalPermissionServiceCreateAdministratorResponse", + "BetaInternalPermissionServiceDeleteAdministratorRequest", + "BetaInternalPermissionServiceDeleteAdministratorResponse", + "BetaInternalPermissionServiceIDFilter", + "BetaInternalPermissionServiceInIDsFilter", + "BetaInternalPermissionServiceListAdministratorsRequest", + "BetaInternalPermissionServiceListAdministratorsResponse", + "BetaInternalPermissionServiceNotFilter", + "BetaInternalPermissionServiceOrFilter", + "BetaInternalPermissionServiceOrganization", + "BetaInternalPermissionServicePaginationRequest", + "BetaInternalPermissionServicePaginationResponse", + "BetaInternalPermissionServiceProject", + "BetaInternalPermissionServiceProjectGrant", + "BetaInternalPermissionServiceResourceFilter", + "BetaInternalPermissionServiceResourceType", + "BetaInternalPermissionServiceRoleFilter", + "BetaInternalPermissionServiceTextFilterMethod", + "BetaInternalPermissionServiceTimestampFilter", + "BetaInternalPermissionServiceTimestampFilterMethod", + "BetaInternalPermissionServiceUpdateAdministratorRequest", + "BetaInternalPermissionServiceUpdateAdministratorResponse", + "BetaInternalPermissionServiceUser", + "BetaInternalPermissionServiceUserDisplayNameFilter", + "BetaInternalPermissionServiceUserPreferredLoginNameFilter", + "BetaOIDCServiceAny", + "BetaOIDCServiceAuthRequest", + "BetaOIDCServiceAuthorizationError", + "BetaOIDCServiceConnectError", + "BetaOIDCServiceCreateCallbackRequest", + "BetaOIDCServiceCreateCallbackResponse", + "BetaOIDCServiceDetails", + "BetaOIDCServiceErrorReason", + "BetaOIDCServiceGetAuthRequestRequest", + "BetaOIDCServiceGetAuthRequestResponse", + "BetaOIDCServicePrompt", + "BetaOIDCServiceSession", + "BetaOrganizationServiceActivateOrganizationRequest", + "BetaOrganizationServiceActivateOrganizationResponse", + "BetaOrganizationServiceAddHumanUserRequest", + "BetaOrganizationServiceAddOrganizationDomainRequest", + "BetaOrganizationServiceAddOrganizationDomainResponse", + "BetaOrganizationServiceAdmin", + "BetaOrganizationServiceAny", + "BetaOrganizationServiceAssignedAdmin", + "BetaOrganizationServiceConnectError", + "BetaOrganizationServiceCreateOrganizationRequest", + "BetaOrganizationServiceCreateOrganizationResponse", + "BetaOrganizationServiceCreatedAdmin", + "BetaOrganizationServiceDeactivateOrganizationRequest", + "BetaOrganizationServiceDeactivateOrganizationResponse", + "BetaOrganizationServiceDeleteOrganizationDomainRequest", + "BetaOrganizationServiceDeleteOrganizationDomainResponse", + "BetaOrganizationServiceDeleteOrganizationMetadataRequest", + "BetaOrganizationServiceDeleteOrganizationMetadataResponse", + "BetaOrganizationServiceDeleteOrganizationRequest", + "BetaOrganizationServiceDeleteOrganizationResponse", + "BetaOrganizationServiceDomain", + "BetaOrganizationServiceDomainNameFilter", + "BetaOrganizationServiceDomainSearchFilter", + "BetaOrganizationServiceDomainValidationType", + "BetaOrganizationServiceGender", + "BetaOrganizationServiceGenerateOrganizationDomainValidationRequest", + "BetaOrganizationServiceGenerateOrganizationDomainValidationResponse", + "BetaOrganizationServiceHashedPassword", + "BetaOrganizationServiceIDPLink", + "BetaOrganizationServiceListOrganizationDomainsRequest", + "BetaOrganizationServiceListOrganizationDomainsResponse", + "BetaOrganizationServiceListOrganizationMetadataRequest", + "BetaOrganizationServiceListOrganizationMetadataResponse", + "BetaOrganizationServiceListOrganizationsRequest", + "BetaOrganizationServiceListOrganizationsResponse", + "BetaOrganizationServiceMetadata", + "BetaOrganizationServiceMetadataKeyQuery", + "BetaOrganizationServiceMetadataQuery", + "BetaOrganizationServiceOrgDomainFilter", + "BetaOrganizationServiceOrgFieldName", + "BetaOrganizationServiceOrgIDFilter", + "BetaOrganizationServiceOrgNameFilter", + "BetaOrganizationServiceOrgState", + "BetaOrganizationServiceOrgStateFilter", + "BetaOrganizationServiceOrganization", + "BetaOrganizationServiceOrganizationAdmin", + "BetaOrganizationServiceOrganizationSearchFilter", + "BetaOrganizationServicePaginationRequest", + "BetaOrganizationServicePaginationResponse", + "BetaOrganizationServicePassword", + "BetaOrganizationServiceSendEmailVerificationCode", + "BetaOrganizationServiceSetHumanEmail", + "BetaOrganizationServiceSetHumanPhone", + "BetaOrganizationServiceSetHumanProfile", + "BetaOrganizationServiceSetMetadataEntry", + "BetaOrganizationServiceSetOrganizationMetadataRequest", + "BetaOrganizationServiceSetOrganizationMetadataResponse", + "BetaOrganizationServiceTextQueryMethod", + "BetaOrganizationServiceUpdateOrganizationRequest", + "BetaOrganizationServiceUpdateOrganizationResponse", + "BetaOrganizationServiceVerifyOrganizationDomainRequest", + "BetaOrganizationServiceVerifyOrganizationDomainResponse", + "BetaProjectServiceActivateProjectGrantRequest", + "BetaProjectServiceActivateProjectGrantResponse", + "BetaProjectServiceActivateProjectRequest", + "BetaProjectServiceActivateProjectResponse", + "BetaProjectServiceAddProjectRoleRequest", + "BetaProjectServiceAddProjectRoleResponse", + "BetaProjectServiceAdmin", + "BetaProjectServiceAny", + "BetaProjectServiceConnectError", + "BetaProjectServiceCreateProjectGrantRequest", + "BetaProjectServiceCreateProjectGrantResponse", + "BetaProjectServiceCreateProjectRequest", + "BetaProjectServiceCreateProjectResponse", + "BetaProjectServiceDeactivateProjectGrantRequest", + "BetaProjectServiceDeactivateProjectGrantResponse", + "BetaProjectServiceDeactivateProjectRequest", + "BetaProjectServiceDeactivateProjectResponse", + "BetaProjectServiceDeleteProjectGrantRequest", + "BetaProjectServiceDeleteProjectGrantResponse", + "BetaProjectServiceDeleteProjectRequest", + "BetaProjectServiceDeleteProjectResponse", + "BetaProjectServiceGetProjectRequest", + "BetaProjectServiceGetProjectResponse", + "BetaProjectServiceGrantedProjectState", + "BetaProjectServiceIDFilter", + "BetaProjectServiceInIDsFilter", + "BetaProjectServiceListProjectGrantsRequest", + "BetaProjectServiceListProjectGrantsResponse", + "BetaProjectServiceListProjectRolesRequest", + "BetaProjectServiceListProjectRolesResponse", + "BetaProjectServiceListProjectsRequest", + "BetaProjectServiceListProjectsResponse", + "BetaProjectServicePaginationRequest", + "BetaProjectServicePaginationResponse", + "BetaProjectServicePrivateLabelingSetting", + "BetaProjectServiceProject", + "BetaProjectServiceProjectFieldName", + "BetaProjectServiceProjectGrant", + "BetaProjectServiceProjectGrantFieldName", + "BetaProjectServiceProjectGrantSearchFilter", + "BetaProjectServiceProjectGrantState", + "BetaProjectServiceProjectNameFilter", + "BetaProjectServiceProjectRole", + "BetaProjectServiceProjectRoleDisplayNameFilter", + "BetaProjectServiceProjectRoleFieldName", + "BetaProjectServiceProjectRoleKeyFilter", + "BetaProjectServiceProjectRoleSearchFilter", + "BetaProjectServiceProjectSearchFilter", + "BetaProjectServiceProjectState", + "BetaProjectServiceRemoveProjectRoleRequest", + "BetaProjectServiceRemoveProjectRoleResponse", + "BetaProjectServiceTextFilterMethod", + "BetaProjectServiceUpdateProjectGrantRequest", + "BetaProjectServiceUpdateProjectGrantResponse", + "BetaProjectServiceUpdateProjectRequest", + "BetaProjectServiceUpdateProjectResponse", + "BetaProjectServiceUpdateProjectRoleRequest", + "BetaProjectServiceUpdateProjectRoleResponse", + "BetaSessionServiceAny", + "BetaSessionServiceChallenges", + "BetaSessionServiceCheckIDPIntent", + "BetaSessionServiceCheckOTP", + "BetaSessionServiceCheckPassword", + "BetaSessionServiceCheckTOTP", + "BetaSessionServiceCheckUser", + "BetaSessionServiceCheckWebAuthN", + "BetaSessionServiceChecks", + "BetaSessionServiceConnectError", + "BetaSessionServiceCreateSessionRequest", + "BetaSessionServiceCreateSessionResponse", + "BetaSessionServiceCreationDateQuery", + "BetaSessionServiceDeleteSessionRequest", + "BetaSessionServiceDeleteSessionResponse", + "BetaSessionServiceDetails", + "BetaSessionServiceFactors", + "BetaSessionServiceGetSessionRequest", + "BetaSessionServiceGetSessionResponse", + "BetaSessionServiceHeaderValues", + "BetaSessionServiceIDsQuery", + "BetaSessionServiceIntentFactor", + "BetaSessionServiceListDetails", + "BetaSessionServiceListQuery", + "BetaSessionServiceListSessionsRequest", + "BetaSessionServiceListSessionsResponse", + "BetaSessionServiceOTPEmail", + "BetaSessionServiceOTPFactor", + "BetaSessionServiceOTPSMS", + "BetaSessionServicePasswordFactor", + "BetaSessionServiceRequestChallenges", + "BetaSessionServiceSearchQuery", + "BetaSessionServiceSendCode", + "BetaSessionServiceSession", + "BetaSessionServiceSessionFieldName", + "BetaSessionServiceSetSessionRequest", + "BetaSessionServiceSetSessionResponse", + "BetaSessionServiceTOTPFactor", + "BetaSessionServiceTimestampQueryMethod", + "BetaSessionServiceUserAgent", + "BetaSessionServiceUserFactor", + "BetaSessionServiceUserIDQuery", + "BetaSessionServiceUserVerificationRequirement", + "BetaSessionServiceWebAuthN", + "BetaSessionServiceWebAuthNFactor", + "BetaSettingsServiceAny", + "BetaSettingsServiceBrandingSettings", + "BetaSettingsServiceConnectError", + "BetaSettingsServiceDetails", + "BetaSettingsServiceDomainSettings", + "BetaSettingsServiceEmbeddedIframeSettings", + "BetaSettingsServiceGetActiveIdentityProvidersRequest", + "BetaSettingsServiceGetActiveIdentityProvidersResponse", + "BetaSettingsServiceGetBrandingSettingsRequest", + "BetaSettingsServiceGetBrandingSettingsResponse", + "BetaSettingsServiceGetDomainSettingsRequest", + "BetaSettingsServiceGetDomainSettingsResponse", + "BetaSettingsServiceGetGeneralSettingsResponse", + "BetaSettingsServiceGetLegalAndSupportSettingsRequest", + "BetaSettingsServiceGetLegalAndSupportSettingsResponse", + "BetaSettingsServiceGetLockoutSettingsRequest", + "BetaSettingsServiceGetLockoutSettingsResponse", + "BetaSettingsServiceGetLoginSettingsRequest", + "BetaSettingsServiceGetLoginSettingsResponse", + "BetaSettingsServiceGetPasswordComplexitySettingsRequest", + "BetaSettingsServiceGetPasswordComplexitySettingsResponse", + "BetaSettingsServiceGetPasswordExpirySettingsRequest", + "BetaSettingsServiceGetPasswordExpirySettingsResponse", + "BetaSettingsServiceGetSecuritySettingsResponse", + "BetaSettingsServiceIdentityProvider", + "BetaSettingsServiceIdentityProviderType", + "BetaSettingsServiceLegalAndSupportSettings", + "BetaSettingsServiceListDetails", + "BetaSettingsServiceLockoutSettings", + "BetaSettingsServiceLoginSettings", + "BetaSettingsServiceMultiFactorType", + "BetaSettingsServicePasskeysType", + "BetaSettingsServicePasswordComplexitySettings", + "BetaSettingsServicePasswordExpirySettings", + "BetaSettingsServiceRequestContext", + "BetaSettingsServiceResourceOwnerType", + "BetaSettingsServiceSecondFactorType", + "BetaSettingsServiceSecuritySettings", + "BetaSettingsServiceSetSecuritySettingsRequest", + "BetaSettingsServiceSetSecuritySettingsResponse", + "BetaSettingsServiceTheme", + "BetaSettingsServiceThemeMode", + "BetaTelemetryServiceAny", + "BetaTelemetryServiceConnectError", + "BetaTelemetryServiceCountParentType", + "BetaTelemetryServiceInstanceInformation", + "BetaTelemetryServiceReportBaseInformationRequest", + "BetaTelemetryServiceReportBaseInformationResponse", + "BetaTelemetryServiceReportResourceCountsRequest", + "BetaTelemetryServiceReportResourceCountsResponse", + "BetaTelemetryServiceResourceCount", + "BetaUserServiceAccessTokenType", + "BetaUserServiceAddHumanUserRequest", + "BetaUserServiceAddHumanUserResponse", + "BetaUserServiceAddIDPLinkRequest", + "BetaUserServiceAddIDPLinkResponse", + "BetaUserServiceAddOTPEmailRequest", + "BetaUserServiceAddOTPEmailResponse", + "BetaUserServiceAddOTPSMSRequest", + "BetaUserServiceAddOTPSMSResponse", + "BetaUserServiceAndQuery", + "BetaUserServiceAny", + "BetaUserServiceAuthenticationMethodType", + "BetaUserServiceConnectError", + "BetaUserServiceCreatePasskeyRegistrationLinkRequest", + "BetaUserServiceCreatePasskeyRegistrationLinkResponse", + "BetaUserServiceDeactivateUserRequest", + "BetaUserServiceDeactivateUserResponse", + "BetaUserServiceDeleteUserRequest", + "BetaUserServiceDeleteUserResponse", + "BetaUserServiceDetails", + "BetaUserServiceDisplayNameQuery", + "BetaUserServiceEmailQuery", + "BetaUserServiceFirstNameQuery", + "BetaUserServiceFormData", + "BetaUserServiceGender", + "BetaUserServiceGetUserByIDRequest", + "BetaUserServiceGetUserByIDResponse", + "BetaUserServiceHashedPassword", + "BetaUserServiceHumanEmail", + "BetaUserServiceHumanPhone", + "BetaUserServiceHumanProfile", + "BetaUserServiceHumanUser", + "BetaUserServiceIDPInformation", + "BetaUserServiceIDPIntent", + "BetaUserServiceIDPLDAPAccessInformation", + "BetaUserServiceIDPLink", + "BetaUserServiceIDPOAuthAccessInformation", + "BetaUserServiceIDPSAMLAccessInformation", + "BetaUserServiceInUserEmailsQuery", + "BetaUserServiceInUserIDQuery", + "BetaUserServiceLDAPCredentials", + "BetaUserServiceLastNameQuery", + "BetaUserServiceListAuthenticationMethodTypesRequest", + "BetaUserServiceListAuthenticationMethodTypesResponse", + "BetaUserServiceListDetails", + "BetaUserServiceListQuery", + "BetaUserServiceListUsersRequest", + "BetaUserServiceListUsersResponse", + "BetaUserServiceLockUserRequest", + "BetaUserServiceLockUserResponse", + "BetaUserServiceLoginNameQuery", + "BetaUserServiceMachineUser", + "BetaUserServiceNickNameQuery", + "BetaUserServiceNotQuery", + "BetaUserServiceNotificationType", + "BetaUserServiceOrQuery", + "BetaUserServiceOrganization", + "BetaUserServiceOrganizationIdQuery", + "BetaUserServicePasskeyAuthenticator", + "BetaUserServicePasskeyRegistrationCode", + "BetaUserServicePassword", + "BetaUserServicePasswordResetRequest", + "BetaUserServicePasswordResetResponse", + "BetaUserServicePhoneQuery", + "BetaUserServiceReactivateUserRequest", + "BetaUserServiceReactivateUserResponse", + "BetaUserServiceRedirectURLs", + "BetaUserServiceRegisterPasskeyRequest", + "BetaUserServiceRegisterPasskeyResponse", + "BetaUserServiceRegisterTOTPRequest", + "BetaUserServiceRegisterTOTPResponse", + "BetaUserServiceRegisterU2FRequest", + "BetaUserServiceRegisterU2FResponse", + "BetaUserServiceRemoveOTPEmailRequest", + "BetaUserServiceRemoveOTPEmailResponse", + "BetaUserServiceRemoveOTPSMSRequest", + "BetaUserServiceRemoveOTPSMSResponse", + "BetaUserServiceRemovePhoneRequest", + "BetaUserServiceRemovePhoneResponse", + "BetaUserServiceRemoveTOTPRequest", + "BetaUserServiceRemoveTOTPResponse", + "BetaUserServiceResendEmailCodeRequest", + "BetaUserServiceResendEmailCodeResponse", + "BetaUserServiceResendPhoneCodeRequest", + "BetaUserServiceResendPhoneCodeResponse", + "BetaUserServiceRetrieveIdentityProviderIntentRequest", + "BetaUserServiceRetrieveIdentityProviderIntentResponse", + "BetaUserServiceSearchQuery", + "BetaUserServiceSendEmailVerificationCode", + "BetaUserServiceSendPasskeyRegistrationLink", + "BetaUserServiceSendPasswordResetLink", + "BetaUserServiceSetEmailRequest", + "BetaUserServiceSetEmailResponse", + "BetaUserServiceSetHumanEmail", + "BetaUserServiceSetHumanPhone", + "BetaUserServiceSetHumanProfile", + "BetaUserServiceSetMetadataEntry", + "BetaUserServiceSetPassword", + "BetaUserServiceSetPasswordRequest", + "BetaUserServiceSetPasswordResponse", + "BetaUserServiceSetPhoneRequest", + "BetaUserServiceSetPhoneResponse", + "BetaUserServiceStartIdentityProviderIntentRequest", + "BetaUserServiceStartIdentityProviderIntentResponse", + "BetaUserServiceStateQuery", + "BetaUserServiceTextQueryMethod", + "BetaUserServiceType", + "BetaUserServiceTypeQuery", + "BetaUserServiceUnlockUserRequest", + "BetaUserServiceUnlockUserResponse", + "BetaUserServiceUpdateHumanUserRequest", + "BetaUserServiceUpdateHumanUserResponse", + "BetaUserServiceUser", + "BetaUserServiceUserFieldName", + "BetaUserServiceUserNameQuery", + "BetaUserServiceUserState", + "BetaUserServiceVerifyEmailRequest", + "BetaUserServiceVerifyEmailResponse", + "BetaUserServiceVerifyPasskeyRegistrationRequest", + "BetaUserServiceVerifyPasskeyRegistrationResponse", + "BetaUserServiceVerifyPhoneRequest", + "BetaUserServiceVerifyPhoneResponse", + "BetaUserServiceVerifyTOTPRegistrationRequest", + "BetaUserServiceVerifyTOTPRegistrationResponse", + "BetaUserServiceVerifyU2FRegistrationRequest", + "BetaUserServiceVerifyU2FRegistrationResponse", + "BetaWebKeyServiceActivateWebKeyRequest", + "BetaWebKeyServiceActivateWebKeyResponse", + "BetaWebKeyServiceAny", + "BetaWebKeyServiceConnectError", + "BetaWebKeyServiceCreateWebKeyRequest", + "BetaWebKeyServiceCreateWebKeyResponse", + "BetaWebKeyServiceDeleteWebKeyRequest", + "BetaWebKeyServiceDeleteWebKeyResponse", + "BetaWebKeyServiceECDSA", + "BetaWebKeyServiceECDSACurve", + "BetaWebKeyServiceListWebKeysResponse", + "BetaWebKeyServiceRSA", + "BetaWebKeyServiceRSABits", + "BetaWebKeyServiceRSAHasher", + "BetaWebKeyServiceState", + "BetaWebKeyServiceWebKey", + "FeatureServiceAny", + "FeatureServiceConnectError", + "FeatureServiceDetails", + "FeatureServiceFeatureFlag", + "FeatureServiceGetInstanceFeaturesRequest", + "FeatureServiceGetInstanceFeaturesResponse", + "FeatureServiceGetOrganizationFeaturesRequest", + "FeatureServiceGetOrganizationFeaturesResponse", + "FeatureServiceGetSystemFeaturesResponse", + "FeatureServiceGetUserFeaturesRequest", + "FeatureServiceGetUserFeaturesResponse", + "FeatureServiceImprovedPerformance", + "FeatureServiceImprovedPerformanceFeatureFlag", + "FeatureServiceLoginV2", + "FeatureServiceLoginV2FeatureFlag", + "FeatureServiceResetInstanceFeaturesResponse", + "FeatureServiceResetOrganizationFeaturesRequest", + "FeatureServiceResetOrganizationFeaturesResponse", + "FeatureServiceResetSystemFeaturesResponse", + "FeatureServiceResetUserFeaturesRequest", + "FeatureServiceResetUserFeaturesResponse", + "FeatureServiceSetInstanceFeaturesRequest", + "FeatureServiceSetInstanceFeaturesResponse", + "FeatureServiceSetOrganizationFeaturesRequest", + "FeatureServiceSetOrganizationFeaturesResponse", + "FeatureServiceSetSystemFeaturesRequest", + "FeatureServiceSetSystemFeaturesResponse", + "FeatureServiceSetUserFeatureRequest", + "FeatureServiceSetUserFeaturesResponse", + "FeatureServiceSource", + "IdentityProviderServiceAny", + "IdentityProviderServiceAppleConfig", + "IdentityProviderServiceAutoLinkingOption", + "IdentityProviderServiceAzureADConfig", + "IdentityProviderServiceAzureADTenant", + "IdentityProviderServiceAzureADTenantType", + "IdentityProviderServiceConnectError", + "IdentityProviderServiceDetails", + "IdentityProviderServiceGenericOIDCConfig", + "IdentityProviderServiceGetIDPByIDRequest", + "IdentityProviderServiceGetIDPByIDResponse", + "IdentityProviderServiceGitHubConfig", + "IdentityProviderServiceGitHubEnterpriseServerConfig", + "IdentityProviderServiceGitLabConfig", + "IdentityProviderServiceGitLabSelfHostedConfig", + "IdentityProviderServiceGoogleConfig", + "IdentityProviderServiceIDP", + "IdentityProviderServiceIDPConfig", + "IdentityProviderServiceIDPState", + "IdentityProviderServiceIDPType", + "IdentityProviderServiceJWTConfig", + "IdentityProviderServiceLDAPAttributes", + "IdentityProviderServiceLDAPConfig", + "IdentityProviderServiceOAuthConfig", + "IdentityProviderServiceOptions", + "IdentityProviderServiceSAMLBinding", + "IdentityProviderServiceSAMLConfig", + "IdentityProviderServiceSAMLNameIDFormat", + "IdentityProviderServiceSAMLSignatureAlgorithm", + "InstanceServiceAddCustomDomainRequest", + "InstanceServiceAddCustomDomainResponse", + "InstanceServiceAddTrustedDomainRequest", + "InstanceServiceAddTrustedDomainResponse", + "InstanceServiceAny", + "InstanceServiceConnectError", + "InstanceServiceCustomDomain", + "InstanceServiceCustomDomainFilter", + "InstanceServiceCustomDomainsFilter", + "InstanceServiceDeleteInstanceRequest", + "InstanceServiceDeleteInstanceResponse", + "InstanceServiceDomainFieldName", + "InstanceServiceDomainFilter", + "InstanceServiceFieldName", + "InstanceServiceFilter", + "InstanceServiceGetInstanceRequest", + "InstanceServiceGetInstanceResponse", + "InstanceServiceInIDsFilter", + "InstanceServiceInstance", + "InstanceServiceListCustomDomainsRequest", + "InstanceServiceListCustomDomainsResponse", + "InstanceServiceListInstancesRequest", + "InstanceServiceListInstancesResponse", + "InstanceServiceListTrustedDomainsRequest", + "InstanceServiceListTrustedDomainsResponse", + "InstanceServicePaginationRequest", + "InstanceServicePaginationResponse", + "InstanceServiceRemoveCustomDomainRequest", + "InstanceServiceRemoveCustomDomainResponse", + "InstanceServiceRemoveTrustedDomainRequest", + "InstanceServiceRemoveTrustedDomainResponse", + "InstanceServiceState", + "InstanceServiceTextQueryMethod", + "InstanceServiceTrustedDomain", + "InstanceServiceTrustedDomainFieldName", + "InstanceServiceTrustedDomainFilter", + "InstanceServiceUpdateInstanceRequest", + "InstanceServiceUpdateInstanceResponse", + "InternalPermissionServiceAdministrator", + "InternalPermissionServiceAdministratorFieldName", + "InternalPermissionServiceAdministratorSearchFilter", + "InternalPermissionServiceAndFilter", + "InternalPermissionServiceAny", + "InternalPermissionServiceConnectError", + "InternalPermissionServiceCreateAdministratorRequest", + "InternalPermissionServiceCreateAdministratorResponse", + "InternalPermissionServiceDeleteAdministratorRequest", + "InternalPermissionServiceDeleteAdministratorResponse", + "InternalPermissionServiceIDFilter", + "InternalPermissionServiceInIDsFilter", + "InternalPermissionServiceListAdministratorsRequest", + "InternalPermissionServiceListAdministratorsResponse", + "InternalPermissionServiceNotFilter", + "InternalPermissionServiceOrFilter", + "InternalPermissionServiceOrganization", + "InternalPermissionServicePaginationRequest", + "InternalPermissionServicePaginationResponse", + "InternalPermissionServiceProject", + "InternalPermissionServiceProjectGrant", + "InternalPermissionServiceResourceFilter", + "InternalPermissionServiceResourceType", + "InternalPermissionServiceRoleFilter", + "InternalPermissionServiceTextFilterMethod", + "InternalPermissionServiceTimestampFilter", + "InternalPermissionServiceTimestampFilterMethod", + "InternalPermissionServiceUpdateAdministratorRequest", + "InternalPermissionServiceUpdateAdministratorResponse", + "InternalPermissionServiceUser", + "InternalPermissionServiceUserDisplayNameFilter", + "InternalPermissionServiceUserPreferredLoginNameFilter", + "OIDCServiceAny", + "OIDCServiceAuthRequest", + "OIDCServiceAuthorizationError", + "OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest", + "OIDCServiceConnectError", + "OIDCServiceCreateCallbackRequest", + "OIDCServiceCreateCallbackResponse", + "OIDCServiceDetails", + "OIDCServiceDeviceAuthorizationRequest", + "OIDCServiceErrorReason", + "OIDCServiceGetAuthRequestRequest", + "OIDCServiceGetAuthRequestResponse", + "OIDCServiceGetDeviceAuthorizationRequestRequest", + "OIDCServiceGetDeviceAuthorizationRequestResponse", + "OIDCServicePrompt", + "OIDCServiceSession", + "OrganizationServiceActivateOrganizationRequest", + "OrganizationServiceActivateOrganizationResponse", + "OrganizationServiceAddHumanUserRequest", + "OrganizationServiceAddOrganizationDomainRequest", + "OrganizationServiceAddOrganizationDomainResponse", + "OrganizationServiceAddOrganizationRequest", + "OrganizationServiceAddOrganizationResponse", + "OrganizationServiceAdmin", + "OrganizationServiceAny", + "OrganizationServiceConnectError", + "OrganizationServiceCreatedAdmin", + "OrganizationServiceDeactivateOrganizationRequest", + "OrganizationServiceDeactivateOrganizationResponse", + "OrganizationServiceDeleteOrganizationDomainRequest", + "OrganizationServiceDeleteOrganizationDomainResponse", + "OrganizationServiceDeleteOrganizationMetadataRequest", + "OrganizationServiceDeleteOrganizationMetadataResponse", + "OrganizationServiceDeleteOrganizationRequest", + "OrganizationServiceDeleteOrganizationResponse", + "OrganizationServiceDetails", + "OrganizationServiceDomain", + "OrganizationServiceDomainFieldName", + "OrganizationServiceDomainSearchFilter", + "OrganizationServiceDomainValidationType", + "OrganizationServiceGender", + "OrganizationServiceGenerateOrganizationDomainValidationRequest", + "OrganizationServiceGenerateOrganizationDomainValidationResponse", + "OrganizationServiceHashedPassword", + "OrganizationServiceIDPLink", + "OrganizationServiceListDetails", + "OrganizationServiceListOrganizationDomainsRequest", + "OrganizationServiceListOrganizationDomainsResponse", + "OrganizationServiceListOrganizationMetadataRequest", + "OrganizationServiceListOrganizationMetadataResponse", + "OrganizationServiceListOrganizationsRequest", + "OrganizationServiceListOrganizationsResponse", + "OrganizationServiceListQuery", + "OrganizationServiceMetadata", + "OrganizationServiceMetadataKeyFilter", + "OrganizationServiceMetadataSearchFilter", + "OrganizationServiceOrganization", + "OrganizationServiceOrganizationDomainQuery", + "OrganizationServiceOrganizationFieldName", + "OrganizationServiceOrganizationIDQuery", + "OrganizationServiceOrganizationNameQuery", + "OrganizationServiceOrganizationState", + "OrganizationServiceOrganizationStateQuery", + "OrganizationServicePaginationRequest", + "OrganizationServicePaginationResponse", + "OrganizationServicePassword", + "OrganizationServiceSearchQuery", + "OrganizationServiceSendEmailVerificationCode", + "OrganizationServiceSetHumanEmail", + "OrganizationServiceSetHumanPhone", + "OrganizationServiceSetHumanProfile", + "OrganizationServiceSetMetadataEntry", + "OrganizationServiceSetOrganizationMetadataRequest", + "OrganizationServiceSetOrganizationMetadataResponse", + "OrganizationServiceTextFilterMethod", + "OrganizationServiceTextQueryMethod", + "OrganizationServiceUpdateOrganizationRequest", + "OrganizationServiceUpdateOrganizationResponse", + "OrganizationServiceVerifyOrganizationDomainRequest", + "OrganizationServiceVerifyOrganizationDomainResponse", + "ProjectServiceActivateProjectGrantRequest", + "ProjectServiceActivateProjectGrantResponse", + "ProjectServiceActivateProjectRequest", + "ProjectServiceActivateProjectResponse", + "ProjectServiceAddProjectRoleRequest", + "ProjectServiceAddProjectRoleResponse", + "ProjectServiceAny", + "ProjectServiceConnectError", + "ProjectServiceCreateProjectGrantRequest", + "ProjectServiceCreateProjectGrantResponse", + "ProjectServiceCreateProjectRequest", + "ProjectServiceCreateProjectResponse", + "ProjectServiceDeactivateProjectGrantRequest", + "ProjectServiceDeactivateProjectGrantResponse", + "ProjectServiceDeactivateProjectRequest", + "ProjectServiceDeactivateProjectResponse", + "ProjectServiceDeleteProjectGrantRequest", + "ProjectServiceDeleteProjectGrantResponse", + "ProjectServiceDeleteProjectRequest", + "ProjectServiceDeleteProjectResponse", + "ProjectServiceGetProjectRequest", + "ProjectServiceGetProjectResponse", + "ProjectServiceGrantedProjectState", + "ProjectServiceIDFilter", + "ProjectServiceInIDsFilter", + "ProjectServiceListProjectGrantsRequest", + "ProjectServiceListProjectGrantsResponse", + "ProjectServiceListProjectRolesRequest", + "ProjectServiceListProjectRolesResponse", + "ProjectServiceListProjectsRequest", + "ProjectServiceListProjectsResponse", + "ProjectServicePaginationRequest", + "ProjectServicePaginationResponse", + "ProjectServicePrivateLabelingSetting", + "ProjectServiceProject", + "ProjectServiceProjectFieldName", + "ProjectServiceProjectGrant", + "ProjectServiceProjectGrantFieldName", + "ProjectServiceProjectGrantSearchFilter", + "ProjectServiceProjectGrantState", + "ProjectServiceProjectNameFilter", + "ProjectServiceProjectOrganizationIDFilter", + "ProjectServiceProjectRole", + "ProjectServiceProjectRoleDisplayNameFilter", + "ProjectServiceProjectRoleFieldName", + "ProjectServiceProjectRoleKeyFilter", + "ProjectServiceProjectRoleSearchFilter", + "ProjectServiceProjectSearchFilter", + "ProjectServiceProjectState", + "ProjectServiceRemoveProjectRoleRequest", + "ProjectServiceRemoveProjectRoleResponse", + "ProjectServiceTextFilterMethod", + "ProjectServiceType", + "ProjectServiceUpdateProjectGrantRequest", + "ProjectServiceUpdateProjectGrantResponse", + "ProjectServiceUpdateProjectRequest", + "ProjectServiceUpdateProjectResponse", + "ProjectServiceUpdateProjectRoleRequest", + "ProjectServiceUpdateProjectRoleResponse", + "SAMLServiceAny", + "SAMLServiceAuthorizationError", + "SAMLServiceConnectError", + "SAMLServiceCreateResponseRequest", + "SAMLServiceCreateResponseResponse", + "SAMLServiceDetails", + "SAMLServiceErrorReason", + "SAMLServiceGetSAMLRequestRequest", + "SAMLServiceGetSAMLRequestResponse", + "SAMLServicePostResponse", + "SAMLServiceSAMLRequest", + "SAMLServiceSession", + "SessionServiceAny", + "SessionServiceChallenges", + "SessionServiceCheckIDPIntent", + "SessionServiceCheckOTP", + "SessionServiceCheckPassword", + "SessionServiceCheckRecoveryCode", + "SessionServiceCheckTOTP", + "SessionServiceCheckUser", + "SessionServiceCheckWebAuthN", + "SessionServiceChecks", + "SessionServiceConnectError", + "SessionServiceCreateSessionRequest", + "SessionServiceCreateSessionResponse", + "SessionServiceCreationDateQuery", + "SessionServiceCreatorQuery", + "SessionServiceDeleteSessionRequest", + "SessionServiceDeleteSessionResponse", + "SessionServiceDetails", + "SessionServiceExpirationDateQuery", + "SessionServiceFactors", + "SessionServiceGetSessionRequest", + "SessionServiceGetSessionResponse", + "SessionServiceHeaderValues", + "SessionServiceIDsQuery", + "SessionServiceIntentFactor", + "SessionServiceListDetails", + "SessionServiceListQuery", + "SessionServiceListSessionsRequest", + "SessionServiceListSessionsResponse", + "SessionServiceOTPEmail", + "SessionServiceOTPFactor", + "SessionServiceOTPSMS", + "SessionServicePasswordFactor", + "SessionServiceRecoveryCodeFactor", + "SessionServiceRequestChallenges", + "SessionServiceSearchQuery", + "SessionServiceSendCode", + "SessionServiceSession", + "SessionServiceSessionFieldName", + "SessionServiceSetSessionRequest", + "SessionServiceSetSessionResponse", + "SessionServiceTOTPFactor", + "SessionServiceTimestampQueryMethod", + "SessionServiceUserAgent", + "SessionServiceUserAgentQuery", + "SessionServiceUserFactor", + "SessionServiceUserIDQuery", + "SessionServiceUserVerificationRequirement", + "SessionServiceWebAuthN", + "SessionServiceWebAuthNFactor", + "SettingsServiceAny", + "SettingsServiceAutoLinkingOption", + "SettingsServiceBrandingSettings", + "SettingsServiceConnectError", + "SettingsServiceDetails", + "SettingsServiceDomainSettings", + "SettingsServiceEmbeddedIframeSettings", + "SettingsServiceGetActiveIdentityProvidersRequest", + "SettingsServiceGetActiveIdentityProvidersResponse", + "SettingsServiceGetBrandingSettingsRequest", + "SettingsServiceGetBrandingSettingsResponse", + "SettingsServiceGetDomainSettingsRequest", + "SettingsServiceGetDomainSettingsResponse", + "SettingsServiceGetGeneralSettingsResponse", + "SettingsServiceGetHostedLoginTranslationRequest", + "SettingsServiceGetHostedLoginTranslationResponse", + "SettingsServiceGetLegalAndSupportSettingsRequest", + "SettingsServiceGetLegalAndSupportSettingsResponse", + "SettingsServiceGetLockoutSettingsRequest", + "SettingsServiceGetLockoutSettingsResponse", + "SettingsServiceGetLoginSettingsRequest", + "SettingsServiceGetLoginSettingsResponse", + "SettingsServiceGetPasswordComplexitySettingsRequest", + "SettingsServiceGetPasswordComplexitySettingsResponse", + "SettingsServiceGetPasswordExpirySettingsRequest", + "SettingsServiceGetPasswordExpirySettingsResponse", + "SettingsServiceGetSecuritySettingsResponse", + "SettingsServiceIdentityProvider", + "SettingsServiceIdentityProviderType", + "SettingsServiceLegalAndSupportSettings", + "SettingsServiceListDetails", + "SettingsServiceLockoutSettings", + "SettingsServiceLoginSettings", + "SettingsServiceMultiFactorType", + "SettingsServiceOptions", + "SettingsServicePasskeysType", + "SettingsServicePasswordComplexitySettings", + "SettingsServicePasswordExpirySettings", + "SettingsServiceRequestContext", + "SettingsServiceResourceOwnerType", + "SettingsServiceSecondFactorType", + "SettingsServiceSecuritySettings", + "SettingsServiceSetHostedLoginTranslationRequest", + "SettingsServiceSetHostedLoginTranslationResponse", + "SettingsServiceSetSecuritySettingsRequest", + "SettingsServiceSetSecuritySettingsResponse", + "SettingsServiceTheme", + "SettingsServiceThemeMode", + "UserServiceAccessTokenType", + "UserServiceAddHumanUserRequest", + "UserServiceAddHumanUserResponse", + "UserServiceAddIDPLinkRequest", + "UserServiceAddIDPLinkResponse", + "UserServiceAddKeyRequest", + "UserServiceAddKeyResponse", + "UserServiceAddOTPEmailRequest", + "UserServiceAddOTPEmailResponse", + "UserServiceAddOTPSMSRequest", + "UserServiceAddOTPSMSResponse", + "UserServiceAddPersonalAccessTokenRequest", + "UserServiceAddPersonalAccessTokenResponse", + "UserServiceAddSecretRequest", + "UserServiceAddSecretResponse", + "UserServiceAndQuery", + "UserServiceAny", + "UserServiceAuthFactor", + "UserServiceAuthFactorState", + "UserServiceAuthFactorU2F", + "UserServiceAuthFactors", + "UserServiceAuthenticationMethodType", + "UserServiceByteFilterMethod", + "UserServiceConnectError", + "UserServiceCreateInviteCodeRequest", + "UserServiceCreateInviteCodeResponse", + "UserServiceCreatePasskeyRegistrationLinkRequest", + "UserServiceCreatePasskeyRegistrationLinkResponse", + "UserServiceCreateUserRequest", + "UserServiceCreateUserResponse", + "UserServiceDeactivateUserRequest", + "UserServiceDeactivateUserResponse", + "UserServiceDeleteUserMetadataRequest", + "UserServiceDeleteUserMetadataResponse", + "UserServiceDeleteUserRequest", + "UserServiceDeleteUserResponse", + "UserServiceDetails", + "UserServiceDisplayNameQuery", + "UserServiceDomainQuery", + "UserServiceEmailQuery", + "UserServiceFirstNameQuery", + "UserServiceFormData", + "UserServiceGender", + "UserServiceGenerateRecoveryCodesRequest", + "UserServiceGenerateRecoveryCodesResponse", + "UserServiceGetUserByIDRequest", + "UserServiceGetUserByIDResponse", + "UserServiceHashedPassword", + "UserServiceHuman", + "UserServiceHumanEmail", + "UserServiceHumanMFAInitSkippedRequest", + "UserServiceHumanMFAInitSkippedResponse", + "UserServiceHumanPhone", + "UserServiceHumanProfile", + "UserServiceHumanUser", + "UserServiceIDFilter", + "UserServiceIDPInformation", + "UserServiceIDPIntent", + "UserServiceIDPLDAPAccessInformation", + "UserServiceIDPLink", + "UserServiceIDPOAuthAccessInformation", + "UserServiceIDPSAMLAccessInformation", + "UserServiceInUserEmailsQuery", + "UserServiceInUserIDQuery", + "UserServiceKey", + "UserServiceKeyFieldName", + "UserServiceKeysSearchFilter", + "UserServiceLDAPCredentials", + "UserServiceLastNameQuery", + "UserServiceListAuthenticationFactorsRequest", + "UserServiceListAuthenticationFactorsResponse", + "UserServiceListAuthenticationMethodTypesRequest", + "UserServiceListAuthenticationMethodTypesResponse", + "UserServiceListDetails", + "UserServiceListIDPLinksRequest", + "UserServiceListIDPLinksResponse", + "UserServiceListKeysRequest", + "UserServiceListKeysResponse", + "UserServiceListPasskeysRequest", + "UserServiceListPasskeysResponse", + "UserServiceListPersonalAccessTokensRequest", + "UserServiceListPersonalAccessTokensResponse", + "UserServiceListQuery", + "UserServiceListUserMetadataRequest", + "UserServiceListUserMetadataResponse", + "UserServiceListUsersRequest", + "UserServiceListUsersResponse", + "UserServiceLockUserRequest", + "UserServiceLockUserResponse", + "UserServiceLoginNameQuery", + "UserServiceMachine", + "UserServiceMachineUser", + "UserServiceMetadata", + "UserServiceMetadataKeyFilter", + "UserServiceMetadataSearchFilter", + "UserServiceMetadataValueFilter", + "UserServiceNickNameQuery", + "UserServiceNotQuery", + "UserServiceNotificationType", + "UserServiceOrQuery", + "UserServiceOrganization", + "UserServiceOrganizationIdQuery", + "UserServicePaginationRequest", + "UserServicePaginationResponse", + "UserServicePasskey", + "UserServicePasskeyAuthenticator", + "UserServicePasskeyRegistrationCode", + "UserServicePassword", + "UserServicePasswordResetRequest", + "UserServicePasswordResetResponse", + "UserServicePersonalAccessToken", + "UserServicePersonalAccessTokenFieldName", + "UserServicePersonalAccessTokensSearchFilter", + "UserServicePhoneQuery", + "UserServiceProfile", + "UserServiceReactivateUserRequest", + "UserServiceReactivateUserResponse", + "UserServiceRedirectURLs", + "UserServiceRegisterPasskeyRequest", + "UserServiceRegisterPasskeyResponse", + "UserServiceRegisterTOTPRequest", + "UserServiceRegisterTOTPResponse", + "UserServiceRegisterU2FRequest", + "UserServiceRegisterU2FResponse", + "UserServiceRemoveIDPLinkRequest", + "UserServiceRemoveIDPLinkResponse", + "UserServiceRemoveKeyRequest", + "UserServiceRemoveKeyResponse", + "UserServiceRemoveOTPEmailRequest", + "UserServiceRemoveOTPEmailResponse", + "UserServiceRemoveOTPSMSRequest", + "UserServiceRemoveOTPSMSResponse", + "UserServiceRemovePasskeyRequest", + "UserServiceRemovePasskeyResponse", + "UserServiceRemovePersonalAccessTokenRequest", + "UserServiceRemovePersonalAccessTokenResponse", + "UserServiceRemovePhoneRequest", + "UserServiceRemovePhoneResponse", + "UserServiceRemoveRecoveryCodesRequest", + "UserServiceRemoveRecoveryCodesResponse", + "UserServiceRemoveSecretRequest", + "UserServiceRemoveSecretResponse", + "UserServiceRemoveTOTPRequest", + "UserServiceRemoveTOTPResponse", + "UserServiceRemoveU2FRequest", + "UserServiceRemoveU2FResponse", + "UserServiceResendEmailCodeRequest", + "UserServiceResendEmailCodeResponse", + "UserServiceResendInviteCodeRequest", + "UserServiceResendInviteCodeResponse", + "UserServiceResendPhoneCodeRequest", + "UserServiceResendPhoneCodeResponse", + "UserServiceRetrieveIdentityProviderIntentRequest", + "UserServiceRetrieveIdentityProviderIntentResponse", + "UserServiceSearchQuery", + "UserServiceSendEmailCodeRequest", + "UserServiceSendEmailCodeResponse", + "UserServiceSendEmailVerificationCode", + "UserServiceSendInviteCode", + "UserServiceSendPasskeyRegistrationLink", + "UserServiceSendPasswordResetLink", + "UserServiceSetEmailRequest", + "UserServiceSetEmailResponse", + "UserServiceSetHumanEmail", + "UserServiceSetHumanPhone", + "UserServiceSetHumanProfile", + "UserServiceSetMetadataEntry", + "UserServiceSetPassword", + "UserServiceSetPasswordRequest", + "UserServiceSetPasswordResponse", + "UserServiceSetPhoneRequest", + "UserServiceSetPhoneResponse", + "UserServiceSetUserMetadataRequest", + "UserServiceSetUserMetadataResponse", + "UserServiceStartIdentityProviderIntentRequest", + "UserServiceStartIdentityProviderIntentResponse", + "UserServiceStateQuery", + "UserServiceTextFilterMethod", + "UserServiceTextQueryMethod", + "UserServiceTimestampFilter", + "UserServiceTimestampFilterMethod", + "UserServiceType", + "UserServiceTypeQuery", + "UserServiceUnlockUserRequest", + "UserServiceUnlockUserResponse", + "UserServiceUpdateHumanUserRequest", + "UserServiceUpdateHumanUserResponse", + "UserServiceUpdateUserRequest", + "UserServiceUpdateUserResponse", + "UserServiceUser", + "UserServiceUserFieldName", + "UserServiceUserNameQuery", + "UserServiceUserState", + "UserServiceVerifyEmailRequest", + "UserServiceVerifyEmailResponse", + "UserServiceVerifyInviteCodeRequest", + "UserServiceVerifyInviteCodeResponse", + "UserServiceVerifyPasskeyRegistrationRequest", + "UserServiceVerifyPasskeyRegistrationResponse", + "UserServiceVerifyPhoneRequest", + "UserServiceVerifyPhoneResponse", + "UserServiceVerifyTOTPRegistrationRequest", + "UserServiceVerifyTOTPRegistrationResponse", + "UserServiceVerifyU2FRegistrationRequest", + "UserServiceVerifyU2FRegistrationResponse", + "WebKeyServiceActivateWebKeyRequest", + "WebKeyServiceActivateWebKeyResponse", + "WebKeyServiceAny", + "WebKeyServiceConnectError", + "WebKeyServiceCreateWebKeyRequest", + "WebKeyServiceCreateWebKeyResponse", + "WebKeyServiceDeleteWebKeyRequest", + "WebKeyServiceDeleteWebKeyResponse", + "WebKeyServiceECDSA", + "WebKeyServiceECDSACurve", + "WebKeyServiceListWebKeysResponse", + "WebKeyServiceRSA", + "WebKeyServiceRSABits", + "WebKeyServiceRSAHasher", + "WebKeyServiceState", + "WebKeyServiceWebKey", +] + +# import apis into sdk package +from zitadel_client.api.action_service_api import ActionServiceApi as ActionServiceApi +from zitadel_client.api.application_service_api import ( + ApplicationServiceApi as ApplicationServiceApi, +) +from zitadel_client.api.authorization_service_api import ( + AuthorizationServiceApi as AuthorizationServiceApi, +) +from zitadel_client.api.beta_action_service_api import ( + BetaActionServiceApi as BetaActionServiceApi, +) +from zitadel_client.api.beta_app_service_api import ( + BetaAppServiceApi as BetaAppServiceApi, +) +from zitadel_client.api.beta_authorization_service_api import ( + BetaAuthorizationServiceApi as BetaAuthorizationServiceApi, +) +from zitadel_client.api.beta_feature_service_api import ( + BetaFeatureServiceApi as BetaFeatureServiceApi, +) +from zitadel_client.api.beta_instance_service_api import ( + BetaInstanceServiceApi as BetaInstanceServiceApi, +) +from zitadel_client.api.beta_internal_permission_service_api import ( + BetaInternalPermissionServiceApi as BetaInternalPermissionServiceApi, +) +from zitadel_client.api.beta_oidc_service_api import ( + BetaOIDCServiceApi as BetaOIDCServiceApi, +) +from zitadel_client.api.beta_organization_service_api import ( + BetaOrganizationServiceApi as BetaOrganizationServiceApi, +) +from zitadel_client.api.beta_project_service_api import ( + BetaProjectServiceApi as BetaProjectServiceApi, +) +from zitadel_client.api.beta_session_service_api import ( + BetaSessionServiceApi as BetaSessionServiceApi, +) +from zitadel_client.api.beta_settings_service_api import ( + BetaSettingsServiceApi as BetaSettingsServiceApi, +) +from zitadel_client.api.beta_telemetry_service_api import ( + BetaTelemetryServiceApi as BetaTelemetryServiceApi, +) +from zitadel_client.api.beta_user_service_api import ( + BetaUserServiceApi as BetaUserServiceApi, +) +from zitadel_client.api.beta_web_key_service_api import ( + BetaWebKeyServiceApi as BetaWebKeyServiceApi, +) +from zitadel_client.api.feature_service_api import ( + FeatureServiceApi as FeatureServiceApi, +) +from zitadel_client.api.identity_provider_service_api import ( + IdentityProviderServiceApi as IdentityProviderServiceApi, +) +from zitadel_client.api.instance_service_api import ( + InstanceServiceApi as InstanceServiceApi, +) +from zitadel_client.api.internal_permission_service_api import ( + InternalPermissionServiceApi as InternalPermissionServiceApi, +) +from zitadel_client.api.oidc_service_api import OIDCServiceApi as OIDCServiceApi +from zitadel_client.api.organization_service_api import ( + OrganizationServiceApi as OrganizationServiceApi, +) +from zitadel_client.api.project_service_api import ( + ProjectServiceApi as ProjectServiceApi, +) +from zitadel_client.api.saml_service_api import SAMLServiceApi as SAMLServiceApi +from zitadel_client.api.session_service_api import ( + SessionServiceApi as SessionServiceApi, +) +from zitadel_client.api.settings_service_api import ( + SettingsServiceApi as SettingsServiceApi, +) +from zitadel_client.api.user_service_api import UserServiceApi as UserServiceApi +from zitadel_client.api.web_key_service_api import WebKeyServiceApi as WebKeyServiceApi + +# import ApiClient +from zitadel_client.api_client import ApiClient as ApiClient +from zitadel_client.auth.authenticator import Authenticator as Authenticator +from zitadel_client.zitadel import Zitadel as Zitadel +from zitadel_client.configuration import Configuration as Configuration +from zitadel_client.transport_options import TransportOptions as TransportOptions +from zitadel_client.server_configuration import ( + ServerConfiguration as ServerConfiguration, +) +from zitadel_client.server_configuration import ServerVariable as ServerVariable +from zitadel_client.errors import ZitadelException as ZitadelException +from zitadel_client.errors import ApiException as ApiException +from zitadel_client.errors import ClientException as ClientException +from zitadel_client.errors import ServerException as ServerException +from zitadel_client.errors import BadRequestException as BadRequestException +from zitadel_client.errors import UnauthorizedException as UnauthorizedException +from zitadel_client.errors import ForbiddenException as ForbiddenException +from zitadel_client.errors import NotFoundException as NotFoundException +from zitadel_client.errors import ConflictException as ConflictException +from zitadel_client.errors import ( + UnprocessableEntityException as UnprocessableEntityException, +) +from zitadel_client.errors import ( + InternalServerErrorException as InternalServerErrorException, +) +from zitadel_client.errors import NetworkException as NetworkException +from zitadel_client.errors import NetworkTimeoutException as NetworkTimeoutException +from zitadel_client.errors import SerializationException as SerializationException +from zitadel_client.errors import OAuth2ServerException as OAuth2ServerException +from zitadel_client.errors import OAuth2TokenException as OAuth2TokenException + +# import models into sdk package +from zitadel_client.models.action_service_activate_public_key_request import ( + ActionServiceActivatePublicKeyRequest as ActionServiceActivatePublicKeyRequest, +) +from zitadel_client.models.action_service_activate_public_key_response import ( + ActionServiceActivatePublicKeyResponse as ActionServiceActivatePublicKeyResponse, +) +from zitadel_client.models.action_service_add_public_key_request import ( + ActionServiceAddPublicKeyRequest as ActionServiceAddPublicKeyRequest, +) +from zitadel_client.models.action_service_add_public_key_response import ( + ActionServiceAddPublicKeyResponse as ActionServiceAddPublicKeyResponse, +) +from zitadel_client.models.action_service_any import ( + ActionServiceAny as ActionServiceAny, +) +from zitadel_client.models.action_service_condition import ( + ActionServiceCondition as ActionServiceCondition, +) +from zitadel_client.models.action_service_connect_error import ( + ActionServiceConnectError as ActionServiceConnectError, +) +from zitadel_client.models.action_service_create_target_request import ( + ActionServiceCreateTargetRequest as ActionServiceCreateTargetRequest, +) +from zitadel_client.models.action_service_create_target_response import ( + ActionServiceCreateTargetResponse as ActionServiceCreateTargetResponse, +) +from zitadel_client.models.action_service_deactivate_public_key_request import ( + ActionServiceDeactivatePublicKeyRequest as ActionServiceDeactivatePublicKeyRequest, +) +from zitadel_client.models.action_service_deactivate_public_key_response import ( + ActionServiceDeactivatePublicKeyResponse as ActionServiceDeactivatePublicKeyResponse, +) +from zitadel_client.models.action_service_delete_target_request import ( + ActionServiceDeleteTargetRequest as ActionServiceDeleteTargetRequest, +) +from zitadel_client.models.action_service_delete_target_response import ( + ActionServiceDeleteTargetResponse as ActionServiceDeleteTargetResponse, +) +from zitadel_client.models.action_service_event_execution import ( + ActionServiceEventExecution as ActionServiceEventExecution, +) +from zitadel_client.models.action_service_execution import ( + ActionServiceExecution as ActionServiceExecution, +) +from zitadel_client.models.action_service_execution_field_name import ( + ActionServiceExecutionFieldName as ActionServiceExecutionFieldName, +) +from zitadel_client.models.action_service_execution_search_filter import ( + ActionServiceExecutionSearchFilter as ActionServiceExecutionSearchFilter, +) +from zitadel_client.models.action_service_execution_type import ( + ActionServiceExecutionType as ActionServiceExecutionType, +) +from zitadel_client.models.action_service_execution_type_filter import ( + ActionServiceExecutionTypeFilter as ActionServiceExecutionTypeFilter, +) +from zitadel_client.models.action_service_function_execution import ( + ActionServiceFunctionExecution as ActionServiceFunctionExecution, +) +from zitadel_client.models.action_service_get_target_request import ( + ActionServiceGetTargetRequest as ActionServiceGetTargetRequest, +) +from zitadel_client.models.action_service_get_target_response import ( + ActionServiceGetTargetResponse as ActionServiceGetTargetResponse, +) +from zitadel_client.models.action_service_in_conditions_filter import ( + ActionServiceInConditionsFilter as ActionServiceInConditionsFilter, +) +from zitadel_client.models.action_service_in_ids_filter import ( + ActionServiceInIDsFilter as ActionServiceInIDsFilter, +) +from zitadel_client.models.action_service_in_target_ids_filter import ( + ActionServiceInTargetIDsFilter as ActionServiceInTargetIDsFilter, +) +from zitadel_client.models.action_service_list_execution_functions_response import ( + ActionServiceListExecutionFunctionsResponse as ActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.action_service_list_execution_methods_response import ( + ActionServiceListExecutionMethodsResponse as ActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.action_service_list_execution_services_response import ( + ActionServiceListExecutionServicesResponse as ActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.action_service_list_executions_request import ( + ActionServiceListExecutionsRequest as ActionServiceListExecutionsRequest, +) +from zitadel_client.models.action_service_list_executions_response import ( + ActionServiceListExecutionsResponse as ActionServiceListExecutionsResponse, +) +from zitadel_client.models.action_service_list_public_keys_request import ( + ActionServiceListPublicKeysRequest as ActionServiceListPublicKeysRequest, +) +from zitadel_client.models.action_service_list_public_keys_response import ( + ActionServiceListPublicKeysResponse as ActionServiceListPublicKeysResponse, +) +from zitadel_client.models.action_service_list_targets_request import ( + ActionServiceListTargetsRequest as ActionServiceListTargetsRequest, +) +from zitadel_client.models.action_service_list_targets_response import ( + ActionServiceListTargetsResponse as ActionServiceListTargetsResponse, +) +from zitadel_client.models.action_service_pagination_request import ( + ActionServicePaginationRequest as ActionServicePaginationRequest, +) +from zitadel_client.models.action_service_pagination_response import ( + ActionServicePaginationResponse as ActionServicePaginationResponse, +) +from zitadel_client.models.action_service_payload_type import ( + ActionServicePayloadType as ActionServicePayloadType, +) +from zitadel_client.models.action_service_public_key import ( + ActionServicePublicKey as ActionServicePublicKey, +) +from zitadel_client.models.action_service_public_key_field_name import ( + ActionServicePublicKeyFieldName as ActionServicePublicKeyFieldName, +) +from zitadel_client.models.action_service_public_key_search_filter import ( + ActionServicePublicKeySearchFilter as ActionServicePublicKeySearchFilter, +) +from zitadel_client.models.action_service_rest_call import ( + ActionServiceRESTCall as ActionServiceRESTCall, +) +from zitadel_client.models.action_service_rest_webhook import ( + ActionServiceRESTWebhook as ActionServiceRESTWebhook, +) +from zitadel_client.models.action_service_remove_public_key_request import ( + ActionServiceRemovePublicKeyRequest as ActionServiceRemovePublicKeyRequest, +) +from zitadel_client.models.action_service_remove_public_key_response import ( + ActionServiceRemovePublicKeyResponse as ActionServiceRemovePublicKeyResponse, +) +from zitadel_client.models.action_service_request_execution import ( + ActionServiceRequestExecution as ActionServiceRequestExecution, +) +from zitadel_client.models.action_service_response_execution import ( + ActionServiceResponseExecution as ActionServiceResponseExecution, +) +from zitadel_client.models.action_service_set_execution_request import ( + ActionServiceSetExecutionRequest as ActionServiceSetExecutionRequest, +) +from zitadel_client.models.action_service_set_execution_response import ( + ActionServiceSetExecutionResponse as ActionServiceSetExecutionResponse, +) +from zitadel_client.models.action_service_target import ( + ActionServiceTarget as ActionServiceTarget, +) +from zitadel_client.models.action_service_target_field_name import ( + ActionServiceTargetFieldName as ActionServiceTargetFieldName, +) +from zitadel_client.models.action_service_target_filter import ( + ActionServiceTargetFilter as ActionServiceTargetFilter, +) +from zitadel_client.models.action_service_target_name_filter import ( + ActionServiceTargetNameFilter as ActionServiceTargetNameFilter, +) +from zitadel_client.models.action_service_target_search_filter import ( + ActionServiceTargetSearchFilter as ActionServiceTargetSearchFilter, +) +from zitadel_client.models.action_service_text_filter_method import ( + ActionServiceTextFilterMethod as ActionServiceTextFilterMethod, +) +from zitadel_client.models.action_service_timestamp_filter import ( + ActionServiceTimestampFilter as ActionServiceTimestampFilter, +) +from zitadel_client.models.action_service_timestamp_filter_method import ( + ActionServiceTimestampFilterMethod as ActionServiceTimestampFilterMethod, +) +from zitadel_client.models.action_service_update_target_request import ( + ActionServiceUpdateTargetRequest as ActionServiceUpdateTargetRequest, +) +from zitadel_client.models.action_service_update_target_response import ( + ActionServiceUpdateTargetResponse as ActionServiceUpdateTargetResponse, +) +from zitadel_client.models.application_service_api_auth_method_type import ( + ApplicationServiceAPIAuthMethodType as ApplicationServiceAPIAuthMethodType, +) +from zitadel_client.models.application_service_api_configuration import ( + ApplicationServiceAPIConfiguration as ApplicationServiceAPIConfiguration, +) +from zitadel_client.models.application_service_any import ( + ApplicationServiceAny as ApplicationServiceAny, +) +from zitadel_client.models.application_service_application import ( + ApplicationServiceApplication as ApplicationServiceApplication, +) +from zitadel_client.models.application_service_application_key import ( + ApplicationServiceApplicationKey as ApplicationServiceApplicationKey, +) +from zitadel_client.models.application_service_application_key_application_id_filter import ( + ApplicationServiceApplicationKeyApplicationIDFilter as ApplicationServiceApplicationKeyApplicationIDFilter, +) +from zitadel_client.models.application_service_application_key_organization_id_filter import ( + ApplicationServiceApplicationKeyOrganizationIDFilter as ApplicationServiceApplicationKeyOrganizationIDFilter, +) +from zitadel_client.models.application_service_application_key_project_id_filter import ( + ApplicationServiceApplicationKeyProjectIDFilter as ApplicationServiceApplicationKeyProjectIDFilter, +) +from zitadel_client.models.application_service_application_key_search_filter import ( + ApplicationServiceApplicationKeySearchFilter as ApplicationServiceApplicationKeySearchFilter, +) +from zitadel_client.models.application_service_application_keys_sorting import ( + ApplicationServiceApplicationKeysSorting as ApplicationServiceApplicationKeysSorting, +) +from zitadel_client.models.application_service_application_name_filter import ( + ApplicationServiceApplicationNameFilter as ApplicationServiceApplicationNameFilter, +) +from zitadel_client.models.application_service_application_search_filter import ( + ApplicationServiceApplicationSearchFilter as ApplicationServiceApplicationSearchFilter, +) +from zitadel_client.models.application_service_application_sorting import ( + ApplicationServiceApplicationSorting as ApplicationServiceApplicationSorting, +) +from zitadel_client.models.application_service_application_state import ( + ApplicationServiceApplicationState as ApplicationServiceApplicationState, +) +from zitadel_client.models.application_service_application_type import ( + ApplicationServiceApplicationType as ApplicationServiceApplicationType, +) +from zitadel_client.models.application_service_client_id_filter import ( + ApplicationServiceClientIDFilter as ApplicationServiceClientIDFilter, +) +from zitadel_client.models.application_service_connect_error import ( + ApplicationServiceConnectError as ApplicationServiceConnectError, +) +from zitadel_client.models.application_service_create_api_application_request import ( + ApplicationServiceCreateAPIApplicationRequest as ApplicationServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.application_service_create_api_application_response import ( + ApplicationServiceCreateAPIApplicationResponse as ApplicationServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.application_service_create_application_key_request import ( + ApplicationServiceCreateApplicationKeyRequest as ApplicationServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.application_service_create_application_key_response import ( + ApplicationServiceCreateApplicationKeyResponse as ApplicationServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.application_service_create_application_request import ( + ApplicationServiceCreateApplicationRequest as ApplicationServiceCreateApplicationRequest, +) +from zitadel_client.models.application_service_create_application_response import ( + ApplicationServiceCreateApplicationResponse as ApplicationServiceCreateApplicationResponse, +) +from zitadel_client.models.application_service_create_oidc_application_request import ( + ApplicationServiceCreateOIDCApplicationRequest as ApplicationServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.application_service_create_oidc_application_response import ( + ApplicationServiceCreateOIDCApplicationResponse as ApplicationServiceCreateOIDCApplicationResponse, +) +from zitadel_client.models.application_service_create_saml_application_request import ( + ApplicationServiceCreateSAMLApplicationRequest as ApplicationServiceCreateSAMLApplicationRequest, +) +from zitadel_client.models.application_service_deactivate_application_request import ( + ApplicationServiceDeactivateApplicationRequest as ApplicationServiceDeactivateApplicationRequest, +) +from zitadel_client.models.application_service_deactivate_application_response import ( + ApplicationServiceDeactivateApplicationResponse as ApplicationServiceDeactivateApplicationResponse, +) +from zitadel_client.models.application_service_delete_application_key_request import ( + ApplicationServiceDeleteApplicationKeyRequest as ApplicationServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.application_service_delete_application_key_response import ( + ApplicationServiceDeleteApplicationKeyResponse as ApplicationServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.application_service_delete_application_request import ( + ApplicationServiceDeleteApplicationRequest as ApplicationServiceDeleteApplicationRequest, +) +from zitadel_client.models.application_service_delete_application_response import ( + ApplicationServiceDeleteApplicationResponse as ApplicationServiceDeleteApplicationResponse, +) +from zitadel_client.models.application_service_entity_id_filter import ( + ApplicationServiceEntityIDFilter as ApplicationServiceEntityIDFilter, +) +from zitadel_client.models.application_service_generate_client_secret_request import ( + ApplicationServiceGenerateClientSecretRequest as ApplicationServiceGenerateClientSecretRequest, +) +from zitadel_client.models.application_service_generate_client_secret_response import ( + ApplicationServiceGenerateClientSecretResponse as ApplicationServiceGenerateClientSecretResponse, +) +from zitadel_client.models.application_service_get_application_key_request import ( + ApplicationServiceGetApplicationKeyRequest as ApplicationServiceGetApplicationKeyRequest, +) +from zitadel_client.models.application_service_get_application_key_response import ( + ApplicationServiceGetApplicationKeyResponse as ApplicationServiceGetApplicationKeyResponse, +) +from zitadel_client.models.application_service_get_application_request import ( + ApplicationServiceGetApplicationRequest as ApplicationServiceGetApplicationRequest, +) +from zitadel_client.models.application_service_get_application_response import ( + ApplicationServiceGetApplicationResponse as ApplicationServiceGetApplicationResponse, +) +from zitadel_client.models.application_service_list_application_keys_request import ( + ApplicationServiceListApplicationKeysRequest as ApplicationServiceListApplicationKeysRequest, +) +from zitadel_client.models.application_service_list_application_keys_response import ( + ApplicationServiceListApplicationKeysResponse as ApplicationServiceListApplicationKeysResponse, +) +from zitadel_client.models.application_service_list_applications_request import ( + ApplicationServiceListApplicationsRequest as ApplicationServiceListApplicationsRequest, +) +from zitadel_client.models.application_service_list_applications_response import ( + ApplicationServiceListApplicationsResponse as ApplicationServiceListApplicationsResponse, +) +from zitadel_client.models.application_service_login_v2 import ( + ApplicationServiceLoginV2 as ApplicationServiceLoginV2, +) +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion as ApplicationServiceLoginVersion, +) +from zitadel_client.models.application_service_oidc_application_type import ( + ApplicationServiceOIDCApplicationType as ApplicationServiceOIDCApplicationType, +) +from zitadel_client.models.application_service_oidc_auth_method_type import ( + ApplicationServiceOIDCAuthMethodType as ApplicationServiceOIDCAuthMethodType, +) +from zitadel_client.models.application_service_oidc_configuration import ( + ApplicationServiceOIDCConfiguration as ApplicationServiceOIDCConfiguration, +) +from zitadel_client.models.application_service_oidc_grant_type import ( + ApplicationServiceOIDCGrantType as ApplicationServiceOIDCGrantType, +) +from zitadel_client.models.application_service_oidc_localized_message import ( + ApplicationServiceOIDCLocalizedMessage as ApplicationServiceOIDCLocalizedMessage, +) +from zitadel_client.models.application_service_oidc_response_type import ( + ApplicationServiceOIDCResponseType as ApplicationServiceOIDCResponseType, +) +from zitadel_client.models.application_service_oidc_token_type import ( + ApplicationServiceOIDCTokenType as ApplicationServiceOIDCTokenType, +) +from zitadel_client.models.application_service_oidc_version import ( + ApplicationServiceOIDCVersion as ApplicationServiceOIDCVersion, +) +from zitadel_client.models.application_service_pagination_request import ( + ApplicationServicePaginationRequest as ApplicationServicePaginationRequest, +) +from zitadel_client.models.application_service_pagination_response import ( + ApplicationServicePaginationResponse as ApplicationServicePaginationResponse, +) +from zitadel_client.models.application_service_project_id_filter import ( + ApplicationServiceProjectIDFilter as ApplicationServiceProjectIDFilter, +) +from zitadel_client.models.application_service_reactivate_application_request import ( + ApplicationServiceReactivateApplicationRequest as ApplicationServiceReactivateApplicationRequest, +) +from zitadel_client.models.application_service_reactivate_application_response import ( + ApplicationServiceReactivateApplicationResponse as ApplicationServiceReactivateApplicationResponse, +) +from zitadel_client.models.application_service_saml_configuration import ( + ApplicationServiceSAMLConfiguration as ApplicationServiceSAMLConfiguration, +) +from zitadel_client.models.application_service_text_filter_method import ( + ApplicationServiceTextFilterMethod as ApplicationServiceTextFilterMethod, +) +from zitadel_client.models.application_service_update_api_application_configuration_request import ( + ApplicationServiceUpdateAPIApplicationConfigurationRequest as ApplicationServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_application_request import ( + ApplicationServiceUpdateApplicationRequest as ApplicationServiceUpdateApplicationRequest, +) +from zitadel_client.models.application_service_update_application_response import ( + ApplicationServiceUpdateApplicationResponse as ApplicationServiceUpdateApplicationResponse, +) +from zitadel_client.models.application_service_update_oidc_application_configuration_request import ( + ApplicationServiceUpdateOIDCApplicationConfigurationRequest as ApplicationServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_saml_application_configuration_request import ( + ApplicationServiceUpdateSAMLApplicationConfigurationRequest as ApplicationServiceUpdateSAMLApplicationConfigurationRequest, +) +from zitadel_client.models.authorization_service_activate_authorization_request import ( + AuthorizationServiceActivateAuthorizationRequest as AuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_activate_authorization_response import ( + AuthorizationServiceActivateAuthorizationResponse as AuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_any import ( + AuthorizationServiceAny as AuthorizationServiceAny, +) +from zitadel_client.models.authorization_service_authorization import ( + AuthorizationServiceAuthorization as AuthorizationServiceAuthorization, +) +from zitadel_client.models.authorization_service_authorization_field_name import ( + AuthorizationServiceAuthorizationFieldName as AuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.authorization_service_authorizations_search_filter import ( + AuthorizationServiceAuthorizationsSearchFilter as AuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.authorization_service_connect_error import ( + AuthorizationServiceConnectError as AuthorizationServiceConnectError, +) +from zitadel_client.models.authorization_service_create_authorization_request import ( + AuthorizationServiceCreateAuthorizationRequest as AuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_create_authorization_response import ( + AuthorizationServiceCreateAuthorizationResponse as AuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_deactivate_authorization_request import ( + AuthorizationServiceDeactivateAuthorizationRequest as AuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_deactivate_authorization_response import ( + AuthorizationServiceDeactivateAuthorizationResponse as AuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_delete_authorization_request import ( + AuthorizationServiceDeleteAuthorizationRequest as AuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.authorization_service_delete_authorization_response import ( + AuthorizationServiceDeleteAuthorizationResponse as AuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.authorization_service_id_filter import ( + AuthorizationServiceIDFilter as AuthorizationServiceIDFilter, +) +from zitadel_client.models.authorization_service_in_ids_filter import ( + AuthorizationServiceInIDsFilter as AuthorizationServiceInIDsFilter, +) +from zitadel_client.models.authorization_service_list_authorizations_request import ( + AuthorizationServiceListAuthorizationsRequest as AuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.authorization_service_list_authorizations_response import ( + AuthorizationServiceListAuthorizationsResponse as AuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.authorization_service_organization import ( + AuthorizationServiceOrganization as AuthorizationServiceOrganization, +) +from zitadel_client.models.authorization_service_pagination_request import ( + AuthorizationServicePaginationRequest as AuthorizationServicePaginationRequest, +) +from zitadel_client.models.authorization_service_pagination_response import ( + AuthorizationServicePaginationResponse as AuthorizationServicePaginationResponse, +) +from zitadel_client.models.authorization_service_project import ( + AuthorizationServiceProject as AuthorizationServiceProject, +) +from zitadel_client.models.authorization_service_project_name_query import ( + AuthorizationServiceProjectNameQuery as AuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.authorization_service_role import ( + AuthorizationServiceRole as AuthorizationServiceRole, +) +from zitadel_client.models.authorization_service_role_key_query import ( + AuthorizationServiceRoleKeyQuery as AuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.authorization_service_state import ( + AuthorizationServiceState as AuthorizationServiceState, +) +from zitadel_client.models.authorization_service_state_query import ( + AuthorizationServiceStateQuery as AuthorizationServiceStateQuery, +) +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod as AuthorizationServiceTextFilterMethod, +) +from zitadel_client.models.authorization_service_update_authorization_request import ( + AuthorizationServiceUpdateAuthorizationRequest as AuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_update_authorization_response import ( + AuthorizationServiceUpdateAuthorizationResponse as AuthorizationServiceUpdateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_user import ( + AuthorizationServiceUser as AuthorizationServiceUser, +) +from zitadel_client.models.authorization_service_user_display_name_query import ( + AuthorizationServiceUserDisplayNameQuery as AuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.authorization_service_user_preferred_login_name_query import ( + AuthorizationServiceUserPreferredLoginNameQuery as AuthorizationServiceUserPreferredLoginNameQuery, +) +from zitadel_client.models.beta_action_service_any import ( + BetaActionServiceAny as BetaActionServiceAny, +) +from zitadel_client.models.beta_action_service_condition import ( + BetaActionServiceCondition as BetaActionServiceCondition, +) +from zitadel_client.models.beta_action_service_connect_error import ( + BetaActionServiceConnectError as BetaActionServiceConnectError, +) +from zitadel_client.models.beta_action_service_create_target_request import ( + BetaActionServiceCreateTargetRequest as BetaActionServiceCreateTargetRequest, +) +from zitadel_client.models.beta_action_service_create_target_response import ( + BetaActionServiceCreateTargetResponse as BetaActionServiceCreateTargetResponse, +) +from zitadel_client.models.beta_action_service_delete_target_request import ( + BetaActionServiceDeleteTargetRequest as BetaActionServiceDeleteTargetRequest, +) +from zitadel_client.models.beta_action_service_delete_target_response import ( + BetaActionServiceDeleteTargetResponse as BetaActionServiceDeleteTargetResponse, +) +from zitadel_client.models.beta_action_service_event_execution import ( + BetaActionServiceEventExecution as BetaActionServiceEventExecution, +) +from zitadel_client.models.beta_action_service_execution import ( + BetaActionServiceExecution as BetaActionServiceExecution, +) +from zitadel_client.models.beta_action_service_execution_field_name import ( + BetaActionServiceExecutionFieldName as BetaActionServiceExecutionFieldName, +) +from zitadel_client.models.beta_action_service_execution_search_filter import ( + BetaActionServiceExecutionSearchFilter as BetaActionServiceExecutionSearchFilter, +) +from zitadel_client.models.beta_action_service_execution_type import ( + BetaActionServiceExecutionType as BetaActionServiceExecutionType, +) +from zitadel_client.models.beta_action_service_execution_type_filter import ( + BetaActionServiceExecutionTypeFilter as BetaActionServiceExecutionTypeFilter, +) +from zitadel_client.models.beta_action_service_function_execution import ( + BetaActionServiceFunctionExecution as BetaActionServiceFunctionExecution, +) +from zitadel_client.models.beta_action_service_get_target_request import ( + BetaActionServiceGetTargetRequest as BetaActionServiceGetTargetRequest, +) +from zitadel_client.models.beta_action_service_get_target_response import ( + BetaActionServiceGetTargetResponse as BetaActionServiceGetTargetResponse, +) +from zitadel_client.models.beta_action_service_in_conditions_filter import ( + BetaActionServiceInConditionsFilter as BetaActionServiceInConditionsFilter, +) +from zitadel_client.models.beta_action_service_in_target_ids_filter import ( + BetaActionServiceInTargetIDsFilter as BetaActionServiceInTargetIDsFilter, +) +from zitadel_client.models.beta_action_service_list_execution_functions_response import ( + BetaActionServiceListExecutionFunctionsResponse as BetaActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_methods_response import ( + BetaActionServiceListExecutionMethodsResponse as BetaActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_services_response import ( + BetaActionServiceListExecutionServicesResponse as BetaActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.beta_action_service_list_executions_request import ( + BetaActionServiceListExecutionsRequest as BetaActionServiceListExecutionsRequest, +) +from zitadel_client.models.beta_action_service_list_executions_response import ( + BetaActionServiceListExecutionsResponse as BetaActionServiceListExecutionsResponse, +) +from zitadel_client.models.beta_action_service_list_targets_request import ( + BetaActionServiceListTargetsRequest as BetaActionServiceListTargetsRequest, +) +from zitadel_client.models.beta_action_service_list_targets_response import ( + BetaActionServiceListTargetsResponse as BetaActionServiceListTargetsResponse, +) +from zitadel_client.models.beta_action_service_pagination_request import ( + BetaActionServicePaginationRequest as BetaActionServicePaginationRequest, +) +from zitadel_client.models.beta_action_service_pagination_response import ( + BetaActionServicePaginationResponse as BetaActionServicePaginationResponse, +) +from zitadel_client.models.beta_action_service_rest_call import ( + BetaActionServiceRESTCall as BetaActionServiceRESTCall, +) +from zitadel_client.models.beta_action_service_rest_webhook import ( + BetaActionServiceRESTWebhook as BetaActionServiceRESTWebhook, +) +from zitadel_client.models.beta_action_service_request_execution import ( + BetaActionServiceRequestExecution as BetaActionServiceRequestExecution, +) +from zitadel_client.models.beta_action_service_response_execution import ( + BetaActionServiceResponseExecution as BetaActionServiceResponseExecution, +) +from zitadel_client.models.beta_action_service_set_execution_request import ( + BetaActionServiceSetExecutionRequest as BetaActionServiceSetExecutionRequest, +) +from zitadel_client.models.beta_action_service_set_execution_response import ( + BetaActionServiceSetExecutionResponse as BetaActionServiceSetExecutionResponse, +) +from zitadel_client.models.beta_action_service_target import ( + BetaActionServiceTarget as BetaActionServiceTarget, +) +from zitadel_client.models.beta_action_service_target_field_name import ( + BetaActionServiceTargetFieldName as BetaActionServiceTargetFieldName, +) +from zitadel_client.models.beta_action_service_target_filter import ( + BetaActionServiceTargetFilter as BetaActionServiceTargetFilter, +) +from zitadel_client.models.beta_action_service_target_name_filter import ( + BetaActionServiceTargetNameFilter as BetaActionServiceTargetNameFilter, +) +from zitadel_client.models.beta_action_service_target_search_filter import ( + BetaActionServiceTargetSearchFilter as BetaActionServiceTargetSearchFilter, +) +from zitadel_client.models.beta_action_service_text_filter_method import ( + BetaActionServiceTextFilterMethod as BetaActionServiceTextFilterMethod, +) +from zitadel_client.models.beta_action_service_update_target_request import ( + BetaActionServiceUpdateTargetRequest as BetaActionServiceUpdateTargetRequest, +) +from zitadel_client.models.beta_action_service_update_target_response import ( + BetaActionServiceUpdateTargetResponse as BetaActionServiceUpdateTargetResponse, +) +from zitadel_client.models.beta_app_service_api_auth_method_type import ( + BetaAppServiceAPIAuthMethodType as BetaAppServiceAPIAuthMethodType, +) +from zitadel_client.models.beta_app_service_api_config import ( + BetaAppServiceAPIConfig as BetaAppServiceAPIConfig, +) +from zitadel_client.models.beta_app_service_any import ( + BetaAppServiceAny as BetaAppServiceAny, +) +from zitadel_client.models.beta_app_service_app_sorting import ( + BetaAppServiceAppSorting as BetaAppServiceAppSorting, +) +from zitadel_client.models.beta_app_service_app_state import ( + BetaAppServiceAppState as BetaAppServiceAppState, +) +from zitadel_client.models.beta_app_service_application import ( + BetaAppServiceApplication as BetaAppServiceApplication, +) +from zitadel_client.models.beta_app_service_application_key import ( + BetaAppServiceApplicationKey as BetaAppServiceApplicationKey, +) +from zitadel_client.models.beta_app_service_application_keys_sorting import ( + BetaAppServiceApplicationKeysSorting as BetaAppServiceApplicationKeysSorting, +) +from zitadel_client.models.beta_app_service_application_name_query import ( + BetaAppServiceApplicationNameQuery as BetaAppServiceApplicationNameQuery, +) +from zitadel_client.models.beta_app_service_application_search_filter import ( + BetaAppServiceApplicationSearchFilter as BetaAppServiceApplicationSearchFilter, +) +from zitadel_client.models.beta_app_service_connect_error import ( + BetaAppServiceConnectError as BetaAppServiceConnectError, +) +from zitadel_client.models.beta_app_service_create_api_application_request import ( + BetaAppServiceCreateAPIApplicationRequest as BetaAppServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_api_application_response import ( + BetaAppServiceCreateAPIApplicationResponse as BetaAppServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_application_key_request import ( + BetaAppServiceCreateApplicationKeyRequest as BetaAppServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_create_application_key_response import ( + BetaAppServiceCreateApplicationKeyResponse as BetaAppServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_create_application_request import ( + BetaAppServiceCreateApplicationRequest as BetaAppServiceCreateApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_application_response import ( + BetaAppServiceCreateApplicationResponse as BetaAppServiceCreateApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_oidc_application_request import ( + BetaAppServiceCreateOIDCApplicationRequest as BetaAppServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_oidc_application_response import ( + BetaAppServiceCreateOIDCApplicationResponse as BetaAppServiceCreateOIDCApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_saml_application_request import ( + BetaAppServiceCreateSAMLApplicationRequest as BetaAppServiceCreateSAMLApplicationRequest, +) +from zitadel_client.models.beta_app_service_deactivate_application_request import ( + BetaAppServiceDeactivateApplicationRequest as BetaAppServiceDeactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_deactivate_application_response import ( + BetaAppServiceDeactivateApplicationResponse as BetaAppServiceDeactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_delete_application_key_request import ( + BetaAppServiceDeleteApplicationKeyRequest as BetaAppServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_delete_application_key_response import ( + BetaAppServiceDeleteApplicationKeyResponse as BetaAppServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_delete_application_request import ( + BetaAppServiceDeleteApplicationRequest as BetaAppServiceDeleteApplicationRequest, +) +from zitadel_client.models.beta_app_service_delete_application_response import ( + BetaAppServiceDeleteApplicationResponse as BetaAppServiceDeleteApplicationResponse, +) +from zitadel_client.models.beta_app_service_get_application_key_request import ( + BetaAppServiceGetApplicationKeyRequest as BetaAppServiceGetApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_get_application_key_response import ( + BetaAppServiceGetApplicationKeyResponse as BetaAppServiceGetApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_get_application_request import ( + BetaAppServiceGetApplicationRequest as BetaAppServiceGetApplicationRequest, +) +from zitadel_client.models.beta_app_service_get_application_response import ( + BetaAppServiceGetApplicationResponse as BetaAppServiceGetApplicationResponse, +) +from zitadel_client.models.beta_app_service_list_application_keys_request import ( + BetaAppServiceListApplicationKeysRequest as BetaAppServiceListApplicationKeysRequest, +) +from zitadel_client.models.beta_app_service_list_application_keys_response import ( + BetaAppServiceListApplicationKeysResponse as BetaAppServiceListApplicationKeysResponse, +) +from zitadel_client.models.beta_app_service_list_applications_request import ( + BetaAppServiceListApplicationsRequest as BetaAppServiceListApplicationsRequest, +) +from zitadel_client.models.beta_app_service_list_applications_response import ( + BetaAppServiceListApplicationsResponse as BetaAppServiceListApplicationsResponse, +) +from zitadel_client.models.beta_app_service_login_v2 import ( + BetaAppServiceLoginV2 as BetaAppServiceLoginV2, +) +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion as BetaAppServiceLoginVersion, +) +from zitadel_client.models.beta_app_service_oidc_app_type import ( + BetaAppServiceOIDCAppType as BetaAppServiceOIDCAppType, +) +from zitadel_client.models.beta_app_service_oidc_auth_method_type import ( + BetaAppServiceOIDCAuthMethodType as BetaAppServiceOIDCAuthMethodType, +) +from zitadel_client.models.beta_app_service_oidc_config import ( + BetaAppServiceOIDCConfig as BetaAppServiceOIDCConfig, +) +from zitadel_client.models.beta_app_service_oidc_grant_type import ( + BetaAppServiceOIDCGrantType as BetaAppServiceOIDCGrantType, +) +from zitadel_client.models.beta_app_service_oidc_localized_message import ( + BetaAppServiceOIDCLocalizedMessage as BetaAppServiceOIDCLocalizedMessage, +) +from zitadel_client.models.beta_app_service_oidc_response_type import ( + BetaAppServiceOIDCResponseType as BetaAppServiceOIDCResponseType, +) +from zitadel_client.models.beta_app_service_oidc_token_type import ( + BetaAppServiceOIDCTokenType as BetaAppServiceOIDCTokenType, +) +from zitadel_client.models.beta_app_service_oidc_version import ( + BetaAppServiceOIDCVersion as BetaAppServiceOIDCVersion, +) +from zitadel_client.models.beta_app_service_pagination_request import ( + BetaAppServicePaginationRequest as BetaAppServicePaginationRequest, +) +from zitadel_client.models.beta_app_service_pagination_response import ( + BetaAppServicePaginationResponse as BetaAppServicePaginationResponse, +) +from zitadel_client.models.beta_app_service_reactivate_application_request import ( + BetaAppServiceReactivateApplicationRequest as BetaAppServiceReactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_reactivate_application_response import ( + BetaAppServiceReactivateApplicationResponse as BetaAppServiceReactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_request import ( + BetaAppServiceRegenerateClientSecretRequest as BetaAppServiceRegenerateClientSecretRequest, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_response import ( + BetaAppServiceRegenerateClientSecretResponse as BetaAppServiceRegenerateClientSecretResponse, +) +from zitadel_client.models.beta_app_service_saml_config import ( + BetaAppServiceSAMLConfig as BetaAppServiceSAMLConfig, +) +from zitadel_client.models.beta_app_service_text_filter_method import ( + BetaAppServiceTextFilterMethod as BetaAppServiceTextFilterMethod, +) +from zitadel_client.models.beta_app_service_update_api_application_configuration_request import ( + BetaAppServiceUpdateAPIApplicationConfigurationRequest as BetaAppServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_application_request import ( + BetaAppServiceUpdateApplicationRequest as BetaAppServiceUpdateApplicationRequest, +) +from zitadel_client.models.beta_app_service_update_application_response import ( + BetaAppServiceUpdateApplicationResponse as BetaAppServiceUpdateApplicationResponse, +) +from zitadel_client.models.beta_app_service_update_oidc_application_configuration_request import ( + BetaAppServiceUpdateOIDCApplicationConfigurationRequest as BetaAppServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_saml_application_configuration_request import ( + BetaAppServiceUpdateSAMLApplicationConfigurationRequest as BetaAppServiceUpdateSAMLApplicationConfigurationRequest, +) +from zitadel_client.models.beta_authorization_service_activate_authorization_request import ( + BetaAuthorizationServiceActivateAuthorizationRequest as BetaAuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_activate_authorization_response import ( + BetaAuthorizationServiceActivateAuthorizationResponse as BetaAuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_any import ( + BetaAuthorizationServiceAny as BetaAuthorizationServiceAny, +) +from zitadel_client.models.beta_authorization_service_authorization import ( + BetaAuthorizationServiceAuthorization as BetaAuthorizationServiceAuthorization, +) +from zitadel_client.models.beta_authorization_service_authorization_field_name import ( + BetaAuthorizationServiceAuthorizationFieldName as BetaAuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.beta_authorization_service_authorizations_search_filter import ( + BetaAuthorizationServiceAuthorizationsSearchFilter as BetaAuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.beta_authorization_service_connect_error import ( + BetaAuthorizationServiceConnectError as BetaAuthorizationServiceConnectError, +) +from zitadel_client.models.beta_authorization_service_create_authorization_request import ( + BetaAuthorizationServiceCreateAuthorizationRequest as BetaAuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_create_authorization_response import ( + BetaAuthorizationServiceCreateAuthorizationResponse as BetaAuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_request import ( + BetaAuthorizationServiceDeactivateAuthorizationRequest as BetaAuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_response import ( + BetaAuthorizationServiceDeactivateAuthorizationResponse as BetaAuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_request import ( + BetaAuthorizationServiceDeleteAuthorizationRequest as BetaAuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_response import ( + BetaAuthorizationServiceDeleteAuthorizationResponse as BetaAuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_id_filter import ( + BetaAuthorizationServiceIDFilter as BetaAuthorizationServiceIDFilter, +) +from zitadel_client.models.beta_authorization_service_in_ids_filter import ( + BetaAuthorizationServiceInIDsFilter as BetaAuthorizationServiceInIDsFilter, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_request import ( + BetaAuthorizationServiceListAuthorizationsRequest as BetaAuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_response import ( + BetaAuthorizationServiceListAuthorizationsResponse as BetaAuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.beta_authorization_service_pagination_request import ( + BetaAuthorizationServicePaginationRequest as BetaAuthorizationServicePaginationRequest, +) +from zitadel_client.models.beta_authorization_service_pagination_response import ( + BetaAuthorizationServicePaginationResponse as BetaAuthorizationServicePaginationResponse, +) +from zitadel_client.models.beta_authorization_service_project_name_query import ( + BetaAuthorizationServiceProjectNameQuery as BetaAuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.beta_authorization_service_role_key_query import ( + BetaAuthorizationServiceRoleKeyQuery as BetaAuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.beta_authorization_service_state import ( + BetaAuthorizationServiceState as BetaAuthorizationServiceState, +) +from zitadel_client.models.beta_authorization_service_state_query import ( + BetaAuthorizationServiceStateQuery as BetaAuthorizationServiceStateQuery, +) +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod as BetaAuthorizationServiceTextFilterMethod, +) +from zitadel_client.models.beta_authorization_service_update_authorization_request import ( + BetaAuthorizationServiceUpdateAuthorizationRequest as BetaAuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_update_authorization_response import ( + BetaAuthorizationServiceUpdateAuthorizationResponse as BetaAuthorizationServiceUpdateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_user import ( + BetaAuthorizationServiceUser as BetaAuthorizationServiceUser, +) +from zitadel_client.models.beta_authorization_service_user_display_name_query import ( + BetaAuthorizationServiceUserDisplayNameQuery as BetaAuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.beta_authorization_service_user_preferred_login_name_query import ( + BetaAuthorizationServiceUserPreferredLoginNameQuery as BetaAuthorizationServiceUserPreferredLoginNameQuery, +) +from zitadel_client.models.beta_feature_service_any import ( + BetaFeatureServiceAny as BetaFeatureServiceAny, +) +from zitadel_client.models.beta_feature_service_connect_error import ( + BetaFeatureServiceConnectError as BetaFeatureServiceConnectError, +) +from zitadel_client.models.beta_feature_service_details import ( + BetaFeatureServiceDetails as BetaFeatureServiceDetails, +) +from zitadel_client.models.beta_feature_service_feature_flag import ( + BetaFeatureServiceFeatureFlag as BetaFeatureServiceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_get_instance_features_request import ( + BetaFeatureServiceGetInstanceFeaturesRequest as BetaFeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_instance_features_response import ( + BetaFeatureServiceGetInstanceFeaturesResponse as BetaFeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_organization_features_request import ( + BetaFeatureServiceGetOrganizationFeaturesRequest as BetaFeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_organization_features_response import ( + BetaFeatureServiceGetOrganizationFeaturesResponse as BetaFeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_system_features_response import ( + BetaFeatureServiceGetSystemFeaturesResponse as BetaFeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_user_features_request import ( + BetaFeatureServiceGetUserFeaturesRequest as BetaFeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_user_features_response import ( + BetaFeatureServiceGetUserFeaturesResponse as BetaFeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_improved_performance import ( + BetaFeatureServiceImprovedPerformance as BetaFeatureServiceImprovedPerformance, +) +from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import ( + BetaFeatureServiceImprovedPerformanceFeatureFlag as BetaFeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_reset_instance_features_response import ( + BetaFeatureServiceResetInstanceFeaturesResponse as BetaFeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_request import ( + BetaFeatureServiceResetOrganizationFeaturesRequest as BetaFeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_response import ( + BetaFeatureServiceResetOrganizationFeaturesResponse as BetaFeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_system_features_response import ( + BetaFeatureServiceResetSystemFeaturesResponse as BetaFeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_user_features_request import ( + BetaFeatureServiceResetUserFeaturesRequest as BetaFeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_user_features_response import ( + BetaFeatureServiceResetUserFeaturesResponse as BetaFeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_instance_features_request import ( + BetaFeatureServiceSetInstanceFeaturesRequest as BetaFeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_instance_features_response import ( + BetaFeatureServiceSetInstanceFeaturesResponse as BetaFeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_organization_features_request import ( + BetaFeatureServiceSetOrganizationFeaturesRequest as BetaFeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_organization_features_response import ( + BetaFeatureServiceSetOrganizationFeaturesResponse as BetaFeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_system_features_request import ( + BetaFeatureServiceSetSystemFeaturesRequest as BetaFeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_system_features_response import ( + BetaFeatureServiceSetSystemFeaturesResponse as BetaFeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_user_feature_request import ( + BetaFeatureServiceSetUserFeatureRequest as BetaFeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.beta_feature_service_set_user_features_response import ( + BetaFeatureServiceSetUserFeaturesResponse as BetaFeatureServiceSetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_source import ( + BetaFeatureServiceSource as BetaFeatureServiceSource, +) +from zitadel_client.models.beta_instance_service_add_custom_domain_request import ( + BetaInstanceServiceAddCustomDomainRequest as BetaInstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_custom_domain_response import ( + BetaInstanceServiceAddCustomDomainResponse as BetaInstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_request import ( + BetaInstanceServiceAddTrustedDomainRequest as BetaInstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_response import ( + BetaInstanceServiceAddTrustedDomainResponse as BetaInstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_any import ( + BetaInstanceServiceAny as BetaInstanceServiceAny, +) +from zitadel_client.models.beta_instance_service_connect_error import ( + BetaInstanceServiceConnectError as BetaInstanceServiceConnectError, +) +from zitadel_client.models.beta_instance_service_delete_instance_request import ( + BetaInstanceServiceDeleteInstanceRequest as BetaInstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.beta_instance_service_delete_instance_response import ( + BetaInstanceServiceDeleteInstanceResponse as BetaInstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.beta_instance_service_domain import ( + BetaInstanceServiceDomain as BetaInstanceServiceDomain, +) +from zitadel_client.models.beta_instance_service_domain_field_name import ( + BetaInstanceServiceDomainFieldName as BetaInstanceServiceDomainFieldName, +) +from zitadel_client.models.beta_instance_service_domain_generated_query import ( + BetaInstanceServiceDomainGeneratedQuery as BetaInstanceServiceDomainGeneratedQuery, +) +from zitadel_client.models.beta_instance_service_domain_primary_query import ( + BetaInstanceServiceDomainPrimaryQuery as BetaInstanceServiceDomainPrimaryQuery, +) +from zitadel_client.models.beta_instance_service_domain_query import ( + BetaInstanceServiceDomainQuery as BetaInstanceServiceDomainQuery, +) +from zitadel_client.models.beta_instance_service_domain_search_query import ( + BetaInstanceServiceDomainSearchQuery as BetaInstanceServiceDomainSearchQuery, +) +from zitadel_client.models.beta_instance_service_domains_query import ( + BetaInstanceServiceDomainsQuery as BetaInstanceServiceDomainsQuery, +) +from zitadel_client.models.beta_instance_service_field_name import ( + BetaInstanceServiceFieldName as BetaInstanceServiceFieldName, +) +from zitadel_client.models.beta_instance_service_get_instance_request import ( + BetaInstanceServiceGetInstanceRequest as BetaInstanceServiceGetInstanceRequest, +) +from zitadel_client.models.beta_instance_service_get_instance_response import ( + BetaInstanceServiceGetInstanceResponse as BetaInstanceServiceGetInstanceResponse, +) +from zitadel_client.models.beta_instance_service_ids_query import ( + BetaInstanceServiceIdsQuery as BetaInstanceServiceIdsQuery, +) +from zitadel_client.models.beta_instance_service_instance import ( + BetaInstanceServiceInstance as BetaInstanceServiceInstance, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_request import ( + BetaInstanceServiceListCustomDomainsRequest as BetaInstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_response import ( + BetaInstanceServiceListCustomDomainsResponse as BetaInstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.beta_instance_service_list_instances_request import ( + BetaInstanceServiceListInstancesRequest as BetaInstanceServiceListInstancesRequest, +) +from zitadel_client.models.beta_instance_service_list_instances_response import ( + BetaInstanceServiceListInstancesResponse as BetaInstanceServiceListInstancesResponse, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_request import ( + BetaInstanceServiceListTrustedDomainsRequest as BetaInstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_response import ( + BetaInstanceServiceListTrustedDomainsResponse as BetaInstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.beta_instance_service_pagination_request import ( + BetaInstanceServicePaginationRequest as BetaInstanceServicePaginationRequest, +) +from zitadel_client.models.beta_instance_service_pagination_response import ( + BetaInstanceServicePaginationResponse as BetaInstanceServicePaginationResponse, +) +from zitadel_client.models.beta_instance_service_query import ( + BetaInstanceServiceQuery as BetaInstanceServiceQuery, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_request import ( + BetaInstanceServiceRemoveCustomDomainRequest as BetaInstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_response import ( + BetaInstanceServiceRemoveCustomDomainResponse as BetaInstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_request import ( + BetaInstanceServiceRemoveTrustedDomainRequest as BetaInstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_response import ( + BetaInstanceServiceRemoveTrustedDomainResponse as BetaInstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_state import ( + BetaInstanceServiceState as BetaInstanceServiceState, +) +from zitadel_client.models.beta_instance_service_text_query_method import ( + BetaInstanceServiceTextQueryMethod as BetaInstanceServiceTextQueryMethod, +) +from zitadel_client.models.beta_instance_service_trusted_domain import ( + BetaInstanceServiceTrustedDomain as BetaInstanceServiceTrustedDomain, +) +from zitadel_client.models.beta_instance_service_trusted_domain_field_name import ( + BetaInstanceServiceTrustedDomainFieldName as BetaInstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.beta_instance_service_trusted_domain_search_query import ( + BetaInstanceServiceTrustedDomainSearchQuery as BetaInstanceServiceTrustedDomainSearchQuery, +) +from zitadel_client.models.beta_instance_service_update_instance_request import ( + BetaInstanceServiceUpdateInstanceRequest as BetaInstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.beta_instance_service_update_instance_response import ( + BetaInstanceServiceUpdateInstanceResponse as BetaInstanceServiceUpdateInstanceResponse, +) +from zitadel_client.models.beta_internal_permission_service_administrator import ( + BetaInternalPermissionServiceAdministrator as BetaInternalPermissionServiceAdministrator, +) +from zitadel_client.models.beta_internal_permission_service_administrator_field_name import ( + BetaInternalPermissionServiceAdministratorFieldName as BetaInternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter as BetaInternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.beta_internal_permission_service_and_filter import ( + BetaInternalPermissionServiceAndFilter as BetaInternalPermissionServiceAndFilter, +) +from zitadel_client.models.beta_internal_permission_service_any import ( + BetaInternalPermissionServiceAny as BetaInternalPermissionServiceAny, +) +from zitadel_client.models.beta_internal_permission_service_connect_error import ( + BetaInternalPermissionServiceConnectError as BetaInternalPermissionServiceConnectError, +) +from zitadel_client.models.beta_internal_permission_service_create_administrator_request import ( + BetaInternalPermissionServiceCreateAdministratorRequest as BetaInternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_create_administrator_response import ( + BetaInternalPermissionServiceCreateAdministratorResponse as BetaInternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_request import ( + BetaInternalPermissionServiceDeleteAdministratorRequest as BetaInternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_response import ( + BetaInternalPermissionServiceDeleteAdministratorResponse as BetaInternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_id_filter import ( + BetaInternalPermissionServiceIDFilter as BetaInternalPermissionServiceIDFilter, +) +from zitadel_client.models.beta_internal_permission_service_in_ids_filter import ( + BetaInternalPermissionServiceInIDsFilter as BetaInternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_request import ( + BetaInternalPermissionServiceListAdministratorsRequest as BetaInternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_response import ( + BetaInternalPermissionServiceListAdministratorsResponse as BetaInternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.beta_internal_permission_service_not_filter import ( + BetaInternalPermissionServiceNotFilter as BetaInternalPermissionServiceNotFilter, +) +from zitadel_client.models.beta_internal_permission_service_or_filter import ( + BetaInternalPermissionServiceOrFilter as BetaInternalPermissionServiceOrFilter, +) +from zitadel_client.models.beta_internal_permission_service_organization import ( + BetaInternalPermissionServiceOrganization as BetaInternalPermissionServiceOrganization, +) +from zitadel_client.models.beta_internal_permission_service_pagination_request import ( + BetaInternalPermissionServicePaginationRequest as BetaInternalPermissionServicePaginationRequest, +) +from zitadel_client.models.beta_internal_permission_service_pagination_response import ( + BetaInternalPermissionServicePaginationResponse as BetaInternalPermissionServicePaginationResponse, +) +from zitadel_client.models.beta_internal_permission_service_project import ( + BetaInternalPermissionServiceProject as BetaInternalPermissionServiceProject, +) +from zitadel_client.models.beta_internal_permission_service_project_grant import ( + BetaInternalPermissionServiceProjectGrant as BetaInternalPermissionServiceProjectGrant, +) +from zitadel_client.models.beta_internal_permission_service_resource_filter import ( + BetaInternalPermissionServiceResourceFilter as BetaInternalPermissionServiceResourceFilter, +) +from zitadel_client.models.beta_internal_permission_service_resource_type import ( + BetaInternalPermissionServiceResourceType as BetaInternalPermissionServiceResourceType, +) +from zitadel_client.models.beta_internal_permission_service_role_filter import ( + BetaInternalPermissionServiceRoleFilter as BetaInternalPermissionServiceRoleFilter, +) +from zitadel_client.models.beta_internal_permission_service_text_filter_method import ( + BetaInternalPermissionServiceTextFilterMethod as BetaInternalPermissionServiceTextFilterMethod, +) +from zitadel_client.models.beta_internal_permission_service_timestamp_filter import ( + BetaInternalPermissionServiceTimestampFilter as BetaInternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.beta_internal_permission_service_timestamp_filter_method import ( + BetaInternalPermissionServiceTimestampFilterMethod as BetaInternalPermissionServiceTimestampFilterMethod, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_request import ( + BetaInternalPermissionServiceUpdateAdministratorRequest as BetaInternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_response import ( + BetaInternalPermissionServiceUpdateAdministratorResponse as BetaInternalPermissionServiceUpdateAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_user import ( + BetaInternalPermissionServiceUser as BetaInternalPermissionServiceUser, +) +from zitadel_client.models.beta_internal_permission_service_user_display_name_filter import ( + BetaInternalPermissionServiceUserDisplayNameFilter as BetaInternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.beta_internal_permission_service_user_preferred_login_name_filter import ( + BetaInternalPermissionServiceUserPreferredLoginNameFilter as BetaInternalPermissionServiceUserPreferredLoginNameFilter, +) +from zitadel_client.models.beta_oidc_service_any import ( + BetaOIDCServiceAny as BetaOIDCServiceAny, +) +from zitadel_client.models.beta_oidc_service_auth_request import ( + BetaOIDCServiceAuthRequest as BetaOIDCServiceAuthRequest, +) +from zitadel_client.models.beta_oidc_service_authorization_error import ( + BetaOIDCServiceAuthorizationError as BetaOIDCServiceAuthorizationError, +) +from zitadel_client.models.beta_oidc_service_connect_error import ( + BetaOIDCServiceConnectError as BetaOIDCServiceConnectError, +) +from zitadel_client.models.beta_oidc_service_create_callback_request import ( + BetaOIDCServiceCreateCallbackRequest as BetaOIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.beta_oidc_service_create_callback_response import ( + BetaOIDCServiceCreateCallbackResponse as BetaOIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.beta_oidc_service_details import ( + BetaOIDCServiceDetails as BetaOIDCServiceDetails, +) +from zitadel_client.models.beta_oidc_service_error_reason import ( + BetaOIDCServiceErrorReason as BetaOIDCServiceErrorReason, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_request import ( + BetaOIDCServiceGetAuthRequestRequest as BetaOIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_response import ( + BetaOIDCServiceGetAuthRequestResponse as BetaOIDCServiceGetAuthRequestResponse, +) +from zitadel_client.models.beta_oidc_service_prompt import ( + BetaOIDCServicePrompt as BetaOIDCServicePrompt, +) +from zitadel_client.models.beta_oidc_service_session import ( + BetaOIDCServiceSession as BetaOIDCServiceSession, +) +from zitadel_client.models.beta_organization_service_activate_organization_request import ( + BetaOrganizationServiceActivateOrganizationRequest as BetaOrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_activate_organization_response import ( + BetaOrganizationServiceActivateOrganizationResponse as BetaOrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_add_human_user_request import ( + BetaOrganizationServiceAddHumanUserRequest as BetaOrganizationServiceAddHumanUserRequest, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_request import ( + BetaOrganizationServiceAddOrganizationDomainRequest as BetaOrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_response import ( + BetaOrganizationServiceAddOrganizationDomainResponse as BetaOrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_admin import ( + BetaOrganizationServiceAdmin as BetaOrganizationServiceAdmin, +) +from zitadel_client.models.beta_organization_service_any import ( + BetaOrganizationServiceAny as BetaOrganizationServiceAny, +) +from zitadel_client.models.beta_organization_service_assigned_admin import ( + BetaOrganizationServiceAssignedAdmin as BetaOrganizationServiceAssignedAdmin, +) +from zitadel_client.models.beta_organization_service_connect_error import ( + BetaOrganizationServiceConnectError as BetaOrganizationServiceConnectError, +) +from zitadel_client.models.beta_organization_service_create_organization_request import ( + BetaOrganizationServiceCreateOrganizationRequest as BetaOrganizationServiceCreateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_create_organization_response import ( + BetaOrganizationServiceCreateOrganizationResponse as BetaOrganizationServiceCreateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_created_admin import ( + BetaOrganizationServiceCreatedAdmin as BetaOrganizationServiceCreatedAdmin, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_request import ( + BetaOrganizationServiceDeactivateOrganizationRequest as BetaOrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_response import ( + BetaOrganizationServiceDeactivateOrganizationResponse as BetaOrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_request import ( + BetaOrganizationServiceDeleteOrganizationDomainRequest as BetaOrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_response import ( + BetaOrganizationServiceDeleteOrganizationDomainResponse as BetaOrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_request import ( + BetaOrganizationServiceDeleteOrganizationMetadataRequest as BetaOrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_response import ( + BetaOrganizationServiceDeleteOrganizationMetadataResponse as BetaOrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_request import ( + BetaOrganizationServiceDeleteOrganizationRequest as BetaOrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_response import ( + BetaOrganizationServiceDeleteOrganizationResponse as BetaOrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_domain import ( + BetaOrganizationServiceDomain as BetaOrganizationServiceDomain, +) +from zitadel_client.models.beta_organization_service_domain_name_filter import ( + BetaOrganizationServiceDomainNameFilter as BetaOrganizationServiceDomainNameFilter, +) +from zitadel_client.models.beta_organization_service_domain_search_filter import ( + BetaOrganizationServiceDomainSearchFilter as BetaOrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.beta_organization_service_domain_validation_type import ( + BetaOrganizationServiceDomainValidationType as BetaOrganizationServiceDomainValidationType, +) +from zitadel_client.models.beta_organization_service_gender import ( + BetaOrganizationServiceGender as BetaOrganizationServiceGender, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_request import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationRequest as BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_response import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationResponse as BetaOrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.beta_organization_service_hashed_password import ( + BetaOrganizationServiceHashedPassword as BetaOrganizationServiceHashedPassword, +) +from zitadel_client.models.beta_organization_service_idp_link import ( + BetaOrganizationServiceIDPLink as BetaOrganizationServiceIDPLink, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_request import ( + BetaOrganizationServiceListOrganizationDomainsRequest as BetaOrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_response import ( + BetaOrganizationServiceListOrganizationDomainsResponse as BetaOrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_request import ( + BetaOrganizationServiceListOrganizationMetadataRequest as BetaOrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_response import ( + BetaOrganizationServiceListOrganizationMetadataResponse as BetaOrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_list_organizations_request import ( + BetaOrganizationServiceListOrganizationsRequest as BetaOrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.beta_organization_service_list_organizations_response import ( + BetaOrganizationServiceListOrganizationsResponse as BetaOrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.beta_organization_service_metadata import ( + BetaOrganizationServiceMetadata as BetaOrganizationServiceMetadata, +) +from zitadel_client.models.beta_organization_service_metadata_key_query import ( + BetaOrganizationServiceMetadataKeyQuery as BetaOrganizationServiceMetadataKeyQuery, +) +from zitadel_client.models.beta_organization_service_metadata_query import ( + BetaOrganizationServiceMetadataQuery as BetaOrganizationServiceMetadataQuery, +) +from zitadel_client.models.beta_organization_service_org_domain_filter import ( + BetaOrganizationServiceOrgDomainFilter as BetaOrganizationServiceOrgDomainFilter, +) +from zitadel_client.models.beta_organization_service_org_field_name import ( + BetaOrganizationServiceOrgFieldName as BetaOrganizationServiceOrgFieldName, +) +from zitadel_client.models.beta_organization_service_org_id_filter import ( + BetaOrganizationServiceOrgIDFilter as BetaOrganizationServiceOrgIDFilter, +) +from zitadel_client.models.beta_organization_service_org_name_filter import ( + BetaOrganizationServiceOrgNameFilter as BetaOrganizationServiceOrgNameFilter, +) +from zitadel_client.models.beta_organization_service_org_state import ( + BetaOrganizationServiceOrgState as BetaOrganizationServiceOrgState, +) +from zitadel_client.models.beta_organization_service_org_state_filter import ( + BetaOrganizationServiceOrgStateFilter as BetaOrganizationServiceOrgStateFilter, +) +from zitadel_client.models.beta_organization_service_organization import ( + BetaOrganizationServiceOrganization as BetaOrganizationServiceOrganization, +) +from zitadel_client.models.beta_organization_service_organization_admin import ( + BetaOrganizationServiceOrganizationAdmin as BetaOrganizationServiceOrganizationAdmin, +) +from zitadel_client.models.beta_organization_service_organization_search_filter import ( + BetaOrganizationServiceOrganizationSearchFilter as BetaOrganizationServiceOrganizationSearchFilter, +) +from zitadel_client.models.beta_organization_service_pagination_request import ( + BetaOrganizationServicePaginationRequest as BetaOrganizationServicePaginationRequest, +) +from zitadel_client.models.beta_organization_service_pagination_response import ( + BetaOrganizationServicePaginationResponse as BetaOrganizationServicePaginationResponse, +) +from zitadel_client.models.beta_organization_service_password import ( + BetaOrganizationServicePassword as BetaOrganizationServicePassword, +) +from zitadel_client.models.beta_organization_service_send_email_verification_code import ( + BetaOrganizationServiceSendEmailVerificationCode as BetaOrganizationServiceSendEmailVerificationCode, +) +from zitadel_client.models.beta_organization_service_set_human_email import ( + BetaOrganizationServiceSetHumanEmail as BetaOrganizationServiceSetHumanEmail, +) +from zitadel_client.models.beta_organization_service_set_human_phone import ( + BetaOrganizationServiceSetHumanPhone as BetaOrganizationServiceSetHumanPhone, +) +from zitadel_client.models.beta_organization_service_set_human_profile import ( + BetaOrganizationServiceSetHumanProfile as BetaOrganizationServiceSetHumanProfile, +) +from zitadel_client.models.beta_organization_service_set_metadata_entry import ( + BetaOrganizationServiceSetMetadataEntry as BetaOrganizationServiceSetMetadataEntry, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_request import ( + BetaOrganizationServiceSetOrganizationMetadataRequest as BetaOrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_response import ( + BetaOrganizationServiceSetOrganizationMetadataResponse as BetaOrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod as BetaOrganizationServiceTextQueryMethod, +) +from zitadel_client.models.beta_organization_service_update_organization_request import ( + BetaOrganizationServiceUpdateOrganizationRequest as BetaOrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_update_organization_response import ( + BetaOrganizationServiceUpdateOrganizationResponse as BetaOrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_request import ( + BetaOrganizationServiceVerifyOrganizationDomainRequest as BetaOrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_response import ( + BetaOrganizationServiceVerifyOrganizationDomainResponse as BetaOrganizationServiceVerifyOrganizationDomainResponse, +) +from zitadel_client.models.beta_project_service_activate_project_grant_request import ( + BetaProjectServiceActivateProjectGrantRequest as BetaProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_activate_project_grant_response import ( + BetaProjectServiceActivateProjectGrantResponse as BetaProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_activate_project_request import ( + BetaProjectServiceActivateProjectRequest as BetaProjectServiceActivateProjectRequest, +) +from zitadel_client.models.beta_project_service_activate_project_response import ( + BetaProjectServiceActivateProjectResponse as BetaProjectServiceActivateProjectResponse, +) +from zitadel_client.models.beta_project_service_add_project_role_request import ( + BetaProjectServiceAddProjectRoleRequest as BetaProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_add_project_role_response import ( + BetaProjectServiceAddProjectRoleResponse as BetaProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_admin import ( + BetaProjectServiceAdmin as BetaProjectServiceAdmin, +) +from zitadel_client.models.beta_project_service_any import ( + BetaProjectServiceAny as BetaProjectServiceAny, +) +from zitadel_client.models.beta_project_service_connect_error import ( + BetaProjectServiceConnectError as BetaProjectServiceConnectError, +) +from zitadel_client.models.beta_project_service_create_project_grant_request import ( + BetaProjectServiceCreateProjectGrantRequest as BetaProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_create_project_grant_response import ( + BetaProjectServiceCreateProjectGrantResponse as BetaProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_create_project_request import ( + BetaProjectServiceCreateProjectRequest as BetaProjectServiceCreateProjectRequest, +) +from zitadel_client.models.beta_project_service_create_project_response import ( + BetaProjectServiceCreateProjectResponse as BetaProjectServiceCreateProjectResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_request import ( + BetaProjectServiceDeactivateProjectGrantRequest as BetaProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_response import ( + BetaProjectServiceDeactivateProjectGrantResponse as BetaProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_request import ( + BetaProjectServiceDeactivateProjectRequest as BetaProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_response import ( + BetaProjectServiceDeactivateProjectResponse as BetaProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.beta_project_service_delete_project_grant_request import ( + BetaProjectServiceDeleteProjectGrantRequest as BetaProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_delete_project_grant_response import ( + BetaProjectServiceDeleteProjectGrantResponse as BetaProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_delete_project_request import ( + BetaProjectServiceDeleteProjectRequest as BetaProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.beta_project_service_delete_project_response import ( + BetaProjectServiceDeleteProjectResponse as BetaProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.beta_project_service_get_project_request import ( + BetaProjectServiceGetProjectRequest as BetaProjectServiceGetProjectRequest, +) +from zitadel_client.models.beta_project_service_get_project_response import ( + BetaProjectServiceGetProjectResponse as BetaProjectServiceGetProjectResponse, +) +from zitadel_client.models.beta_project_service_granted_project_state import ( + BetaProjectServiceGrantedProjectState as BetaProjectServiceGrantedProjectState, +) +from zitadel_client.models.beta_project_service_id_filter import ( + BetaProjectServiceIDFilter as BetaProjectServiceIDFilter, +) +from zitadel_client.models.beta_project_service_in_ids_filter import ( + BetaProjectServiceInIDsFilter as BetaProjectServiceInIDsFilter, +) +from zitadel_client.models.beta_project_service_list_project_grants_request import ( + BetaProjectServiceListProjectGrantsRequest as BetaProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.beta_project_service_list_project_grants_response import ( + BetaProjectServiceListProjectGrantsResponse as BetaProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.beta_project_service_list_project_roles_request import ( + BetaProjectServiceListProjectRolesRequest as BetaProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.beta_project_service_list_project_roles_response import ( + BetaProjectServiceListProjectRolesResponse as BetaProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.beta_project_service_list_projects_request import ( + BetaProjectServiceListProjectsRequest as BetaProjectServiceListProjectsRequest, +) +from zitadel_client.models.beta_project_service_list_projects_response import ( + BetaProjectServiceListProjectsResponse as BetaProjectServiceListProjectsResponse, +) +from zitadel_client.models.beta_project_service_pagination_request import ( + BetaProjectServicePaginationRequest as BetaProjectServicePaginationRequest, +) +from zitadel_client.models.beta_project_service_pagination_response import ( + BetaProjectServicePaginationResponse as BetaProjectServicePaginationResponse, +) +from zitadel_client.models.beta_project_service_private_labeling_setting import ( + BetaProjectServicePrivateLabelingSetting as BetaProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.beta_project_service_project import ( + BetaProjectServiceProject as BetaProjectServiceProject, +) +from zitadel_client.models.beta_project_service_project_field_name import ( + BetaProjectServiceProjectFieldName as BetaProjectServiceProjectFieldName, +) +from zitadel_client.models.beta_project_service_project_grant import ( + BetaProjectServiceProjectGrant as BetaProjectServiceProjectGrant, +) +from zitadel_client.models.beta_project_service_project_grant_field_name import ( + BetaProjectServiceProjectGrantFieldName as BetaProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.beta_project_service_project_grant_search_filter import ( + BetaProjectServiceProjectGrantSearchFilter as BetaProjectServiceProjectGrantSearchFilter, +) +from zitadel_client.models.beta_project_service_project_grant_state import ( + BetaProjectServiceProjectGrantState as BetaProjectServiceProjectGrantState, +) +from zitadel_client.models.beta_project_service_project_name_filter import ( + BetaProjectServiceProjectNameFilter as BetaProjectServiceProjectNameFilter, +) +from zitadel_client.models.beta_project_service_project_role import ( + BetaProjectServiceProjectRole as BetaProjectServiceProjectRole, +) +from zitadel_client.models.beta_project_service_project_role_display_name_filter import ( + BetaProjectServiceProjectRoleDisplayNameFilter as BetaProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.beta_project_service_project_role_field_name import ( + BetaProjectServiceProjectRoleFieldName as BetaProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.beta_project_service_project_role_key_filter import ( + BetaProjectServiceProjectRoleKeyFilter as BetaProjectServiceProjectRoleKeyFilter, +) +from zitadel_client.models.beta_project_service_project_role_search_filter import ( + BetaProjectServiceProjectRoleSearchFilter as BetaProjectServiceProjectRoleSearchFilter, +) +from zitadel_client.models.beta_project_service_project_search_filter import ( + BetaProjectServiceProjectSearchFilter as BetaProjectServiceProjectSearchFilter, +) +from zitadel_client.models.beta_project_service_project_state import ( + BetaProjectServiceProjectState as BetaProjectServiceProjectState, +) +from zitadel_client.models.beta_project_service_remove_project_role_request import ( + BetaProjectServiceRemoveProjectRoleRequest as BetaProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_remove_project_role_response import ( + BetaProjectServiceRemoveProjectRoleResponse as BetaProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_text_filter_method import ( + BetaProjectServiceTextFilterMethod as BetaProjectServiceTextFilterMethod, +) +from zitadel_client.models.beta_project_service_update_project_grant_request import ( + BetaProjectServiceUpdateProjectGrantRequest as BetaProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_update_project_grant_response import ( + BetaProjectServiceUpdateProjectGrantResponse as BetaProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_update_project_request import ( + BetaProjectServiceUpdateProjectRequest as BetaProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.beta_project_service_update_project_response import ( + BetaProjectServiceUpdateProjectResponse as BetaProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.beta_project_service_update_project_role_request import ( + BetaProjectServiceUpdateProjectRoleRequest as BetaProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_update_project_role_response import ( + BetaProjectServiceUpdateProjectRoleResponse as BetaProjectServiceUpdateProjectRoleResponse, +) +from zitadel_client.models.beta_session_service_any import ( + BetaSessionServiceAny as BetaSessionServiceAny, +) +from zitadel_client.models.beta_session_service_challenges import ( + BetaSessionServiceChallenges as BetaSessionServiceChallenges, +) +from zitadel_client.models.beta_session_service_check_idp_intent import ( + BetaSessionServiceCheckIDPIntent as BetaSessionServiceCheckIDPIntent, +) +from zitadel_client.models.beta_session_service_check_otp import ( + BetaSessionServiceCheckOTP as BetaSessionServiceCheckOTP, +) +from zitadel_client.models.beta_session_service_check_password import ( + BetaSessionServiceCheckPassword as BetaSessionServiceCheckPassword, +) +from zitadel_client.models.beta_session_service_check_totp import ( + BetaSessionServiceCheckTOTP as BetaSessionServiceCheckTOTP, +) +from zitadel_client.models.beta_session_service_check_user import ( + BetaSessionServiceCheckUser as BetaSessionServiceCheckUser, +) +from zitadel_client.models.beta_session_service_check_web_auth_n import ( + BetaSessionServiceCheckWebAuthN as BetaSessionServiceCheckWebAuthN, +) +from zitadel_client.models.beta_session_service_checks import ( + BetaSessionServiceChecks as BetaSessionServiceChecks, +) +from zitadel_client.models.beta_session_service_connect_error import ( + BetaSessionServiceConnectError as BetaSessionServiceConnectError, +) +from zitadel_client.models.beta_session_service_create_session_request import ( + BetaSessionServiceCreateSessionRequest as BetaSessionServiceCreateSessionRequest, +) +from zitadel_client.models.beta_session_service_create_session_response import ( + BetaSessionServiceCreateSessionResponse as BetaSessionServiceCreateSessionResponse, +) +from zitadel_client.models.beta_session_service_creation_date_query import ( + BetaSessionServiceCreationDateQuery as BetaSessionServiceCreationDateQuery, +) +from zitadel_client.models.beta_session_service_delete_session_request import ( + BetaSessionServiceDeleteSessionRequest as BetaSessionServiceDeleteSessionRequest, +) +from zitadel_client.models.beta_session_service_delete_session_response import ( + BetaSessionServiceDeleteSessionResponse as BetaSessionServiceDeleteSessionResponse, +) +from zitadel_client.models.beta_session_service_details import ( + BetaSessionServiceDetails as BetaSessionServiceDetails, +) +from zitadel_client.models.beta_session_service_factors import ( + BetaSessionServiceFactors as BetaSessionServiceFactors, +) +from zitadel_client.models.beta_session_service_get_session_request import ( + BetaSessionServiceGetSessionRequest as BetaSessionServiceGetSessionRequest, +) +from zitadel_client.models.beta_session_service_get_session_response import ( + BetaSessionServiceGetSessionResponse as BetaSessionServiceGetSessionResponse, +) +from zitadel_client.models.beta_session_service_header_values import ( + BetaSessionServiceHeaderValues as BetaSessionServiceHeaderValues, +) +from zitadel_client.models.beta_session_service_ids_query import ( + BetaSessionServiceIDsQuery as BetaSessionServiceIDsQuery, +) +from zitadel_client.models.beta_session_service_intent_factor import ( + BetaSessionServiceIntentFactor as BetaSessionServiceIntentFactor, +) +from zitadel_client.models.beta_session_service_list_details import ( + BetaSessionServiceListDetails as BetaSessionServiceListDetails, +) +from zitadel_client.models.beta_session_service_list_query import ( + BetaSessionServiceListQuery as BetaSessionServiceListQuery, +) +from zitadel_client.models.beta_session_service_list_sessions_request import ( + BetaSessionServiceListSessionsRequest as BetaSessionServiceListSessionsRequest, +) +from zitadel_client.models.beta_session_service_list_sessions_response import ( + BetaSessionServiceListSessionsResponse as BetaSessionServiceListSessionsResponse, +) +from zitadel_client.models.beta_session_service_otp_email import ( + BetaSessionServiceOTPEmail as BetaSessionServiceOTPEmail, +) +from zitadel_client.models.beta_session_service_otp_factor import ( + BetaSessionServiceOTPFactor as BetaSessionServiceOTPFactor, +) +from zitadel_client.models.beta_session_service_otpsms import ( + BetaSessionServiceOTPSMS as BetaSessionServiceOTPSMS, +) +from zitadel_client.models.beta_session_service_password_factor import ( + BetaSessionServicePasswordFactor as BetaSessionServicePasswordFactor, +) +from zitadel_client.models.beta_session_service_request_challenges import ( + BetaSessionServiceRequestChallenges as BetaSessionServiceRequestChallenges, +) +from zitadel_client.models.beta_session_service_search_query import ( + BetaSessionServiceSearchQuery as BetaSessionServiceSearchQuery, +) +from zitadel_client.models.beta_session_service_send_code import ( + BetaSessionServiceSendCode as BetaSessionServiceSendCode, +) +from zitadel_client.models.beta_session_service_session import ( + BetaSessionServiceSession as BetaSessionServiceSession, +) +from zitadel_client.models.beta_session_service_session_field_name import ( + BetaSessionServiceSessionFieldName as BetaSessionServiceSessionFieldName, +) +from zitadel_client.models.beta_session_service_set_session_request import ( + BetaSessionServiceSetSessionRequest as BetaSessionServiceSetSessionRequest, +) +from zitadel_client.models.beta_session_service_set_session_response import ( + BetaSessionServiceSetSessionResponse as BetaSessionServiceSetSessionResponse, +) +from zitadel_client.models.beta_session_service_totp_factor import ( + BetaSessionServiceTOTPFactor as BetaSessionServiceTOTPFactor, +) +from zitadel_client.models.beta_session_service_timestamp_query_method import ( + BetaSessionServiceTimestampQueryMethod as BetaSessionServiceTimestampQueryMethod, +) +from zitadel_client.models.beta_session_service_user_agent import ( + BetaSessionServiceUserAgent as BetaSessionServiceUserAgent, +) +from zitadel_client.models.beta_session_service_user_factor import ( + BetaSessionServiceUserFactor as BetaSessionServiceUserFactor, +) +from zitadel_client.models.beta_session_service_user_id_query import ( + BetaSessionServiceUserIDQuery as BetaSessionServiceUserIDQuery, +) +from zitadel_client.models.beta_session_service_user_verification_requirement import ( + BetaSessionServiceUserVerificationRequirement as BetaSessionServiceUserVerificationRequirement, +) +from zitadel_client.models.beta_session_service_web_auth_n import ( + BetaSessionServiceWebAuthN as BetaSessionServiceWebAuthN, +) +from zitadel_client.models.beta_session_service_web_auth_n_factor import ( + BetaSessionServiceWebAuthNFactor as BetaSessionServiceWebAuthNFactor, +) +from zitadel_client.models.beta_settings_service_any import ( + BetaSettingsServiceAny as BetaSettingsServiceAny, +) +from zitadel_client.models.beta_settings_service_branding_settings import ( + BetaSettingsServiceBrandingSettings as BetaSettingsServiceBrandingSettings, +) +from zitadel_client.models.beta_settings_service_connect_error import ( + BetaSettingsServiceConnectError as BetaSettingsServiceConnectError, +) +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails as BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_domain_settings import ( + BetaSettingsServiceDomainSettings as BetaSettingsServiceDomainSettings, +) +from zitadel_client.models.beta_settings_service_embedded_iframe_settings import ( + BetaSettingsServiceEmbeddedIframeSettings as BetaSettingsServiceEmbeddedIframeSettings, +) +from zitadel_client.models.beta_settings_service_get_active_identity_providers_request import ( + BetaSettingsServiceGetActiveIdentityProvidersRequest as BetaSettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.beta_settings_service_get_active_identity_providers_response import ( + BetaSettingsServiceGetActiveIdentityProvidersResponse as BetaSettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_request import ( + BetaSettingsServiceGetBrandingSettingsRequest as BetaSettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_response import ( + BetaSettingsServiceGetBrandingSettingsResponse as BetaSettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_request import ( + BetaSettingsServiceGetDomainSettingsRequest as BetaSettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_response import ( + BetaSettingsServiceGetDomainSettingsResponse as BetaSettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_general_settings_response import ( + BetaSettingsServiceGetGeneralSettingsResponse as BetaSettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_request import ( + BetaSettingsServiceGetLegalAndSupportSettingsRequest as BetaSettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_response import ( + BetaSettingsServiceGetLegalAndSupportSettingsResponse as BetaSettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_request import ( + BetaSettingsServiceGetLockoutSettingsRequest as BetaSettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_response import ( + BetaSettingsServiceGetLockoutSettingsResponse as BetaSettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_login_settings_request import ( + BetaSettingsServiceGetLoginSettingsRequest as BetaSettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_login_settings_response import ( + BetaSettingsServiceGetLoginSettingsResponse as BetaSettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_request import ( + BetaSettingsServiceGetPasswordComplexitySettingsRequest as BetaSettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_response import ( + BetaSettingsServiceGetPasswordComplexitySettingsResponse as BetaSettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_request import ( + BetaSettingsServiceGetPasswordExpirySettingsRequest as BetaSettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_response import ( + BetaSettingsServiceGetPasswordExpirySettingsResponse as BetaSettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_security_settings_response import ( + BetaSettingsServiceGetSecuritySettingsResponse as BetaSettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.beta_settings_service_identity_provider import ( + BetaSettingsServiceIdentityProvider as BetaSettingsServiceIdentityProvider, +) +from zitadel_client.models.beta_settings_service_identity_provider_type import ( + BetaSettingsServiceIdentityProviderType as BetaSettingsServiceIdentityProviderType, +) +from zitadel_client.models.beta_settings_service_legal_and_support_settings import ( + BetaSettingsServiceLegalAndSupportSettings as BetaSettingsServiceLegalAndSupportSettings, +) +from zitadel_client.models.beta_settings_service_list_details import ( + BetaSettingsServiceListDetails as BetaSettingsServiceListDetails, +) +from zitadel_client.models.beta_settings_service_lockout_settings import ( + BetaSettingsServiceLockoutSettings as BetaSettingsServiceLockoutSettings, +) +from zitadel_client.models.beta_settings_service_login_settings import ( + BetaSettingsServiceLoginSettings as BetaSettingsServiceLoginSettings, +) +from zitadel_client.models.beta_settings_service_multi_factor_type import ( + BetaSettingsServiceMultiFactorType as BetaSettingsServiceMultiFactorType, +) +from zitadel_client.models.beta_settings_service_passkeys_type import ( + BetaSettingsServicePasskeysType as BetaSettingsServicePasskeysType, +) +from zitadel_client.models.beta_settings_service_password_complexity_settings import ( + BetaSettingsServicePasswordComplexitySettings as BetaSettingsServicePasswordComplexitySettings, +) +from zitadel_client.models.beta_settings_service_password_expiry_settings import ( + BetaSettingsServicePasswordExpirySettings as BetaSettingsServicePasswordExpirySettings, +) +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext as BetaSettingsServiceRequestContext, +) +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType as BetaSettingsServiceResourceOwnerType, +) +from zitadel_client.models.beta_settings_service_second_factor_type import ( + BetaSettingsServiceSecondFactorType as BetaSettingsServiceSecondFactorType, +) +from zitadel_client.models.beta_settings_service_security_settings import ( + BetaSettingsServiceSecuritySettings as BetaSettingsServiceSecuritySettings, +) +from zitadel_client.models.beta_settings_service_set_security_settings_request import ( + BetaSettingsServiceSetSecuritySettingsRequest as BetaSettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.beta_settings_service_set_security_settings_response import ( + BetaSettingsServiceSetSecuritySettingsResponse as BetaSettingsServiceSetSecuritySettingsResponse, +) +from zitadel_client.models.beta_settings_service_theme import ( + BetaSettingsServiceTheme as BetaSettingsServiceTheme, +) +from zitadel_client.models.beta_settings_service_theme_mode import ( + BetaSettingsServiceThemeMode as BetaSettingsServiceThemeMode, +) +from zitadel_client.models.beta_telemetry_service_any import ( + BetaTelemetryServiceAny as BetaTelemetryServiceAny, +) +from zitadel_client.models.beta_telemetry_service_connect_error import ( + BetaTelemetryServiceConnectError as BetaTelemetryServiceConnectError, +) +from zitadel_client.models.beta_telemetry_service_count_parent_type import ( + BetaTelemetryServiceCountParentType as BetaTelemetryServiceCountParentType, +) +from zitadel_client.models.beta_telemetry_service_instance_information import ( + BetaTelemetryServiceInstanceInformation as BetaTelemetryServiceInstanceInformation, +) +from zitadel_client.models.beta_telemetry_service_report_base_information_request import ( + BetaTelemetryServiceReportBaseInformationRequest as BetaTelemetryServiceReportBaseInformationRequest, +) +from zitadel_client.models.beta_telemetry_service_report_base_information_response import ( + BetaTelemetryServiceReportBaseInformationResponse as BetaTelemetryServiceReportBaseInformationResponse, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_request import ( + BetaTelemetryServiceReportResourceCountsRequest as BetaTelemetryServiceReportResourceCountsRequest, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_response import ( + BetaTelemetryServiceReportResourceCountsResponse as BetaTelemetryServiceReportResourceCountsResponse, +) +from zitadel_client.models.beta_telemetry_service_resource_count import ( + BetaTelemetryServiceResourceCount as BetaTelemetryServiceResourceCount, +) +from zitadel_client.models.beta_user_service_access_token_type import ( + BetaUserServiceAccessTokenType as BetaUserServiceAccessTokenType, +) +from zitadel_client.models.beta_user_service_add_human_user_request import ( + BetaUserServiceAddHumanUserRequest as BetaUserServiceAddHumanUserRequest, +) +from zitadel_client.models.beta_user_service_add_human_user_response import ( + BetaUserServiceAddHumanUserResponse as BetaUserServiceAddHumanUserResponse, +) +from zitadel_client.models.beta_user_service_add_idp_link_request import ( + BetaUserServiceAddIDPLinkRequest as BetaUserServiceAddIDPLinkRequest, +) +from zitadel_client.models.beta_user_service_add_idp_link_response import ( + BetaUserServiceAddIDPLinkResponse as BetaUserServiceAddIDPLinkResponse, +) +from zitadel_client.models.beta_user_service_add_otp_email_request import ( + BetaUserServiceAddOTPEmailRequest as BetaUserServiceAddOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_add_otp_email_response import ( + BetaUserServiceAddOTPEmailResponse as BetaUserServiceAddOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_add_otpsms_request import ( + BetaUserServiceAddOTPSMSRequest as BetaUserServiceAddOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_add_otpsms_response import ( + BetaUserServiceAddOTPSMSResponse as BetaUserServiceAddOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_and_query import ( + BetaUserServiceAndQuery as BetaUserServiceAndQuery, +) +from zitadel_client.models.beta_user_service_any import ( + BetaUserServiceAny as BetaUserServiceAny, +) +from zitadel_client.models.beta_user_service_authentication_method_type import ( + BetaUserServiceAuthenticationMethodType as BetaUserServiceAuthenticationMethodType, +) +from zitadel_client.models.beta_user_service_connect_error import ( + BetaUserServiceConnectError as BetaUserServiceConnectError, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_request import ( + BetaUserServiceCreatePasskeyRegistrationLinkRequest as BetaUserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_response import ( + BetaUserServiceCreatePasskeyRegistrationLinkResponse as BetaUserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.beta_user_service_deactivate_user_request import ( + BetaUserServiceDeactivateUserRequest as BetaUserServiceDeactivateUserRequest, +) +from zitadel_client.models.beta_user_service_deactivate_user_response import ( + BetaUserServiceDeactivateUserResponse as BetaUserServiceDeactivateUserResponse, +) +from zitadel_client.models.beta_user_service_delete_user_request import ( + BetaUserServiceDeleteUserRequest as BetaUserServiceDeleteUserRequest, +) +from zitadel_client.models.beta_user_service_delete_user_response import ( + BetaUserServiceDeleteUserResponse as BetaUserServiceDeleteUserResponse, +) +from zitadel_client.models.beta_user_service_details import ( + BetaUserServiceDetails as BetaUserServiceDetails, +) +from zitadel_client.models.beta_user_service_display_name_query import ( + BetaUserServiceDisplayNameQuery as BetaUserServiceDisplayNameQuery, +) +from zitadel_client.models.beta_user_service_email_query import ( + BetaUserServiceEmailQuery as BetaUserServiceEmailQuery, +) +from zitadel_client.models.beta_user_service_first_name_query import ( + BetaUserServiceFirstNameQuery as BetaUserServiceFirstNameQuery, +) +from zitadel_client.models.beta_user_service_form_data import ( + BetaUserServiceFormData as BetaUserServiceFormData, +) +from zitadel_client.models.beta_user_service_gender import ( + BetaUserServiceGender as BetaUserServiceGender, +) +from zitadel_client.models.beta_user_service_get_user_by_id_request import ( + BetaUserServiceGetUserByIDRequest as BetaUserServiceGetUserByIDRequest, +) +from zitadel_client.models.beta_user_service_get_user_by_id_response import ( + BetaUserServiceGetUserByIDResponse as BetaUserServiceGetUserByIDResponse, +) +from zitadel_client.models.beta_user_service_hashed_password import ( + BetaUserServiceHashedPassword as BetaUserServiceHashedPassword, +) +from zitadel_client.models.beta_user_service_human_email import ( + BetaUserServiceHumanEmail as BetaUserServiceHumanEmail, +) +from zitadel_client.models.beta_user_service_human_phone import ( + BetaUserServiceHumanPhone as BetaUserServiceHumanPhone, +) +from zitadel_client.models.beta_user_service_human_profile import ( + BetaUserServiceHumanProfile as BetaUserServiceHumanProfile, +) +from zitadel_client.models.beta_user_service_human_user import ( + BetaUserServiceHumanUser as BetaUserServiceHumanUser, +) +from zitadel_client.models.beta_user_service_idp_information import ( + BetaUserServiceIDPInformation as BetaUserServiceIDPInformation, +) +from zitadel_client.models.beta_user_service_idp_intent import ( + BetaUserServiceIDPIntent as BetaUserServiceIDPIntent, +) +from zitadel_client.models.beta_user_service_idpldap_access_information import ( + BetaUserServiceIDPLDAPAccessInformation as BetaUserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.beta_user_service_idp_link import ( + BetaUserServiceIDPLink as BetaUserServiceIDPLink, +) +from zitadel_client.models.beta_user_service_idpo_auth_access_information import ( + BetaUserServiceIDPOAuthAccessInformation as BetaUserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.beta_user_service_idpsaml_access_information import ( + BetaUserServiceIDPSAMLAccessInformation as BetaUserServiceIDPSAMLAccessInformation, +) +from zitadel_client.models.beta_user_service_in_user_emails_query import ( + BetaUserServiceInUserEmailsQuery as BetaUserServiceInUserEmailsQuery, +) +from zitadel_client.models.beta_user_service_in_user_id_query import ( + BetaUserServiceInUserIDQuery as BetaUserServiceInUserIDQuery, +) +from zitadel_client.models.beta_user_service_ldap_credentials import ( + BetaUserServiceLDAPCredentials as BetaUserServiceLDAPCredentials, +) +from zitadel_client.models.beta_user_service_last_name_query import ( + BetaUserServiceLastNameQuery as BetaUserServiceLastNameQuery, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_request import ( + BetaUserServiceListAuthenticationMethodTypesRequest as BetaUserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_response import ( + BetaUserServiceListAuthenticationMethodTypesResponse as BetaUserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.beta_user_service_list_details import ( + BetaUserServiceListDetails as BetaUserServiceListDetails, +) +from zitadel_client.models.beta_user_service_list_query import ( + BetaUserServiceListQuery as BetaUserServiceListQuery, +) +from zitadel_client.models.beta_user_service_list_users_request import ( + BetaUserServiceListUsersRequest as BetaUserServiceListUsersRequest, +) +from zitadel_client.models.beta_user_service_list_users_response import ( + BetaUserServiceListUsersResponse as BetaUserServiceListUsersResponse, +) +from zitadel_client.models.beta_user_service_lock_user_request import ( + BetaUserServiceLockUserRequest as BetaUserServiceLockUserRequest, +) +from zitadel_client.models.beta_user_service_lock_user_response import ( + BetaUserServiceLockUserResponse as BetaUserServiceLockUserResponse, +) +from zitadel_client.models.beta_user_service_login_name_query import ( + BetaUserServiceLoginNameQuery as BetaUserServiceLoginNameQuery, +) +from zitadel_client.models.beta_user_service_machine_user import ( + BetaUserServiceMachineUser as BetaUserServiceMachineUser, +) +from zitadel_client.models.beta_user_service_nick_name_query import ( + BetaUserServiceNickNameQuery as BetaUserServiceNickNameQuery, +) +from zitadel_client.models.beta_user_service_not_query import ( + BetaUserServiceNotQuery as BetaUserServiceNotQuery, +) +from zitadel_client.models.beta_user_service_notification_type import ( + BetaUserServiceNotificationType as BetaUserServiceNotificationType, +) +from zitadel_client.models.beta_user_service_or_query import ( + BetaUserServiceOrQuery as BetaUserServiceOrQuery, +) +from zitadel_client.models.beta_user_service_organization import ( + BetaUserServiceOrganization as BetaUserServiceOrganization, +) +from zitadel_client.models.beta_user_service_organization_id_query import ( + BetaUserServiceOrganizationIdQuery as BetaUserServiceOrganizationIdQuery, +) +from zitadel_client.models.beta_user_service_passkey_authenticator import ( + BetaUserServicePasskeyAuthenticator as BetaUserServicePasskeyAuthenticator, +) +from zitadel_client.models.beta_user_service_passkey_registration_code import ( + BetaUserServicePasskeyRegistrationCode as BetaUserServicePasskeyRegistrationCode, +) +from zitadel_client.models.beta_user_service_password import ( + BetaUserServicePassword as BetaUserServicePassword, +) +from zitadel_client.models.beta_user_service_password_reset_request import ( + BetaUserServicePasswordResetRequest as BetaUserServicePasswordResetRequest, +) +from zitadel_client.models.beta_user_service_password_reset_response import ( + BetaUserServicePasswordResetResponse as BetaUserServicePasswordResetResponse, +) +from zitadel_client.models.beta_user_service_phone_query import ( + BetaUserServicePhoneQuery as BetaUserServicePhoneQuery, +) +from zitadel_client.models.beta_user_service_reactivate_user_request import ( + BetaUserServiceReactivateUserRequest as BetaUserServiceReactivateUserRequest, +) +from zitadel_client.models.beta_user_service_reactivate_user_response import ( + BetaUserServiceReactivateUserResponse as BetaUserServiceReactivateUserResponse, +) +from zitadel_client.models.beta_user_service_redirect_urls import ( + BetaUserServiceRedirectURLs as BetaUserServiceRedirectURLs, +) +from zitadel_client.models.beta_user_service_register_passkey_request import ( + BetaUserServiceRegisterPasskeyRequest as BetaUserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.beta_user_service_register_passkey_response import ( + BetaUserServiceRegisterPasskeyResponse as BetaUserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.beta_user_service_register_totp_request import ( + BetaUserServiceRegisterTOTPRequest as BetaUserServiceRegisterTOTPRequest, +) +from zitadel_client.models.beta_user_service_register_totp_response import ( + BetaUserServiceRegisterTOTPResponse as BetaUserServiceRegisterTOTPResponse, +) +from zitadel_client.models.beta_user_service_register_u2_f_request import ( + BetaUserServiceRegisterU2FRequest as BetaUserServiceRegisterU2FRequest, +) +from zitadel_client.models.beta_user_service_register_u2_f_response import ( + BetaUserServiceRegisterU2FResponse as BetaUserServiceRegisterU2FResponse, +) +from zitadel_client.models.beta_user_service_remove_otp_email_request import ( + BetaUserServiceRemoveOTPEmailRequest as BetaUserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_remove_otp_email_response import ( + BetaUserServiceRemoveOTPEmailResponse as BetaUserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_remove_otpsms_request import ( + BetaUserServiceRemoveOTPSMSRequest as BetaUserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_remove_otpsms_response import ( + BetaUserServiceRemoveOTPSMSResponse as BetaUserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_remove_phone_request import ( + BetaUserServiceRemovePhoneRequest as BetaUserServiceRemovePhoneRequest, +) +from zitadel_client.models.beta_user_service_remove_phone_response import ( + BetaUserServiceRemovePhoneResponse as BetaUserServiceRemovePhoneResponse, +) +from zitadel_client.models.beta_user_service_remove_totp_request import ( + BetaUserServiceRemoveTOTPRequest as BetaUserServiceRemoveTOTPRequest, +) +from zitadel_client.models.beta_user_service_remove_totp_response import ( + BetaUserServiceRemoveTOTPResponse as BetaUserServiceRemoveTOTPResponse, +) +from zitadel_client.models.beta_user_service_resend_email_code_request import ( + BetaUserServiceResendEmailCodeRequest as BetaUserServiceResendEmailCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_email_code_response import ( + BetaUserServiceResendEmailCodeResponse as BetaUserServiceResendEmailCodeResponse, +) +from zitadel_client.models.beta_user_service_resend_phone_code_request import ( + BetaUserServiceResendPhoneCodeRequest as BetaUserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_phone_code_response import ( + BetaUserServiceResendPhoneCodeResponse as BetaUserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_request import ( + BetaUserServiceRetrieveIdentityProviderIntentRequest as BetaUserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_response import ( + BetaUserServiceRetrieveIdentityProviderIntentResponse as BetaUserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery as BetaUserServiceSearchQuery, +) +from zitadel_client.models.beta_user_service_send_email_verification_code import ( + BetaUserServiceSendEmailVerificationCode as BetaUserServiceSendEmailVerificationCode, +) +from zitadel_client.models.beta_user_service_send_passkey_registration_link import ( + BetaUserServiceSendPasskeyRegistrationLink as BetaUserServiceSendPasskeyRegistrationLink, +) +from zitadel_client.models.beta_user_service_send_password_reset_link import ( + BetaUserServiceSendPasswordResetLink as BetaUserServiceSendPasswordResetLink, +) +from zitadel_client.models.beta_user_service_set_email_request import ( + BetaUserServiceSetEmailRequest as BetaUserServiceSetEmailRequest, +) +from zitadel_client.models.beta_user_service_set_email_response import ( + BetaUserServiceSetEmailResponse as BetaUserServiceSetEmailResponse, +) +from zitadel_client.models.beta_user_service_set_human_email import ( + BetaUserServiceSetHumanEmail as BetaUserServiceSetHumanEmail, +) +from zitadel_client.models.beta_user_service_set_human_phone import ( + BetaUserServiceSetHumanPhone as BetaUserServiceSetHumanPhone, +) +from zitadel_client.models.beta_user_service_set_human_profile import ( + BetaUserServiceSetHumanProfile as BetaUserServiceSetHumanProfile, +) +from zitadel_client.models.beta_user_service_set_metadata_entry import ( + BetaUserServiceSetMetadataEntry as BetaUserServiceSetMetadataEntry, +) +from zitadel_client.models.beta_user_service_set_password import ( + BetaUserServiceSetPassword as BetaUserServiceSetPassword, +) +from zitadel_client.models.beta_user_service_set_password_request import ( + BetaUserServiceSetPasswordRequest as BetaUserServiceSetPasswordRequest, +) +from zitadel_client.models.beta_user_service_set_password_response import ( + BetaUserServiceSetPasswordResponse as BetaUserServiceSetPasswordResponse, +) +from zitadel_client.models.beta_user_service_set_phone_request import ( + BetaUserServiceSetPhoneRequest as BetaUserServiceSetPhoneRequest, +) +from zitadel_client.models.beta_user_service_set_phone_response import ( + BetaUserServiceSetPhoneResponse as BetaUserServiceSetPhoneResponse, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_request import ( + BetaUserServiceStartIdentityProviderIntentRequest as BetaUserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_response import ( + BetaUserServiceStartIdentityProviderIntentResponse as BetaUserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_state_query import ( + BetaUserServiceStateQuery as BetaUserServiceStateQuery, +) +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod as BetaUserServiceTextQueryMethod, +) +from zitadel_client.models.beta_user_service_type import ( + BetaUserServiceType as BetaUserServiceType, +) +from zitadel_client.models.beta_user_service_type_query import ( + BetaUserServiceTypeQuery as BetaUserServiceTypeQuery, +) +from zitadel_client.models.beta_user_service_unlock_user_request import ( + BetaUserServiceUnlockUserRequest as BetaUserServiceUnlockUserRequest, +) +from zitadel_client.models.beta_user_service_unlock_user_response import ( + BetaUserServiceUnlockUserResponse as BetaUserServiceUnlockUserResponse, +) +from zitadel_client.models.beta_user_service_update_human_user_request import ( + BetaUserServiceUpdateHumanUserRequest as BetaUserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.beta_user_service_update_human_user_response import ( + BetaUserServiceUpdateHumanUserResponse as BetaUserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.beta_user_service_user import ( + BetaUserServiceUser as BetaUserServiceUser, +) +from zitadel_client.models.beta_user_service_user_field_name import ( + BetaUserServiceUserFieldName as BetaUserServiceUserFieldName, +) +from zitadel_client.models.beta_user_service_user_name_query import ( + BetaUserServiceUserNameQuery as BetaUserServiceUserNameQuery, +) +from zitadel_client.models.beta_user_service_user_state import ( + BetaUserServiceUserState as BetaUserServiceUserState, +) +from zitadel_client.models.beta_user_service_verify_email_request import ( + BetaUserServiceVerifyEmailRequest as BetaUserServiceVerifyEmailRequest, +) +from zitadel_client.models.beta_user_service_verify_email_response import ( + BetaUserServiceVerifyEmailResponse as BetaUserServiceVerifyEmailResponse, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_request import ( + BetaUserServiceVerifyPasskeyRegistrationRequest as BetaUserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_response import ( + BetaUserServiceVerifyPasskeyRegistrationResponse as BetaUserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_phone_request import ( + BetaUserServiceVerifyPhoneRequest as BetaUserServiceVerifyPhoneRequest, +) +from zitadel_client.models.beta_user_service_verify_phone_response import ( + BetaUserServiceVerifyPhoneResponse as BetaUserServiceVerifyPhoneResponse, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_request import ( + BetaUserServiceVerifyTOTPRegistrationRequest as BetaUserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_response import ( + BetaUserServiceVerifyTOTPRegistrationResponse as BetaUserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_request import ( + BetaUserServiceVerifyU2FRegistrationRequest as BetaUserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_response import ( + BetaUserServiceVerifyU2FRegistrationResponse as BetaUserServiceVerifyU2FRegistrationResponse, +) +from zitadel_client.models.beta_web_key_service_activate_web_key_request import ( + BetaWebKeyServiceActivateWebKeyRequest as BetaWebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_activate_web_key_response import ( + BetaWebKeyServiceActivateWebKeyResponse as BetaWebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_any import ( + BetaWebKeyServiceAny as BetaWebKeyServiceAny, +) +from zitadel_client.models.beta_web_key_service_connect_error import ( + BetaWebKeyServiceConnectError as BetaWebKeyServiceConnectError, +) +from zitadel_client.models.beta_web_key_service_create_web_key_request import ( + BetaWebKeyServiceCreateWebKeyRequest as BetaWebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_create_web_key_response import ( + BetaWebKeyServiceCreateWebKeyResponse as BetaWebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_request import ( + BetaWebKeyServiceDeleteWebKeyRequest as BetaWebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_response import ( + BetaWebKeyServiceDeleteWebKeyResponse as BetaWebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_ecdsa import ( + BetaWebKeyServiceECDSA as BetaWebKeyServiceECDSA, +) +from zitadel_client.models.beta_web_key_service_ecdsa_curve import ( + BetaWebKeyServiceECDSACurve as BetaWebKeyServiceECDSACurve, +) +from zitadel_client.models.beta_web_key_service_list_web_keys_response import ( + BetaWebKeyServiceListWebKeysResponse as BetaWebKeyServiceListWebKeysResponse, +) +from zitadel_client.models.beta_web_key_service_rsa import ( + BetaWebKeyServiceRSA as BetaWebKeyServiceRSA, +) +from zitadel_client.models.beta_web_key_service_rsa_bits import ( + BetaWebKeyServiceRSABits as BetaWebKeyServiceRSABits, +) +from zitadel_client.models.beta_web_key_service_rsa_hasher import ( + BetaWebKeyServiceRSAHasher as BetaWebKeyServiceRSAHasher, +) +from zitadel_client.models.beta_web_key_service_state import ( + BetaWebKeyServiceState as BetaWebKeyServiceState, +) +from zitadel_client.models.beta_web_key_service_web_key import ( + BetaWebKeyServiceWebKey as BetaWebKeyServiceWebKey, +) +from zitadel_client.models.feature_service_any import ( + FeatureServiceAny as FeatureServiceAny, +) +from zitadel_client.models.feature_service_connect_error import ( + FeatureServiceConnectError as FeatureServiceConnectError, +) +from zitadel_client.models.feature_service_details import ( + FeatureServiceDetails as FeatureServiceDetails, +) +from zitadel_client.models.feature_service_feature_flag import ( + FeatureServiceFeatureFlag as FeatureServiceFeatureFlag, +) +from zitadel_client.models.feature_service_get_instance_features_request import ( + FeatureServiceGetInstanceFeaturesRequest as FeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_get_instance_features_response import ( + FeatureServiceGetInstanceFeaturesResponse as FeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_get_organization_features_request import ( + FeatureServiceGetOrganizationFeaturesRequest as FeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_get_organization_features_response import ( + FeatureServiceGetOrganizationFeaturesResponse as FeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_get_system_features_response import ( + FeatureServiceGetSystemFeaturesResponse as FeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_get_user_features_request import ( + FeatureServiceGetUserFeaturesRequest as FeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_get_user_features_response import ( + FeatureServiceGetUserFeaturesResponse as FeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_improved_performance import ( + FeatureServiceImprovedPerformance as FeatureServiceImprovedPerformance, +) +from zitadel_client.models.feature_service_improved_performance_feature_flag import ( + FeatureServiceImprovedPerformanceFeatureFlag as FeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.feature_service_login_v2 import ( + FeatureServiceLoginV2 as FeatureServiceLoginV2, +) +from zitadel_client.models.feature_service_login_v2_feature_flag import ( + FeatureServiceLoginV2FeatureFlag as FeatureServiceLoginV2FeatureFlag, +) +from zitadel_client.models.feature_service_reset_instance_features_response import ( + FeatureServiceResetInstanceFeaturesResponse as FeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_organization_features_request import ( + FeatureServiceResetOrganizationFeaturesRequest as FeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_organization_features_response import ( + FeatureServiceResetOrganizationFeaturesResponse as FeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_system_features_response import ( + FeatureServiceResetSystemFeaturesResponse as FeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_user_features_request import ( + FeatureServiceResetUserFeaturesRequest as FeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_user_features_response import ( + FeatureServiceResetUserFeaturesResponse as FeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_set_instance_features_request import ( + FeatureServiceSetInstanceFeaturesRequest as FeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_set_instance_features_response import ( + FeatureServiceSetInstanceFeaturesResponse as FeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_set_organization_features_request import ( + FeatureServiceSetOrganizationFeaturesRequest as FeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_set_organization_features_response import ( + FeatureServiceSetOrganizationFeaturesResponse as FeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_set_system_features_request import ( + FeatureServiceSetSystemFeaturesRequest as FeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.feature_service_set_system_features_response import ( + FeatureServiceSetSystemFeaturesResponse as FeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_set_user_feature_request import ( + FeatureServiceSetUserFeatureRequest as FeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.feature_service_set_user_features_response import ( + FeatureServiceSetUserFeaturesResponse as FeatureServiceSetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_source import ( + FeatureServiceSource as FeatureServiceSource, +) +from zitadel_client.models.identity_provider_service_any import ( + IdentityProviderServiceAny as IdentityProviderServiceAny, +) +from zitadel_client.models.identity_provider_service_apple_config import ( + IdentityProviderServiceAppleConfig as IdentityProviderServiceAppleConfig, +) +from zitadel_client.models.identity_provider_service_auto_linking_option import ( + IdentityProviderServiceAutoLinkingOption as IdentityProviderServiceAutoLinkingOption, +) +from zitadel_client.models.identity_provider_service_azure_ad_config import ( + IdentityProviderServiceAzureADConfig as IdentityProviderServiceAzureADConfig, +) +from zitadel_client.models.identity_provider_service_azure_ad_tenant import ( + IdentityProviderServiceAzureADTenant as IdentityProviderServiceAzureADTenant, +) +from zitadel_client.models.identity_provider_service_azure_ad_tenant_type import ( + IdentityProviderServiceAzureADTenantType as IdentityProviderServiceAzureADTenantType, +) +from zitadel_client.models.identity_provider_service_connect_error import ( + IdentityProviderServiceConnectError as IdentityProviderServiceConnectError, +) +from zitadel_client.models.identity_provider_service_details import ( + IdentityProviderServiceDetails as IdentityProviderServiceDetails, +) +from zitadel_client.models.identity_provider_service_generic_oidc_config import ( + IdentityProviderServiceGenericOIDCConfig as IdentityProviderServiceGenericOIDCConfig, +) +from zitadel_client.models.identity_provider_service_get_idpby_id_request import ( + IdentityProviderServiceGetIDPByIDRequest as IdentityProviderServiceGetIDPByIDRequest, +) +from zitadel_client.models.identity_provider_service_get_idpby_id_response import ( + IdentityProviderServiceGetIDPByIDResponse as IdentityProviderServiceGetIDPByIDResponse, +) +from zitadel_client.models.identity_provider_service_git_hub_config import ( + IdentityProviderServiceGitHubConfig as IdentityProviderServiceGitHubConfig, +) +from zitadel_client.models.identity_provider_service_git_hub_enterprise_server_config import ( + IdentityProviderServiceGitHubEnterpriseServerConfig as IdentityProviderServiceGitHubEnterpriseServerConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_config import ( + IdentityProviderServiceGitLabConfig as IdentityProviderServiceGitLabConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_self_hosted_config import ( + IdentityProviderServiceGitLabSelfHostedConfig as IdentityProviderServiceGitLabSelfHostedConfig, +) +from zitadel_client.models.identity_provider_service_google_config import ( + IdentityProviderServiceGoogleConfig as IdentityProviderServiceGoogleConfig, +) +from zitadel_client.models.identity_provider_service_idp import ( + IdentityProviderServiceIDP as IdentityProviderServiceIDP, +) +from zitadel_client.models.identity_provider_service_idp_config import ( + IdentityProviderServiceIDPConfig as IdentityProviderServiceIDPConfig, +) +from zitadel_client.models.identity_provider_service_idp_state import ( + IdentityProviderServiceIDPState as IdentityProviderServiceIDPState, +) +from zitadel_client.models.identity_provider_service_idp_type import ( + IdentityProviderServiceIDPType as IdentityProviderServiceIDPType, +) +from zitadel_client.models.identity_provider_service_jwt_config import ( + IdentityProviderServiceJWTConfig as IdentityProviderServiceJWTConfig, +) +from zitadel_client.models.identity_provider_service_ldap_attributes import ( + IdentityProviderServiceLDAPAttributes as IdentityProviderServiceLDAPAttributes, +) +from zitadel_client.models.identity_provider_service_ldap_config import ( + IdentityProviderServiceLDAPConfig as IdentityProviderServiceLDAPConfig, +) +from zitadel_client.models.identity_provider_service_o_auth_config import ( + IdentityProviderServiceOAuthConfig as IdentityProviderServiceOAuthConfig, +) +from zitadel_client.models.identity_provider_service_options import ( + IdentityProviderServiceOptions as IdentityProviderServiceOptions, +) +from zitadel_client.models.identity_provider_service_saml_binding import ( + IdentityProviderServiceSAMLBinding as IdentityProviderServiceSAMLBinding, +) +from zitadel_client.models.identity_provider_service_saml_config import ( + IdentityProviderServiceSAMLConfig as IdentityProviderServiceSAMLConfig, +) +from zitadel_client.models.identity_provider_service_saml_name_id_format import ( + IdentityProviderServiceSAMLNameIDFormat as IdentityProviderServiceSAMLNameIDFormat, +) +from zitadel_client.models.identity_provider_service_saml_signature_algorithm import ( + IdentityProviderServiceSAMLSignatureAlgorithm as IdentityProviderServiceSAMLSignatureAlgorithm, +) +from zitadel_client.models.instance_service_add_custom_domain_request import ( + InstanceServiceAddCustomDomainRequest as InstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.instance_service_add_custom_domain_response import ( + InstanceServiceAddCustomDomainResponse as InstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.instance_service_add_trusted_domain_request import ( + InstanceServiceAddTrustedDomainRequest as InstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.instance_service_add_trusted_domain_response import ( + InstanceServiceAddTrustedDomainResponse as InstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.instance_service_any import ( + InstanceServiceAny as InstanceServiceAny, +) +from zitadel_client.models.instance_service_connect_error import ( + InstanceServiceConnectError as InstanceServiceConnectError, +) +from zitadel_client.models.instance_service_custom_domain import ( + InstanceServiceCustomDomain as InstanceServiceCustomDomain, +) +from zitadel_client.models.instance_service_custom_domain_filter import ( + InstanceServiceCustomDomainFilter as InstanceServiceCustomDomainFilter, +) +from zitadel_client.models.instance_service_custom_domains_filter import ( + InstanceServiceCustomDomainsFilter as InstanceServiceCustomDomainsFilter, +) +from zitadel_client.models.instance_service_delete_instance_request import ( + InstanceServiceDeleteInstanceRequest as InstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.instance_service_delete_instance_response import ( + InstanceServiceDeleteInstanceResponse as InstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.instance_service_domain_field_name import ( + InstanceServiceDomainFieldName as InstanceServiceDomainFieldName, +) +from zitadel_client.models.instance_service_domain_filter import ( + InstanceServiceDomainFilter as InstanceServiceDomainFilter, +) +from zitadel_client.models.instance_service_field_name import ( + InstanceServiceFieldName as InstanceServiceFieldName, +) +from zitadel_client.models.instance_service_filter import ( + InstanceServiceFilter as InstanceServiceFilter, +) +from zitadel_client.models.instance_service_get_instance_request import ( + InstanceServiceGetInstanceRequest as InstanceServiceGetInstanceRequest, +) +from zitadel_client.models.instance_service_get_instance_response import ( + InstanceServiceGetInstanceResponse as InstanceServiceGetInstanceResponse, +) +from zitadel_client.models.instance_service_in_ids_filter import ( + InstanceServiceInIDsFilter as InstanceServiceInIDsFilter, +) +from zitadel_client.models.instance_service_instance import ( + InstanceServiceInstance as InstanceServiceInstance, +) +from zitadel_client.models.instance_service_list_custom_domains_request import ( + InstanceServiceListCustomDomainsRequest as InstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.instance_service_list_custom_domains_response import ( + InstanceServiceListCustomDomainsResponse as InstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.instance_service_list_instances_request import ( + InstanceServiceListInstancesRequest as InstanceServiceListInstancesRequest, +) +from zitadel_client.models.instance_service_list_instances_response import ( + InstanceServiceListInstancesResponse as InstanceServiceListInstancesResponse, +) +from zitadel_client.models.instance_service_list_trusted_domains_request import ( + InstanceServiceListTrustedDomainsRequest as InstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.instance_service_list_trusted_domains_response import ( + InstanceServiceListTrustedDomainsResponse as InstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.instance_service_pagination_request import ( + InstanceServicePaginationRequest as InstanceServicePaginationRequest, +) +from zitadel_client.models.instance_service_pagination_response import ( + InstanceServicePaginationResponse as InstanceServicePaginationResponse, +) +from zitadel_client.models.instance_service_remove_custom_domain_request import ( + InstanceServiceRemoveCustomDomainRequest as InstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.instance_service_remove_custom_domain_response import ( + InstanceServiceRemoveCustomDomainResponse as InstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.instance_service_remove_trusted_domain_request import ( + InstanceServiceRemoveTrustedDomainRequest as InstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.instance_service_remove_trusted_domain_response import ( + InstanceServiceRemoveTrustedDomainResponse as InstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.instance_service_state import ( + InstanceServiceState as InstanceServiceState, +) +from zitadel_client.models.instance_service_text_query_method import ( + InstanceServiceTextQueryMethod as InstanceServiceTextQueryMethod, +) +from zitadel_client.models.instance_service_trusted_domain import ( + InstanceServiceTrustedDomain as InstanceServiceTrustedDomain, +) +from zitadel_client.models.instance_service_trusted_domain_field_name import ( + InstanceServiceTrustedDomainFieldName as InstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.instance_service_trusted_domain_filter import ( + InstanceServiceTrustedDomainFilter as InstanceServiceTrustedDomainFilter, +) +from zitadel_client.models.instance_service_update_instance_request import ( + InstanceServiceUpdateInstanceRequest as InstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.instance_service_update_instance_response import ( + InstanceServiceUpdateInstanceResponse as InstanceServiceUpdateInstanceResponse, +) +from zitadel_client.models.internal_permission_service_administrator import ( + InternalPermissionServiceAdministrator as InternalPermissionServiceAdministrator, +) +from zitadel_client.models.internal_permission_service_administrator_field_name import ( + InternalPermissionServiceAdministratorFieldName as InternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter as InternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.internal_permission_service_and_filter import ( + InternalPermissionServiceAndFilter as InternalPermissionServiceAndFilter, +) +from zitadel_client.models.internal_permission_service_any import ( + InternalPermissionServiceAny as InternalPermissionServiceAny, +) +from zitadel_client.models.internal_permission_service_connect_error import ( + InternalPermissionServiceConnectError as InternalPermissionServiceConnectError, +) +from zitadel_client.models.internal_permission_service_create_administrator_request import ( + InternalPermissionServiceCreateAdministratorRequest as InternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_create_administrator_response import ( + InternalPermissionServiceCreateAdministratorResponse as InternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_delete_administrator_request import ( + InternalPermissionServiceDeleteAdministratorRequest as InternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_delete_administrator_response import ( + InternalPermissionServiceDeleteAdministratorResponse as InternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_id_filter import ( + InternalPermissionServiceIDFilter as InternalPermissionServiceIDFilter, +) +from zitadel_client.models.internal_permission_service_in_ids_filter import ( + InternalPermissionServiceInIDsFilter as InternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.internal_permission_service_list_administrators_request import ( + InternalPermissionServiceListAdministratorsRequest as InternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.internal_permission_service_list_administrators_response import ( + InternalPermissionServiceListAdministratorsResponse as InternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.internal_permission_service_not_filter import ( + InternalPermissionServiceNotFilter as InternalPermissionServiceNotFilter, +) +from zitadel_client.models.internal_permission_service_or_filter import ( + InternalPermissionServiceOrFilter as InternalPermissionServiceOrFilter, +) +from zitadel_client.models.internal_permission_service_organization import ( + InternalPermissionServiceOrganization as InternalPermissionServiceOrganization, +) +from zitadel_client.models.internal_permission_service_pagination_request import ( + InternalPermissionServicePaginationRequest as InternalPermissionServicePaginationRequest, +) +from zitadel_client.models.internal_permission_service_pagination_response import ( + InternalPermissionServicePaginationResponse as InternalPermissionServicePaginationResponse, +) +from zitadel_client.models.internal_permission_service_project import ( + InternalPermissionServiceProject as InternalPermissionServiceProject, +) +from zitadel_client.models.internal_permission_service_project_grant import ( + InternalPermissionServiceProjectGrant as InternalPermissionServiceProjectGrant, +) +from zitadel_client.models.internal_permission_service_resource_filter import ( + InternalPermissionServiceResourceFilter as InternalPermissionServiceResourceFilter, +) +from zitadel_client.models.internal_permission_service_resource_type import ( + InternalPermissionServiceResourceType as InternalPermissionServiceResourceType, +) +from zitadel_client.models.internal_permission_service_role_filter import ( + InternalPermissionServiceRoleFilter as InternalPermissionServiceRoleFilter, +) +from zitadel_client.models.internal_permission_service_text_filter_method import ( + InternalPermissionServiceTextFilterMethod as InternalPermissionServiceTextFilterMethod, +) +from zitadel_client.models.internal_permission_service_timestamp_filter import ( + InternalPermissionServiceTimestampFilter as InternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.internal_permission_service_timestamp_filter_method import ( + InternalPermissionServiceTimestampFilterMethod as InternalPermissionServiceTimestampFilterMethod, +) +from zitadel_client.models.internal_permission_service_update_administrator_request import ( + InternalPermissionServiceUpdateAdministratorRequest as InternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_update_administrator_response import ( + InternalPermissionServiceUpdateAdministratorResponse as InternalPermissionServiceUpdateAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_user import ( + InternalPermissionServiceUser as InternalPermissionServiceUser, +) +from zitadel_client.models.internal_permission_service_user_display_name_filter import ( + InternalPermissionServiceUserDisplayNameFilter as InternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.internal_permission_service_user_preferred_login_name_filter import ( + InternalPermissionServiceUserPreferredLoginNameFilter as InternalPermissionServiceUserPreferredLoginNameFilter, +) +from zitadel_client.models.oidc_service_any import ( + OIDCServiceAny as OIDCServiceAny, +) +from zitadel_client.models.oidc_service_auth_request import ( + OIDCServiceAuthRequest as OIDCServiceAuthRequest, +) +from zitadel_client.models.oidc_service_authorization_error import ( + OIDCServiceAuthorizationError as OIDCServiceAuthorizationError, +) +from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import ( + OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest as OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, +) +from zitadel_client.models.oidc_service_connect_error import ( + OIDCServiceConnectError as OIDCServiceConnectError, +) +from zitadel_client.models.oidc_service_create_callback_request import ( + OIDCServiceCreateCallbackRequest as OIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.oidc_service_create_callback_response import ( + OIDCServiceCreateCallbackResponse as OIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.oidc_service_details import ( + OIDCServiceDetails as OIDCServiceDetails, +) +from zitadel_client.models.oidc_service_device_authorization_request import ( + OIDCServiceDeviceAuthorizationRequest as OIDCServiceDeviceAuthorizationRequest, +) +from zitadel_client.models.oidc_service_error_reason import ( + OIDCServiceErrorReason as OIDCServiceErrorReason, +) +from zitadel_client.models.oidc_service_get_auth_request_request import ( + OIDCServiceGetAuthRequestRequest as OIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.oidc_service_get_auth_request_response import ( + OIDCServiceGetAuthRequestResponse as OIDCServiceGetAuthRequestResponse, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_request import ( + OIDCServiceGetDeviceAuthorizationRequestRequest as OIDCServiceGetDeviceAuthorizationRequestRequest, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_response import ( + OIDCServiceGetDeviceAuthorizationRequestResponse as OIDCServiceGetDeviceAuthorizationRequestResponse, +) +from zitadel_client.models.oidc_service_prompt import ( + OIDCServicePrompt as OIDCServicePrompt, +) +from zitadel_client.models.oidc_service_session import ( + OIDCServiceSession as OIDCServiceSession, +) +from zitadel_client.models.organization_service_activate_organization_request import ( + OrganizationServiceActivateOrganizationRequest as OrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.organization_service_activate_organization_response import ( + OrganizationServiceActivateOrganizationResponse as OrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.organization_service_add_human_user_request import ( + OrganizationServiceAddHumanUserRequest as OrganizationServiceAddHumanUserRequest, +) +from zitadel_client.models.organization_service_add_organization_domain_request import ( + OrganizationServiceAddOrganizationDomainRequest as OrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_add_organization_domain_response import ( + OrganizationServiceAddOrganizationDomainResponse as OrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_add_organization_request import ( + OrganizationServiceAddOrganizationRequest as OrganizationServiceAddOrganizationRequest, +) +from zitadel_client.models.organization_service_add_organization_response import ( + OrganizationServiceAddOrganizationResponse as OrganizationServiceAddOrganizationResponse, +) +from zitadel_client.models.organization_service_admin import ( + OrganizationServiceAdmin as OrganizationServiceAdmin, +) +from zitadel_client.models.organization_service_any import ( + OrganizationServiceAny as OrganizationServiceAny, +) +from zitadel_client.models.organization_service_connect_error import ( + OrganizationServiceConnectError as OrganizationServiceConnectError, +) +from zitadel_client.models.organization_service_created_admin import ( + OrganizationServiceCreatedAdmin as OrganizationServiceCreatedAdmin, +) +from zitadel_client.models.organization_service_deactivate_organization_request import ( + OrganizationServiceDeactivateOrganizationRequest as OrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.organization_service_deactivate_organization_response import ( + OrganizationServiceDeactivateOrganizationResponse as OrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.organization_service_delete_organization_domain_request import ( + OrganizationServiceDeleteOrganizationDomainRequest as OrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_delete_organization_domain_response import ( + OrganizationServiceDeleteOrganizationDomainResponse as OrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_delete_organization_metadata_request import ( + OrganizationServiceDeleteOrganizationMetadataRequest as OrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_delete_organization_metadata_response import ( + OrganizationServiceDeleteOrganizationMetadataResponse as OrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_delete_organization_request import ( + OrganizationServiceDeleteOrganizationRequest as OrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.organization_service_delete_organization_response import ( + OrganizationServiceDeleteOrganizationResponse as OrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.organization_service_details import ( + OrganizationServiceDetails as OrganizationServiceDetails, +) +from zitadel_client.models.organization_service_domain import ( + OrganizationServiceDomain as OrganizationServiceDomain, +) +from zitadel_client.models.organization_service_domain_field_name import ( + OrganizationServiceDomainFieldName as OrganizationServiceDomainFieldName, +) +from zitadel_client.models.organization_service_domain_search_filter import ( + OrganizationServiceDomainSearchFilter as OrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.organization_service_domain_validation_type import ( + OrganizationServiceDomainValidationType as OrganizationServiceDomainValidationType, +) +from zitadel_client.models.organization_service_gender import ( + OrganizationServiceGender as OrganizationServiceGender, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_request import ( + OrganizationServiceGenerateOrganizationDomainValidationRequest as OrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_response import ( + OrganizationServiceGenerateOrganizationDomainValidationResponse as OrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.organization_service_hashed_password import ( + OrganizationServiceHashedPassword as OrganizationServiceHashedPassword, +) +from zitadel_client.models.organization_service_idp_link import ( + OrganizationServiceIDPLink as OrganizationServiceIDPLink, +) +from zitadel_client.models.organization_service_list_details import ( + OrganizationServiceListDetails as OrganizationServiceListDetails, +) +from zitadel_client.models.organization_service_list_organization_domains_request import ( + OrganizationServiceListOrganizationDomainsRequest as OrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.organization_service_list_organization_domains_response import ( + OrganizationServiceListOrganizationDomainsResponse as OrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.organization_service_list_organization_metadata_request import ( + OrganizationServiceListOrganizationMetadataRequest as OrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_list_organization_metadata_response import ( + OrganizationServiceListOrganizationMetadataResponse as OrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_list_organizations_request import ( + OrganizationServiceListOrganizationsRequest as OrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.organization_service_list_organizations_response import ( + OrganizationServiceListOrganizationsResponse as OrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.organization_service_list_query import ( + OrganizationServiceListQuery as OrganizationServiceListQuery, +) +from zitadel_client.models.organization_service_metadata import ( + OrganizationServiceMetadata as OrganizationServiceMetadata, +) +from zitadel_client.models.organization_service_metadata_key_filter import ( + OrganizationServiceMetadataKeyFilter as OrganizationServiceMetadataKeyFilter, +) +from zitadel_client.models.organization_service_metadata_search_filter import ( + OrganizationServiceMetadataSearchFilter as OrganizationServiceMetadataSearchFilter, +) +from zitadel_client.models.organization_service_organization import ( + OrganizationServiceOrganization as OrganizationServiceOrganization, +) +from zitadel_client.models.organization_service_organization_domain_query import ( + OrganizationServiceOrganizationDomainQuery as OrganizationServiceOrganizationDomainQuery, +) +from zitadel_client.models.organization_service_organization_field_name import ( + OrganizationServiceOrganizationFieldName as OrganizationServiceOrganizationFieldName, +) +from zitadel_client.models.organization_service_organization_id_query import ( + OrganizationServiceOrganizationIDQuery as OrganizationServiceOrganizationIDQuery, +) +from zitadel_client.models.organization_service_organization_name_query import ( + OrganizationServiceOrganizationNameQuery as OrganizationServiceOrganizationNameQuery, +) +from zitadel_client.models.organization_service_organization_state import ( + OrganizationServiceOrganizationState as OrganizationServiceOrganizationState, +) +from zitadel_client.models.organization_service_organization_state_query import ( + OrganizationServiceOrganizationStateQuery as OrganizationServiceOrganizationStateQuery, +) +from zitadel_client.models.organization_service_pagination_request import ( + OrganizationServicePaginationRequest as OrganizationServicePaginationRequest, +) +from zitadel_client.models.organization_service_pagination_response import ( + OrganizationServicePaginationResponse as OrganizationServicePaginationResponse, +) +from zitadel_client.models.organization_service_password import ( + OrganizationServicePassword as OrganizationServicePassword, +) +from zitadel_client.models.organization_service_search_query import ( + OrganizationServiceSearchQuery as OrganizationServiceSearchQuery, +) +from zitadel_client.models.organization_service_send_email_verification_code import ( + OrganizationServiceSendEmailVerificationCode as OrganizationServiceSendEmailVerificationCode, +) +from zitadel_client.models.organization_service_set_human_email import ( + OrganizationServiceSetHumanEmail as OrganizationServiceSetHumanEmail, +) +from zitadel_client.models.organization_service_set_human_phone import ( + OrganizationServiceSetHumanPhone as OrganizationServiceSetHumanPhone, +) +from zitadel_client.models.organization_service_set_human_profile import ( + OrganizationServiceSetHumanProfile as OrganizationServiceSetHumanProfile, +) +from zitadel_client.models.organization_service_set_metadata_entry import ( + OrganizationServiceSetMetadataEntry as OrganizationServiceSetMetadataEntry, +) +from zitadel_client.models.organization_service_set_organization_metadata_request import ( + OrganizationServiceSetOrganizationMetadataRequest as OrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_set_organization_metadata_response import ( + OrganizationServiceSetOrganizationMetadataResponse as OrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_text_filter_method import ( + OrganizationServiceTextFilterMethod as OrganizationServiceTextFilterMethod, +) +from zitadel_client.models.organization_service_text_query_method import ( + OrganizationServiceTextQueryMethod as OrganizationServiceTextQueryMethod, +) +from zitadel_client.models.organization_service_update_organization_request import ( + OrganizationServiceUpdateOrganizationRequest as OrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.organization_service_update_organization_response import ( + OrganizationServiceUpdateOrganizationResponse as OrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.organization_service_verify_organization_domain_request import ( + OrganizationServiceVerifyOrganizationDomainRequest as OrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_verify_organization_domain_response import ( + OrganizationServiceVerifyOrganizationDomainResponse as OrganizationServiceVerifyOrganizationDomainResponse, +) +from zitadel_client.models.project_service_activate_project_grant_request import ( + ProjectServiceActivateProjectGrantRequest as ProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.project_service_activate_project_grant_response import ( + ProjectServiceActivateProjectGrantResponse as ProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.project_service_activate_project_request import ( + ProjectServiceActivateProjectRequest as ProjectServiceActivateProjectRequest, +) +from zitadel_client.models.project_service_activate_project_response import ( + ProjectServiceActivateProjectResponse as ProjectServiceActivateProjectResponse, +) +from zitadel_client.models.project_service_add_project_role_request import ( + ProjectServiceAddProjectRoleRequest as ProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.project_service_add_project_role_response import ( + ProjectServiceAddProjectRoleResponse as ProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.project_service_any import ( + ProjectServiceAny as ProjectServiceAny, +) +from zitadel_client.models.project_service_connect_error import ( + ProjectServiceConnectError as ProjectServiceConnectError, +) +from zitadel_client.models.project_service_create_project_grant_request import ( + ProjectServiceCreateProjectGrantRequest as ProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.project_service_create_project_grant_response import ( + ProjectServiceCreateProjectGrantResponse as ProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.project_service_create_project_request import ( + ProjectServiceCreateProjectRequest as ProjectServiceCreateProjectRequest, +) +from zitadel_client.models.project_service_create_project_response import ( + ProjectServiceCreateProjectResponse as ProjectServiceCreateProjectResponse, +) +from zitadel_client.models.project_service_deactivate_project_grant_request import ( + ProjectServiceDeactivateProjectGrantRequest as ProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.project_service_deactivate_project_grant_response import ( + ProjectServiceDeactivateProjectGrantResponse as ProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.project_service_deactivate_project_request import ( + ProjectServiceDeactivateProjectRequest as ProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.project_service_deactivate_project_response import ( + ProjectServiceDeactivateProjectResponse as ProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.project_service_delete_project_grant_request import ( + ProjectServiceDeleteProjectGrantRequest as ProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.project_service_delete_project_grant_response import ( + ProjectServiceDeleteProjectGrantResponse as ProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.project_service_delete_project_request import ( + ProjectServiceDeleteProjectRequest as ProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.project_service_delete_project_response import ( + ProjectServiceDeleteProjectResponse as ProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.project_service_get_project_request import ( + ProjectServiceGetProjectRequest as ProjectServiceGetProjectRequest, +) +from zitadel_client.models.project_service_get_project_response import ( + ProjectServiceGetProjectResponse as ProjectServiceGetProjectResponse, +) +from zitadel_client.models.project_service_granted_project_state import ( + ProjectServiceGrantedProjectState as ProjectServiceGrantedProjectState, +) +from zitadel_client.models.project_service_id_filter import ( + ProjectServiceIDFilter as ProjectServiceIDFilter, +) +from zitadel_client.models.project_service_in_ids_filter import ( + ProjectServiceInIDsFilter as ProjectServiceInIDsFilter, +) +from zitadel_client.models.project_service_list_project_grants_request import ( + ProjectServiceListProjectGrantsRequest as ProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.project_service_list_project_grants_response import ( + ProjectServiceListProjectGrantsResponse as ProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.project_service_list_project_roles_request import ( + ProjectServiceListProjectRolesRequest as ProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.project_service_list_project_roles_response import ( + ProjectServiceListProjectRolesResponse as ProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.project_service_list_projects_request import ( + ProjectServiceListProjectsRequest as ProjectServiceListProjectsRequest, +) +from zitadel_client.models.project_service_list_projects_response import ( + ProjectServiceListProjectsResponse as ProjectServiceListProjectsResponse, +) +from zitadel_client.models.project_service_pagination_request import ( + ProjectServicePaginationRequest as ProjectServicePaginationRequest, +) +from zitadel_client.models.project_service_pagination_response import ( + ProjectServicePaginationResponse as ProjectServicePaginationResponse, +) +from zitadel_client.models.project_service_private_labeling_setting import ( + ProjectServicePrivateLabelingSetting as ProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.project_service_project import ( + ProjectServiceProject as ProjectServiceProject, +) +from zitadel_client.models.project_service_project_field_name import ( + ProjectServiceProjectFieldName as ProjectServiceProjectFieldName, +) +from zitadel_client.models.project_service_project_grant import ( + ProjectServiceProjectGrant as ProjectServiceProjectGrant, +) +from zitadel_client.models.project_service_project_grant_field_name import ( + ProjectServiceProjectGrantFieldName as ProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.project_service_project_grant_search_filter import ( + ProjectServiceProjectGrantSearchFilter as ProjectServiceProjectGrantSearchFilter, +) +from zitadel_client.models.project_service_project_grant_state import ( + ProjectServiceProjectGrantState as ProjectServiceProjectGrantState, +) +from zitadel_client.models.project_service_project_name_filter import ( + ProjectServiceProjectNameFilter as ProjectServiceProjectNameFilter, +) +from zitadel_client.models.project_service_project_organization_id_filter import ( + ProjectServiceProjectOrganizationIDFilter as ProjectServiceProjectOrganizationIDFilter, +) +from zitadel_client.models.project_service_project_role import ( + ProjectServiceProjectRole as ProjectServiceProjectRole, +) +from zitadel_client.models.project_service_project_role_display_name_filter import ( + ProjectServiceProjectRoleDisplayNameFilter as ProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.project_service_project_role_field_name import ( + ProjectServiceProjectRoleFieldName as ProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.project_service_project_role_key_filter import ( + ProjectServiceProjectRoleKeyFilter as ProjectServiceProjectRoleKeyFilter, +) +from zitadel_client.models.project_service_project_role_search_filter import ( + ProjectServiceProjectRoleSearchFilter as ProjectServiceProjectRoleSearchFilter, +) +from zitadel_client.models.project_service_project_search_filter import ( + ProjectServiceProjectSearchFilter as ProjectServiceProjectSearchFilter, +) +from zitadel_client.models.project_service_project_state import ( + ProjectServiceProjectState as ProjectServiceProjectState, +) +from zitadel_client.models.project_service_remove_project_role_request import ( + ProjectServiceRemoveProjectRoleRequest as ProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.project_service_remove_project_role_response import ( + ProjectServiceRemoveProjectRoleResponse as ProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.project_service_text_filter_method import ( + ProjectServiceTextFilterMethod as ProjectServiceTextFilterMethod, +) +from zitadel_client.models.project_service_type import ( + ProjectServiceType as ProjectServiceType, +) +from zitadel_client.models.project_service_update_project_grant_request import ( + ProjectServiceUpdateProjectGrantRequest as ProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.project_service_update_project_grant_response import ( + ProjectServiceUpdateProjectGrantResponse as ProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.project_service_update_project_request import ( + ProjectServiceUpdateProjectRequest as ProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.project_service_update_project_response import ( + ProjectServiceUpdateProjectResponse as ProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.project_service_update_project_role_request import ( + ProjectServiceUpdateProjectRoleRequest as ProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.project_service_update_project_role_response import ( + ProjectServiceUpdateProjectRoleResponse as ProjectServiceUpdateProjectRoleResponse, +) +from zitadel_client.models.saml_service_any import ( + SAMLServiceAny as SAMLServiceAny, +) +from zitadel_client.models.saml_service_authorization_error import ( + SAMLServiceAuthorizationError as SAMLServiceAuthorizationError, +) +from zitadel_client.models.saml_service_connect_error import ( + SAMLServiceConnectError as SAMLServiceConnectError, +) +from zitadel_client.models.saml_service_create_response_request import ( + SAMLServiceCreateResponseRequest as SAMLServiceCreateResponseRequest, +) +from zitadel_client.models.saml_service_create_response_response import ( + SAMLServiceCreateResponseResponse as SAMLServiceCreateResponseResponse, +) +from zitadel_client.models.saml_service_details import ( + SAMLServiceDetails as SAMLServiceDetails, +) +from zitadel_client.models.saml_service_error_reason import ( + SAMLServiceErrorReason as SAMLServiceErrorReason, +) +from zitadel_client.models.saml_service_get_saml_request_request import ( + SAMLServiceGetSAMLRequestRequest as SAMLServiceGetSAMLRequestRequest, +) +from zitadel_client.models.saml_service_get_saml_request_response import ( + SAMLServiceGetSAMLRequestResponse as SAMLServiceGetSAMLRequestResponse, +) +from zitadel_client.models.saml_service_post_response import ( + SAMLServicePostResponse as SAMLServicePostResponse, +) +from zitadel_client.models.saml_service_saml_request import ( + SAMLServiceSAMLRequest as SAMLServiceSAMLRequest, +) +from zitadel_client.models.saml_service_session import ( + SAMLServiceSession as SAMLServiceSession, +) +from zitadel_client.models.session_service_any import ( + SessionServiceAny as SessionServiceAny, +) +from zitadel_client.models.session_service_challenges import ( + SessionServiceChallenges as SessionServiceChallenges, +) +from zitadel_client.models.session_service_check_idp_intent import ( + SessionServiceCheckIDPIntent as SessionServiceCheckIDPIntent, +) +from zitadel_client.models.session_service_check_otp import ( + SessionServiceCheckOTP as SessionServiceCheckOTP, +) +from zitadel_client.models.session_service_check_password import ( + SessionServiceCheckPassword as SessionServiceCheckPassword, +) +from zitadel_client.models.session_service_check_recovery_code import ( + SessionServiceCheckRecoveryCode as SessionServiceCheckRecoveryCode, +) +from zitadel_client.models.session_service_check_totp import ( + SessionServiceCheckTOTP as SessionServiceCheckTOTP, +) +from zitadel_client.models.session_service_check_user import ( + SessionServiceCheckUser as SessionServiceCheckUser, +) +from zitadel_client.models.session_service_check_web_auth_n import ( + SessionServiceCheckWebAuthN as SessionServiceCheckWebAuthN, +) +from zitadel_client.models.session_service_checks import ( + SessionServiceChecks as SessionServiceChecks, +) +from zitadel_client.models.session_service_connect_error import ( + SessionServiceConnectError as SessionServiceConnectError, +) +from zitadel_client.models.session_service_create_session_request import ( + SessionServiceCreateSessionRequest as SessionServiceCreateSessionRequest, +) +from zitadel_client.models.session_service_create_session_response import ( + SessionServiceCreateSessionResponse as SessionServiceCreateSessionResponse, +) +from zitadel_client.models.session_service_creation_date_query import ( + SessionServiceCreationDateQuery as SessionServiceCreationDateQuery, +) +from zitadel_client.models.session_service_creator_query import ( + SessionServiceCreatorQuery as SessionServiceCreatorQuery, +) +from zitadel_client.models.session_service_delete_session_request import ( + SessionServiceDeleteSessionRequest as SessionServiceDeleteSessionRequest, +) +from zitadel_client.models.session_service_delete_session_response import ( + SessionServiceDeleteSessionResponse as SessionServiceDeleteSessionResponse, +) +from zitadel_client.models.session_service_details import ( + SessionServiceDetails as SessionServiceDetails, +) +from zitadel_client.models.session_service_expiration_date_query import ( + SessionServiceExpirationDateQuery as SessionServiceExpirationDateQuery, +) +from zitadel_client.models.session_service_factors import ( + SessionServiceFactors as SessionServiceFactors, +) +from zitadel_client.models.session_service_get_session_request import ( + SessionServiceGetSessionRequest as SessionServiceGetSessionRequest, +) +from zitadel_client.models.session_service_get_session_response import ( + SessionServiceGetSessionResponse as SessionServiceGetSessionResponse, +) +from zitadel_client.models.session_service_header_values import ( + SessionServiceHeaderValues as SessionServiceHeaderValues, +) +from zitadel_client.models.session_service_ids_query import ( + SessionServiceIDsQuery as SessionServiceIDsQuery, +) +from zitadel_client.models.session_service_intent_factor import ( + SessionServiceIntentFactor as SessionServiceIntentFactor, +) +from zitadel_client.models.session_service_list_details import ( + SessionServiceListDetails as SessionServiceListDetails, +) +from zitadel_client.models.session_service_list_query import ( + SessionServiceListQuery as SessionServiceListQuery, +) +from zitadel_client.models.session_service_list_sessions_request import ( + SessionServiceListSessionsRequest as SessionServiceListSessionsRequest, +) +from zitadel_client.models.session_service_list_sessions_response import ( + SessionServiceListSessionsResponse as SessionServiceListSessionsResponse, +) +from zitadel_client.models.session_service_otp_email import ( + SessionServiceOTPEmail as SessionServiceOTPEmail, +) +from zitadel_client.models.session_service_otp_factor import ( + SessionServiceOTPFactor as SessionServiceOTPFactor, +) +from zitadel_client.models.session_service_otpsms import ( + SessionServiceOTPSMS as SessionServiceOTPSMS, +) +from zitadel_client.models.session_service_password_factor import ( + SessionServicePasswordFactor as SessionServicePasswordFactor, +) +from zitadel_client.models.session_service_recovery_code_factor import ( + SessionServiceRecoveryCodeFactor as SessionServiceRecoveryCodeFactor, +) +from zitadel_client.models.session_service_request_challenges import ( + SessionServiceRequestChallenges as SessionServiceRequestChallenges, +) +from zitadel_client.models.session_service_search_query import ( + SessionServiceSearchQuery as SessionServiceSearchQuery, +) +from zitadel_client.models.session_service_send_code import ( + SessionServiceSendCode as SessionServiceSendCode, +) +from zitadel_client.models.session_service_session import ( + SessionServiceSession as SessionServiceSession, +) +from zitadel_client.models.session_service_session_field_name import ( + SessionServiceSessionFieldName as SessionServiceSessionFieldName, +) +from zitadel_client.models.session_service_set_session_request import ( + SessionServiceSetSessionRequest as SessionServiceSetSessionRequest, +) +from zitadel_client.models.session_service_set_session_response import ( + SessionServiceSetSessionResponse as SessionServiceSetSessionResponse, +) +from zitadel_client.models.session_service_totp_factor import ( + SessionServiceTOTPFactor as SessionServiceTOTPFactor, +) +from zitadel_client.models.session_service_timestamp_query_method import ( + SessionServiceTimestampQueryMethod as SessionServiceTimestampQueryMethod, +) +from zitadel_client.models.session_service_user_agent import ( + SessionServiceUserAgent as SessionServiceUserAgent, +) +from zitadel_client.models.session_service_user_agent_query import ( + SessionServiceUserAgentQuery as SessionServiceUserAgentQuery, +) +from zitadel_client.models.session_service_user_factor import ( + SessionServiceUserFactor as SessionServiceUserFactor, +) +from zitadel_client.models.session_service_user_id_query import ( + SessionServiceUserIDQuery as SessionServiceUserIDQuery, +) +from zitadel_client.models.session_service_user_verification_requirement import ( + SessionServiceUserVerificationRequirement as SessionServiceUserVerificationRequirement, +) +from zitadel_client.models.session_service_web_auth_n import ( + SessionServiceWebAuthN as SessionServiceWebAuthN, +) +from zitadel_client.models.session_service_web_auth_n_factor import ( + SessionServiceWebAuthNFactor as SessionServiceWebAuthNFactor, +) +from zitadel_client.models.settings_service_any import ( + SettingsServiceAny as SettingsServiceAny, +) +from zitadel_client.models.settings_service_auto_linking_option import ( + SettingsServiceAutoLinkingOption as SettingsServiceAutoLinkingOption, +) +from zitadel_client.models.settings_service_branding_settings import ( + SettingsServiceBrandingSettings as SettingsServiceBrandingSettings, +) +from zitadel_client.models.settings_service_connect_error import ( + SettingsServiceConnectError as SettingsServiceConnectError, +) +from zitadel_client.models.settings_service_details import ( + SettingsServiceDetails as SettingsServiceDetails, +) +from zitadel_client.models.settings_service_domain_settings import ( + SettingsServiceDomainSettings as SettingsServiceDomainSettings, +) +from zitadel_client.models.settings_service_embedded_iframe_settings import ( + SettingsServiceEmbeddedIframeSettings as SettingsServiceEmbeddedIframeSettings, +) +from zitadel_client.models.settings_service_get_active_identity_providers_request import ( + SettingsServiceGetActiveIdentityProvidersRequest as SettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.settings_service_get_active_identity_providers_response import ( + SettingsServiceGetActiveIdentityProvidersResponse as SettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.settings_service_get_branding_settings_request import ( + SettingsServiceGetBrandingSettingsRequest as SettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.settings_service_get_branding_settings_response import ( + SettingsServiceGetBrandingSettingsResponse as SettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.settings_service_get_domain_settings_request import ( + SettingsServiceGetDomainSettingsRequest as SettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.settings_service_get_domain_settings_response import ( + SettingsServiceGetDomainSettingsResponse as SettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.settings_service_get_general_settings_response import ( + SettingsServiceGetGeneralSettingsResponse as SettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_request import ( + SettingsServiceGetHostedLoginTranslationRequest as SettingsServiceGetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_response import ( + SettingsServiceGetHostedLoginTranslationResponse as SettingsServiceGetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_request import ( + SettingsServiceGetLegalAndSupportSettingsRequest as SettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_response import ( + SettingsServiceGetLegalAndSupportSettingsResponse as SettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.settings_service_get_lockout_settings_request import ( + SettingsServiceGetLockoutSettingsRequest as SettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.settings_service_get_lockout_settings_response import ( + SettingsServiceGetLockoutSettingsResponse as SettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.settings_service_get_login_settings_request import ( + SettingsServiceGetLoginSettingsRequest as SettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.settings_service_get_login_settings_response import ( + SettingsServiceGetLoginSettingsResponse as SettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_request import ( + SettingsServiceGetPasswordComplexitySettingsRequest as SettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_response import ( + SettingsServiceGetPasswordComplexitySettingsResponse as SettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_request import ( + SettingsServiceGetPasswordExpirySettingsRequest as SettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_response import ( + SettingsServiceGetPasswordExpirySettingsResponse as SettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.settings_service_get_security_settings_response import ( + SettingsServiceGetSecuritySettingsResponse as SettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.settings_service_identity_provider import ( + SettingsServiceIdentityProvider as SettingsServiceIdentityProvider, +) +from zitadel_client.models.settings_service_identity_provider_type import ( + SettingsServiceIdentityProviderType as SettingsServiceIdentityProviderType, +) +from zitadel_client.models.settings_service_legal_and_support_settings import ( + SettingsServiceLegalAndSupportSettings as SettingsServiceLegalAndSupportSettings, +) +from zitadel_client.models.settings_service_list_details import ( + SettingsServiceListDetails as SettingsServiceListDetails, +) +from zitadel_client.models.settings_service_lockout_settings import ( + SettingsServiceLockoutSettings as SettingsServiceLockoutSettings, +) +from zitadel_client.models.settings_service_login_settings import ( + SettingsServiceLoginSettings as SettingsServiceLoginSettings, +) +from zitadel_client.models.settings_service_multi_factor_type import ( + SettingsServiceMultiFactorType as SettingsServiceMultiFactorType, +) +from zitadel_client.models.settings_service_options import ( + SettingsServiceOptions as SettingsServiceOptions, +) +from zitadel_client.models.settings_service_passkeys_type import ( + SettingsServicePasskeysType as SettingsServicePasskeysType, +) +from zitadel_client.models.settings_service_password_complexity_settings import ( + SettingsServicePasswordComplexitySettings as SettingsServicePasswordComplexitySettings, +) +from zitadel_client.models.settings_service_password_expiry_settings import ( + SettingsServicePasswordExpirySettings as SettingsServicePasswordExpirySettings, +) +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext as SettingsServiceRequestContext, +) +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType as SettingsServiceResourceOwnerType, +) +from zitadel_client.models.settings_service_second_factor_type import ( + SettingsServiceSecondFactorType as SettingsServiceSecondFactorType, +) +from zitadel_client.models.settings_service_security_settings import ( + SettingsServiceSecuritySettings as SettingsServiceSecuritySettings, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_request import ( + SettingsServiceSetHostedLoginTranslationRequest as SettingsServiceSetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_response import ( + SettingsServiceSetHostedLoginTranslationResponse as SettingsServiceSetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_set_security_settings_request import ( + SettingsServiceSetSecuritySettingsRequest as SettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.settings_service_set_security_settings_response import ( + SettingsServiceSetSecuritySettingsResponse as SettingsServiceSetSecuritySettingsResponse, +) +from zitadel_client.models.settings_service_theme import ( + SettingsServiceTheme as SettingsServiceTheme, +) +from zitadel_client.models.settings_service_theme_mode import ( + SettingsServiceThemeMode as SettingsServiceThemeMode, +) +from zitadel_client.models.user_service_access_token_type import ( + UserServiceAccessTokenType as UserServiceAccessTokenType, +) +from zitadel_client.models.user_service_add_human_user_request import ( + UserServiceAddHumanUserRequest as UserServiceAddHumanUserRequest, +) +from zitadel_client.models.user_service_add_human_user_response import ( + UserServiceAddHumanUserResponse as UserServiceAddHumanUserResponse, +) +from zitadel_client.models.user_service_add_idp_link_request import ( + UserServiceAddIDPLinkRequest as UserServiceAddIDPLinkRequest, +) +from zitadel_client.models.user_service_add_idp_link_response import ( + UserServiceAddIDPLinkResponse as UserServiceAddIDPLinkResponse, +) +from zitadel_client.models.user_service_add_key_request import ( + UserServiceAddKeyRequest as UserServiceAddKeyRequest, +) +from zitadel_client.models.user_service_add_key_response import ( + UserServiceAddKeyResponse as UserServiceAddKeyResponse, +) +from zitadel_client.models.user_service_add_otp_email_request import ( + UserServiceAddOTPEmailRequest as UserServiceAddOTPEmailRequest, +) +from zitadel_client.models.user_service_add_otp_email_response import ( + UserServiceAddOTPEmailResponse as UserServiceAddOTPEmailResponse, +) +from zitadel_client.models.user_service_add_otpsms_request import ( + UserServiceAddOTPSMSRequest as UserServiceAddOTPSMSRequest, +) +from zitadel_client.models.user_service_add_otpsms_response import ( + UserServiceAddOTPSMSResponse as UserServiceAddOTPSMSResponse, +) +from zitadel_client.models.user_service_add_personal_access_token_request import ( + UserServiceAddPersonalAccessTokenRequest as UserServiceAddPersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_add_personal_access_token_response import ( + UserServiceAddPersonalAccessTokenResponse as UserServiceAddPersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_add_secret_request import ( + UserServiceAddSecretRequest as UserServiceAddSecretRequest, +) +from zitadel_client.models.user_service_add_secret_response import ( + UserServiceAddSecretResponse as UserServiceAddSecretResponse, +) +from zitadel_client.models.user_service_and_query import ( + UserServiceAndQuery as UserServiceAndQuery, +) +from zitadel_client.models.user_service_any import ( + UserServiceAny as UserServiceAny, +) +from zitadel_client.models.user_service_auth_factor import ( + UserServiceAuthFactor as UserServiceAuthFactor, +) +from zitadel_client.models.user_service_auth_factor_state import ( + UserServiceAuthFactorState as UserServiceAuthFactorState, +) +from zitadel_client.models.user_service_auth_factor_u2_f import ( + UserServiceAuthFactorU2F as UserServiceAuthFactorU2F, +) +from zitadel_client.models.user_service_auth_factors import ( + UserServiceAuthFactors as UserServiceAuthFactors, +) +from zitadel_client.models.user_service_authentication_method_type import ( + UserServiceAuthenticationMethodType as UserServiceAuthenticationMethodType, +) +from zitadel_client.models.user_service_byte_filter_method import ( + UserServiceByteFilterMethod as UserServiceByteFilterMethod, +) +from zitadel_client.models.user_service_connect_error import ( + UserServiceConnectError as UserServiceConnectError, +) +from zitadel_client.models.user_service_create_invite_code_request import ( + UserServiceCreateInviteCodeRequest as UserServiceCreateInviteCodeRequest, +) +from zitadel_client.models.user_service_create_invite_code_response import ( + UserServiceCreateInviteCodeResponse as UserServiceCreateInviteCodeResponse, +) +from zitadel_client.models.user_service_create_passkey_registration_link_request import ( + UserServiceCreatePasskeyRegistrationLinkRequest as UserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.user_service_create_passkey_registration_link_response import ( + UserServiceCreatePasskeyRegistrationLinkResponse as UserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.user_service_create_user_request import ( + UserServiceCreateUserRequest as UserServiceCreateUserRequest, +) +from zitadel_client.models.user_service_create_user_response import ( + UserServiceCreateUserResponse as UserServiceCreateUserResponse, +) +from zitadel_client.models.user_service_deactivate_user_request import ( + UserServiceDeactivateUserRequest as UserServiceDeactivateUserRequest, +) +from zitadel_client.models.user_service_deactivate_user_response import ( + UserServiceDeactivateUserResponse as UserServiceDeactivateUserResponse, +) +from zitadel_client.models.user_service_delete_user_metadata_request import ( + UserServiceDeleteUserMetadataRequest as UserServiceDeleteUserMetadataRequest, +) +from zitadel_client.models.user_service_delete_user_metadata_response import ( + UserServiceDeleteUserMetadataResponse as UserServiceDeleteUserMetadataResponse, +) +from zitadel_client.models.user_service_delete_user_request import ( + UserServiceDeleteUserRequest as UserServiceDeleteUserRequest, +) +from zitadel_client.models.user_service_delete_user_response import ( + UserServiceDeleteUserResponse as UserServiceDeleteUserResponse, +) +from zitadel_client.models.user_service_details import ( + UserServiceDetails as UserServiceDetails, +) +from zitadel_client.models.user_service_display_name_query import ( + UserServiceDisplayNameQuery as UserServiceDisplayNameQuery, +) +from zitadel_client.models.user_service_domain_query import ( + UserServiceDomainQuery as UserServiceDomainQuery, +) +from zitadel_client.models.user_service_email_query import ( + UserServiceEmailQuery as UserServiceEmailQuery, +) +from zitadel_client.models.user_service_first_name_query import ( + UserServiceFirstNameQuery as UserServiceFirstNameQuery, +) +from zitadel_client.models.user_service_form_data import ( + UserServiceFormData as UserServiceFormData, +) +from zitadel_client.models.user_service_gender import ( + UserServiceGender as UserServiceGender, +) +from zitadel_client.models.user_service_generate_recovery_codes_request import ( + UserServiceGenerateRecoveryCodesRequest as UserServiceGenerateRecoveryCodesRequest, +) +from zitadel_client.models.user_service_generate_recovery_codes_response import ( + UserServiceGenerateRecoveryCodesResponse as UserServiceGenerateRecoveryCodesResponse, +) +from zitadel_client.models.user_service_get_user_by_id_request import ( + UserServiceGetUserByIDRequest as UserServiceGetUserByIDRequest, +) +from zitadel_client.models.user_service_get_user_by_id_response import ( + UserServiceGetUserByIDResponse as UserServiceGetUserByIDResponse, +) +from zitadel_client.models.user_service_hashed_password import ( + UserServiceHashedPassword as UserServiceHashedPassword, +) +from zitadel_client.models.user_service_human import ( + UserServiceHuman as UserServiceHuman, +) +from zitadel_client.models.user_service_human_email import ( + UserServiceHumanEmail as UserServiceHumanEmail, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_request import ( + UserServiceHumanMFAInitSkippedRequest as UserServiceHumanMFAInitSkippedRequest, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_response import ( + UserServiceHumanMFAInitSkippedResponse as UserServiceHumanMFAInitSkippedResponse, +) +from zitadel_client.models.user_service_human_phone import ( + UserServiceHumanPhone as UserServiceHumanPhone, +) +from zitadel_client.models.user_service_human_profile import ( + UserServiceHumanProfile as UserServiceHumanProfile, +) +from zitadel_client.models.user_service_human_user import ( + UserServiceHumanUser as UserServiceHumanUser, +) +from zitadel_client.models.user_service_id_filter import ( + UserServiceIDFilter as UserServiceIDFilter, +) +from zitadel_client.models.user_service_idp_information import ( + UserServiceIDPInformation as UserServiceIDPInformation, +) +from zitadel_client.models.user_service_idp_intent import ( + UserServiceIDPIntent as UserServiceIDPIntent, +) +from zitadel_client.models.user_service_idpldap_access_information import ( + UserServiceIDPLDAPAccessInformation as UserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.user_service_idp_link import ( + UserServiceIDPLink as UserServiceIDPLink, +) +from zitadel_client.models.user_service_idpo_auth_access_information import ( + UserServiceIDPOAuthAccessInformation as UserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.user_service_idpsaml_access_information import ( + UserServiceIDPSAMLAccessInformation as UserServiceIDPSAMLAccessInformation, +) +from zitadel_client.models.user_service_in_user_emails_query import ( + UserServiceInUserEmailsQuery as UserServiceInUserEmailsQuery, +) +from zitadel_client.models.user_service_in_user_id_query import ( + UserServiceInUserIDQuery as UserServiceInUserIDQuery, +) +from zitadel_client.models.user_service_key import ( + UserServiceKey as UserServiceKey, +) +from zitadel_client.models.user_service_key_field_name import ( + UserServiceKeyFieldName as UserServiceKeyFieldName, +) +from zitadel_client.models.user_service_keys_search_filter import ( + UserServiceKeysSearchFilter as UserServiceKeysSearchFilter, +) +from zitadel_client.models.user_service_ldap_credentials import ( + UserServiceLDAPCredentials as UserServiceLDAPCredentials, +) +from zitadel_client.models.user_service_last_name_query import ( + UserServiceLastNameQuery as UserServiceLastNameQuery, +) +from zitadel_client.models.user_service_list_authentication_factors_request import ( + UserServiceListAuthenticationFactorsRequest as UserServiceListAuthenticationFactorsRequest, +) +from zitadel_client.models.user_service_list_authentication_factors_response import ( + UserServiceListAuthenticationFactorsResponse as UserServiceListAuthenticationFactorsResponse, +) +from zitadel_client.models.user_service_list_authentication_method_types_request import ( + UserServiceListAuthenticationMethodTypesRequest as UserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.user_service_list_authentication_method_types_response import ( + UserServiceListAuthenticationMethodTypesResponse as UserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.user_service_list_details import ( + UserServiceListDetails as UserServiceListDetails, +) +from zitadel_client.models.user_service_list_idp_links_request import ( + UserServiceListIDPLinksRequest as UserServiceListIDPLinksRequest, +) +from zitadel_client.models.user_service_list_idp_links_response import ( + UserServiceListIDPLinksResponse as UserServiceListIDPLinksResponse, +) +from zitadel_client.models.user_service_list_keys_request import ( + UserServiceListKeysRequest as UserServiceListKeysRequest, +) +from zitadel_client.models.user_service_list_keys_response import ( + UserServiceListKeysResponse as UserServiceListKeysResponse, +) +from zitadel_client.models.user_service_list_passkeys_request import ( + UserServiceListPasskeysRequest as UserServiceListPasskeysRequest, +) +from zitadel_client.models.user_service_list_passkeys_response import ( + UserServiceListPasskeysResponse as UserServiceListPasskeysResponse, +) +from zitadel_client.models.user_service_list_personal_access_tokens_request import ( + UserServiceListPersonalAccessTokensRequest as UserServiceListPersonalAccessTokensRequest, +) +from zitadel_client.models.user_service_list_personal_access_tokens_response import ( + UserServiceListPersonalAccessTokensResponse as UserServiceListPersonalAccessTokensResponse, +) +from zitadel_client.models.user_service_list_query import ( + UserServiceListQuery as UserServiceListQuery, +) +from zitadel_client.models.user_service_list_user_metadata_request import ( + UserServiceListUserMetadataRequest as UserServiceListUserMetadataRequest, +) +from zitadel_client.models.user_service_list_user_metadata_response import ( + UserServiceListUserMetadataResponse as UserServiceListUserMetadataResponse, +) +from zitadel_client.models.user_service_list_users_request import ( + UserServiceListUsersRequest as UserServiceListUsersRequest, +) +from zitadel_client.models.user_service_list_users_response import ( + UserServiceListUsersResponse as UserServiceListUsersResponse, +) +from zitadel_client.models.user_service_lock_user_request import ( + UserServiceLockUserRequest as UserServiceLockUserRequest, +) +from zitadel_client.models.user_service_lock_user_response import ( + UserServiceLockUserResponse as UserServiceLockUserResponse, +) +from zitadel_client.models.user_service_login_name_query import ( + UserServiceLoginNameQuery as UserServiceLoginNameQuery, +) +from zitadel_client.models.user_service_machine import ( + UserServiceMachine as UserServiceMachine, +) +from zitadel_client.models.user_service_machine_user import ( + UserServiceMachineUser as UserServiceMachineUser, +) +from zitadel_client.models.user_service_metadata import ( + UserServiceMetadata as UserServiceMetadata, +) +from zitadel_client.models.user_service_metadata_key_filter import ( + UserServiceMetadataKeyFilter as UserServiceMetadataKeyFilter, +) +from zitadel_client.models.user_service_metadata_search_filter import ( + UserServiceMetadataSearchFilter as UserServiceMetadataSearchFilter, +) +from zitadel_client.models.user_service_metadata_value_filter import ( + UserServiceMetadataValueFilter as UserServiceMetadataValueFilter, +) +from zitadel_client.models.user_service_nick_name_query import ( + UserServiceNickNameQuery as UserServiceNickNameQuery, +) +from zitadel_client.models.user_service_not_query import ( + UserServiceNotQuery as UserServiceNotQuery, +) +from zitadel_client.models.user_service_notification_type import ( + UserServiceNotificationType as UserServiceNotificationType, +) +from zitadel_client.models.user_service_or_query import ( + UserServiceOrQuery as UserServiceOrQuery, +) +from zitadel_client.models.user_service_organization import ( + UserServiceOrganization as UserServiceOrganization, +) +from zitadel_client.models.user_service_organization_id_query import ( + UserServiceOrganizationIdQuery as UserServiceOrganizationIdQuery, +) +from zitadel_client.models.user_service_pagination_request import ( + UserServicePaginationRequest as UserServicePaginationRequest, +) +from zitadel_client.models.user_service_pagination_response import ( + UserServicePaginationResponse as UserServicePaginationResponse, +) +from zitadel_client.models.user_service_passkey import ( + UserServicePasskey as UserServicePasskey, +) +from zitadel_client.models.user_service_passkey_authenticator import ( + UserServicePasskeyAuthenticator as UserServicePasskeyAuthenticator, +) +from zitadel_client.models.user_service_passkey_registration_code import ( + UserServicePasskeyRegistrationCode as UserServicePasskeyRegistrationCode, +) +from zitadel_client.models.user_service_password import ( + UserServicePassword as UserServicePassword, +) +from zitadel_client.models.user_service_password_reset_request import ( + UserServicePasswordResetRequest as UserServicePasswordResetRequest, +) +from zitadel_client.models.user_service_password_reset_response import ( + UserServicePasswordResetResponse as UserServicePasswordResetResponse, +) +from zitadel_client.models.user_service_personal_access_token import ( + UserServicePersonalAccessToken as UserServicePersonalAccessToken, +) +from zitadel_client.models.user_service_personal_access_token_field_name import ( + UserServicePersonalAccessTokenFieldName as UserServicePersonalAccessTokenFieldName, +) +from zitadel_client.models.user_service_personal_access_tokens_search_filter import ( + UserServicePersonalAccessTokensSearchFilter as UserServicePersonalAccessTokensSearchFilter, +) +from zitadel_client.models.user_service_phone_query import ( + UserServicePhoneQuery as UserServicePhoneQuery, +) +from zitadel_client.models.user_service_profile import ( + UserServiceProfile as UserServiceProfile, +) +from zitadel_client.models.user_service_reactivate_user_request import ( + UserServiceReactivateUserRequest as UserServiceReactivateUserRequest, +) +from zitadel_client.models.user_service_reactivate_user_response import ( + UserServiceReactivateUserResponse as UserServiceReactivateUserResponse, +) +from zitadel_client.models.user_service_redirect_urls import ( + UserServiceRedirectURLs as UserServiceRedirectURLs, +) +from zitadel_client.models.user_service_register_passkey_request import ( + UserServiceRegisterPasskeyRequest as UserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.user_service_register_passkey_response import ( + UserServiceRegisterPasskeyResponse as UserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.user_service_register_totp_request import ( + UserServiceRegisterTOTPRequest as UserServiceRegisterTOTPRequest, +) +from zitadel_client.models.user_service_register_totp_response import ( + UserServiceRegisterTOTPResponse as UserServiceRegisterTOTPResponse, +) +from zitadel_client.models.user_service_register_u2_f_request import ( + UserServiceRegisterU2FRequest as UserServiceRegisterU2FRequest, +) +from zitadel_client.models.user_service_register_u2_f_response import ( + UserServiceRegisterU2FResponse as UserServiceRegisterU2FResponse, +) +from zitadel_client.models.user_service_remove_idp_link_request import ( + UserServiceRemoveIDPLinkRequest as UserServiceRemoveIDPLinkRequest, +) +from zitadel_client.models.user_service_remove_idp_link_response import ( + UserServiceRemoveIDPLinkResponse as UserServiceRemoveIDPLinkResponse, +) +from zitadel_client.models.user_service_remove_key_request import ( + UserServiceRemoveKeyRequest as UserServiceRemoveKeyRequest, +) +from zitadel_client.models.user_service_remove_key_response import ( + UserServiceRemoveKeyResponse as UserServiceRemoveKeyResponse, +) +from zitadel_client.models.user_service_remove_otp_email_request import ( + UserServiceRemoveOTPEmailRequest as UserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.user_service_remove_otp_email_response import ( + UserServiceRemoveOTPEmailResponse as UserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.user_service_remove_otpsms_request import ( + UserServiceRemoveOTPSMSRequest as UserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.user_service_remove_otpsms_response import ( + UserServiceRemoveOTPSMSResponse as UserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.user_service_remove_passkey_request import ( + UserServiceRemovePasskeyRequest as UserServiceRemovePasskeyRequest, +) +from zitadel_client.models.user_service_remove_passkey_response import ( + UserServiceRemovePasskeyResponse as UserServiceRemovePasskeyResponse, +) +from zitadel_client.models.user_service_remove_personal_access_token_request import ( + UserServiceRemovePersonalAccessTokenRequest as UserServiceRemovePersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_remove_personal_access_token_response import ( + UserServiceRemovePersonalAccessTokenResponse as UserServiceRemovePersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_remove_phone_request import ( + UserServiceRemovePhoneRequest as UserServiceRemovePhoneRequest, +) +from zitadel_client.models.user_service_remove_phone_response import ( + UserServiceRemovePhoneResponse as UserServiceRemovePhoneResponse, +) +from zitadel_client.models.user_service_remove_recovery_codes_request import ( + UserServiceRemoveRecoveryCodesRequest as UserServiceRemoveRecoveryCodesRequest, +) +from zitadel_client.models.user_service_remove_recovery_codes_response import ( + UserServiceRemoveRecoveryCodesResponse as UserServiceRemoveRecoveryCodesResponse, +) +from zitadel_client.models.user_service_remove_secret_request import ( + UserServiceRemoveSecretRequest as UserServiceRemoveSecretRequest, +) +from zitadel_client.models.user_service_remove_secret_response import ( + UserServiceRemoveSecretResponse as UserServiceRemoveSecretResponse, +) +from zitadel_client.models.user_service_remove_totp_request import ( + UserServiceRemoveTOTPRequest as UserServiceRemoveTOTPRequest, +) +from zitadel_client.models.user_service_remove_totp_response import ( + UserServiceRemoveTOTPResponse as UserServiceRemoveTOTPResponse, +) +from zitadel_client.models.user_service_remove_u2_f_request import ( + UserServiceRemoveU2FRequest as UserServiceRemoveU2FRequest, +) +from zitadel_client.models.user_service_remove_u2_f_response import ( + UserServiceRemoveU2FResponse as UserServiceRemoveU2FResponse, +) +from zitadel_client.models.user_service_resend_email_code_request import ( + UserServiceResendEmailCodeRequest as UserServiceResendEmailCodeRequest, +) +from zitadel_client.models.user_service_resend_email_code_response import ( + UserServiceResendEmailCodeResponse as UserServiceResendEmailCodeResponse, +) +from zitadel_client.models.user_service_resend_invite_code_request import ( + UserServiceResendInviteCodeRequest as UserServiceResendInviteCodeRequest, +) +from zitadel_client.models.user_service_resend_invite_code_response import ( + UserServiceResendInviteCodeResponse as UserServiceResendInviteCodeResponse, +) +from zitadel_client.models.user_service_resend_phone_code_request import ( + UserServiceResendPhoneCodeRequest as UserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.user_service_resend_phone_code_response import ( + UserServiceResendPhoneCodeResponse as UserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import ( + UserServiceRetrieveIdentityProviderIntentRequest as UserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import ( + UserServiceRetrieveIdentityProviderIntentResponse as UserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_search_query import ( + UserServiceSearchQuery as UserServiceSearchQuery, +) +from zitadel_client.models.user_service_send_email_code_request import ( + UserServiceSendEmailCodeRequest as UserServiceSendEmailCodeRequest, +) +from zitadel_client.models.user_service_send_email_code_response import ( + UserServiceSendEmailCodeResponse as UserServiceSendEmailCodeResponse, +) +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode as UserServiceSendEmailVerificationCode, +) +from zitadel_client.models.user_service_send_invite_code import ( + UserServiceSendInviteCode as UserServiceSendInviteCode, +) +from zitadel_client.models.user_service_send_passkey_registration_link import ( + UserServiceSendPasskeyRegistrationLink as UserServiceSendPasskeyRegistrationLink, +) +from zitadel_client.models.user_service_send_password_reset_link import ( + UserServiceSendPasswordResetLink as UserServiceSendPasswordResetLink, +) +from zitadel_client.models.user_service_set_email_request import ( + UserServiceSetEmailRequest as UserServiceSetEmailRequest, +) +from zitadel_client.models.user_service_set_email_response import ( + UserServiceSetEmailResponse as UserServiceSetEmailResponse, +) +from zitadel_client.models.user_service_set_human_email import ( + UserServiceSetHumanEmail as UserServiceSetHumanEmail, +) +from zitadel_client.models.user_service_set_human_phone import ( + UserServiceSetHumanPhone as UserServiceSetHumanPhone, +) +from zitadel_client.models.user_service_set_human_profile import ( + UserServiceSetHumanProfile as UserServiceSetHumanProfile, +) +from zitadel_client.models.user_service_set_metadata_entry import ( + UserServiceSetMetadataEntry as UserServiceSetMetadataEntry, +) +from zitadel_client.models.user_service_set_password import ( + UserServiceSetPassword as UserServiceSetPassword, +) +from zitadel_client.models.user_service_set_password_request import ( + UserServiceSetPasswordRequest as UserServiceSetPasswordRequest, +) +from zitadel_client.models.user_service_set_password_response import ( + UserServiceSetPasswordResponse as UserServiceSetPasswordResponse, +) +from zitadel_client.models.user_service_set_phone_request import ( + UserServiceSetPhoneRequest as UserServiceSetPhoneRequest, +) +from zitadel_client.models.user_service_set_phone_response import ( + UserServiceSetPhoneResponse as UserServiceSetPhoneResponse, +) +from zitadel_client.models.user_service_set_user_metadata_request import ( + UserServiceSetUserMetadataRequest as UserServiceSetUserMetadataRequest, +) +from zitadel_client.models.user_service_set_user_metadata_response import ( + UserServiceSetUserMetadataResponse as UserServiceSetUserMetadataResponse, +) +from zitadel_client.models.user_service_start_identity_provider_intent_request import ( + UserServiceStartIdentityProviderIntentRequest as UserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_start_identity_provider_intent_response import ( + UserServiceStartIdentityProviderIntentResponse as UserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_state_query import ( + UserServiceStateQuery as UserServiceStateQuery, +) +from zitadel_client.models.user_service_text_filter_method import ( + UserServiceTextFilterMethod as UserServiceTextFilterMethod, +) +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod as UserServiceTextQueryMethod, +) +from zitadel_client.models.user_service_timestamp_filter import ( + UserServiceTimestampFilter as UserServiceTimestampFilter, +) +from zitadel_client.models.user_service_timestamp_filter_method import ( + UserServiceTimestampFilterMethod as UserServiceTimestampFilterMethod, +) +from zitadel_client.models.user_service_type import ( + UserServiceType as UserServiceType, +) +from zitadel_client.models.user_service_type_query import ( + UserServiceTypeQuery as UserServiceTypeQuery, +) +from zitadel_client.models.user_service_unlock_user_request import ( + UserServiceUnlockUserRequest as UserServiceUnlockUserRequest, +) +from zitadel_client.models.user_service_unlock_user_response import ( + UserServiceUnlockUserResponse as UserServiceUnlockUserResponse, +) +from zitadel_client.models.user_service_update_human_user_request import ( + UserServiceUpdateHumanUserRequest as UserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.user_service_update_human_user_response import ( + UserServiceUpdateHumanUserResponse as UserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.user_service_update_user_request import ( + UserServiceUpdateUserRequest as UserServiceUpdateUserRequest, +) +from zitadel_client.models.user_service_update_user_response import ( + UserServiceUpdateUserResponse as UserServiceUpdateUserResponse, +) +from zitadel_client.models.user_service_user import ( + UserServiceUser as UserServiceUser, +) +from zitadel_client.models.user_service_user_field_name import ( + UserServiceUserFieldName as UserServiceUserFieldName, +) +from zitadel_client.models.user_service_user_name_query import ( + UserServiceUserNameQuery as UserServiceUserNameQuery, +) +from zitadel_client.models.user_service_user_state import ( + UserServiceUserState as UserServiceUserState, +) +from zitadel_client.models.user_service_verify_email_request import ( + UserServiceVerifyEmailRequest as UserServiceVerifyEmailRequest, +) +from zitadel_client.models.user_service_verify_email_response import ( + UserServiceVerifyEmailResponse as UserServiceVerifyEmailResponse, +) +from zitadel_client.models.user_service_verify_invite_code_request import ( + UserServiceVerifyInviteCodeRequest as UserServiceVerifyInviteCodeRequest, +) +from zitadel_client.models.user_service_verify_invite_code_response import ( + UserServiceVerifyInviteCodeResponse as UserServiceVerifyInviteCodeResponse, +) +from zitadel_client.models.user_service_verify_passkey_registration_request import ( + UserServiceVerifyPasskeyRegistrationRequest as UserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.user_service_verify_passkey_registration_response import ( + UserServiceVerifyPasskeyRegistrationResponse as UserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.user_service_verify_phone_request import ( + UserServiceVerifyPhoneRequest as UserServiceVerifyPhoneRequest, +) +from zitadel_client.models.user_service_verify_phone_response import ( + UserServiceVerifyPhoneResponse as UserServiceVerifyPhoneResponse, +) +from zitadel_client.models.user_service_verify_totp_registration_request import ( + UserServiceVerifyTOTPRegistrationRequest as UserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.user_service_verify_totp_registration_response import ( + UserServiceVerifyTOTPRegistrationResponse as UserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.user_service_verify_u2_f_registration_request import ( + UserServiceVerifyU2FRegistrationRequest as UserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.user_service_verify_u2_f_registration_response import ( + UserServiceVerifyU2FRegistrationResponse as UserServiceVerifyU2FRegistrationResponse, +) +from zitadel_client.models.web_key_service_activate_web_key_request import ( + WebKeyServiceActivateWebKeyRequest as WebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.web_key_service_activate_web_key_response import ( + WebKeyServiceActivateWebKeyResponse as WebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.web_key_service_any import ( + WebKeyServiceAny as WebKeyServiceAny, +) +from zitadel_client.models.web_key_service_connect_error import ( + WebKeyServiceConnectError as WebKeyServiceConnectError, +) +from zitadel_client.models.web_key_service_create_web_key_request import ( + WebKeyServiceCreateWebKeyRequest as WebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.web_key_service_create_web_key_response import ( + WebKeyServiceCreateWebKeyResponse as WebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.web_key_service_delete_web_key_request import ( + WebKeyServiceDeleteWebKeyRequest as WebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.web_key_service_delete_web_key_response import ( + WebKeyServiceDeleteWebKeyResponse as WebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.web_key_service_ecdsa import ( + WebKeyServiceECDSA as WebKeyServiceECDSA, +) +from zitadel_client.models.web_key_service_ecdsa_curve import ( + WebKeyServiceECDSACurve as WebKeyServiceECDSACurve, +) +from zitadel_client.models.web_key_service_list_web_keys_response import ( + WebKeyServiceListWebKeysResponse as WebKeyServiceListWebKeysResponse, +) +from zitadel_client.models.web_key_service_rsa import ( + WebKeyServiceRSA as WebKeyServiceRSA, +) +from zitadel_client.models.web_key_service_rsa_bits import ( + WebKeyServiceRSABits as WebKeyServiceRSABits, +) +from zitadel_client.models.web_key_service_rsa_hasher import ( + WebKeyServiceRSAHasher as WebKeyServiceRSAHasher, +) +from zitadel_client.models.web_key_service_state import ( + WebKeyServiceState as WebKeyServiceState, +) +from zitadel_client.models.web_key_service_web_key import ( + WebKeyServiceWebKey as WebKeyServiceWebKey, ) -from .models import * # noqa: F403, F401 -from .transport_options import TransportOptions # noqa F401 -from .zitadel import Zitadel # noqa F401 diff --git a/zitadel_client/_duration.py b/zitadel_client/_duration.py new file mode 100644 index 00000000..42b51971 --- /dev/null +++ b/zitadel_client/_duration.py @@ -0,0 +1,89 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +import datetime +import re +from typing import Annotated + +from pydantic import BeforeValidator, PlainSerializer + +# protobuf-JSON duration strings are an optional-sign integer second count +# with an optional fractional part of up to nine digits, suffixed with 's' +# (e.g. "3600s", "3600.000000001s", "-1.5s"). A protobuf-JSON server validates +# google.protobuf.Duration with exactly this grammar. ``[0-9]`` rather than +# ``\d``: Python's ``\d`` also matches non-ASCII digits such as Arabic-Indic. +_DURATION_RE = re.compile(r"-?[0-9]+(\.[0-9]{1,9})?s") + + +def _format_timedelta_protobuf(value: datetime.timedelta) -> str: + """Format a :class:`datetime.timedelta` as a protobuf-JSON duration. + + google.protobuf.Duration is serialized as a decimal second count with + an ``s`` suffix. Sub-second precision is expressed as 3, 6, or 9 + fractional digits (the smallest grouping that preserves every non-zero + digit). Negative durations carry a leading ``-``. timedelta normalises + negatives oddly (``timedelta(seconds=-1)`` has ``days=-1, seconds=86399``), + so the whole-second and microsecond split is derived from a single signed + microsecond total to keep the sign coherent. + """ + total_micros = ( + value.days * 86400 * 1_000_000 + value.seconds * 1_000_000 + value.microseconds + ) + sign = "-" if total_micros < 0 else "" + total_micros = abs(total_micros) + secs, micros = divmod(total_micros, 1_000_000) + nanos = micros * 1000 + if nanos == 0: + return f"{sign}{secs}s" + # Zero-pad to nine digits, then trim trailing zeros down to the nearest + # 3/6/9-digit boundary so every significant nanosecond digit survives. + frac = f"{nanos:09d}" + if frac.endswith("000000"): + frac = frac[:3] + elif frac.endswith("000"): + frac = frac[:6] + return f"{sign}{secs}.{frac}s" + + +def _parse_timedelta_protobuf(value: datetime.timedelta | str) -> datetime.timedelta: + """Parse a protobuf-JSON duration string into a :class:`datetime.timedelta`. + + Accepts the google.protobuf.Duration grammar ``-?[0-9]+(\\.[0-9]{1,9})?s``. + A :class:`datetime.timedelta` is passed through unchanged so that + constructing a model directly from Python values (not wire JSON) works. + Raises :class:`ValueError` on malformed input. timedelta resolution is + microseconds, so any nanosecond digits below 1µs are truncated. + """ + if isinstance(value, datetime.timedelta): + return value + if not _DURATION_RE.fullmatch(value): + raise ValueError(f"Could not parse {value!r} as a protobuf-JSON duration") + body = value[:-1] + sign = -1 if body.startswith("-") else 1 + body = body.lstrip("-") + if "." in body: + secs_str, frac_str = body.split(".", 1) + else: + secs_str, frac_str = body, "" + secs = int(secs_str) + nanos = int(frac_str.ljust(9, "0")) if frac_str else 0 + micros = nanos // 1000 + return sign * datetime.timedelta(seconds=secs, microseconds=micros) + + +# Reusable annotated alias mapped to every OpenAPI `format: duration` field. +# BeforeValidator runs _parse_timedelta_protobuf on the raw input (wire string +# or a Python timedelta) so model_validate('3600s') yields a timedelta, and +# PlainSerializer(when_used='json') makes model_dump_json emit '3600s' instead +# of pydantic's default ISO-8601 ('PT1H'). Both directions reuse the same +# helpers the ObjectSerializer stringify/_deserialize fallback paths use, so +# the wire format is identical no matter which path a value travels. +ProtobufDuration = Annotated[ + datetime.timedelta, + BeforeValidator(_parse_timedelta_protobuf), + PlainSerializer(_format_timedelta_protobuf, return_type=str, when_used="json"), +] diff --git a/zitadel_client/_types.py b/zitadel_client/_types.py new file mode 100644 index 00000000..6c74a43f --- /dev/null +++ b/zitadel_client/_types.py @@ -0,0 +1,89 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from decimal import Decimal +from typing import Annotated, Any + +from pydantic import ( + AfterValidator, + BeforeValidator, + HttpUrl, + PlainSerializer, + Strict, + TypeAdapter, +) + +# Compiled once at import time and reused for every `format: uri` field. The +# adapter only VALIDATES that a candidate string parses as an absolute http(s) +# URL — it is never used to re-emit the value, so its normalization (trailing +# slash, default-port stripping, host lowercasing) never reaches the wire. +_HTTP_URL_ADAPTER: TypeAdapter[HttpUrl] = TypeAdapter(HttpUrl) + + +def _coerce_int_to_float(value: Any) -> Any: + """Coerce an integral wire value to ``float`` for a strict-float field. + + JSON has a single number type, so a server is free to emit ``5`` (no + decimal point) for a field declared ``format: double``/``float``. Bare + pydantic ``StrictFloat`` rejects that integral value because the parsed + Python type is ``int``, not ``float`` — even though ``5`` is a perfectly + valid double on the wire. Widen ONLY the lossless ``int -> float`` case + here; every other type (``str``, ``bool``, ...) is passed through + untouched so the downstream strict ``float`` validator still rejects it. + ``bool`` is an ``int`` subclass, so it is excluded explicitly to keep the + StrictFloat guarantee that ``True``/``False`` are not silently accepted + as ``1.0``/``0.0``. + """ + if isinstance(value, bool): + return value + if isinstance(value, int): + return float(value) + return value + + +def _validate_url_preserving(value: Any) -> Any: + """Validate a URL string without mutating it. + + ``pydantic.HttpUrl`` validates AND normalizes: it lowercases the host, + strips a default port, and appends a trailing slash to a host-only URL. + That normalization makes a JSON round-trip lossy — ``https://example.com`` + decodes and re-encodes as ``https://example.com/`` — which breaks + byte-identity with every other SDK that keeps the URL verbatim. Here we run + the same parser purely as a VALIDATOR (a non-URL still raises) but return + the ORIGINAL string so the wire value round-trips unchanged. + """ + if value is None: + return value + _HTTP_URL_ADAPTER.validate_python(value) + return value + + +# `format: float` / `format: double` fields. StrictFloat semantics (reject +# str/bool, no lax string coercion) are preserved via `Strict()`; the +# BeforeValidator only widens the legitimate integral-JSON case to float. +LaxFloat = Annotated[float, BeforeValidator(_coerce_int_to_float), Strict()] + +# `format: uri` fields. A plain `str` carrying an AfterValidator that asserts +# the value is a valid absolute http(s) URL but never rewrites it, so the wire +# value round-trips byte-identical (unlike `pydantic.HttpUrl`, which normalizes). +UrlStr = Annotated[str, AfterValidator(_validate_url_preserving)] + +# Bare `type: number` (no `format`) fields. The OpenAPI spec types these as a +# JSON NUMBER, so they must travel on the wire UNQUOTED (`1.5`, not `"1.5"`). +# Decode keeps `decimal.Decimal` for arbitrary-precision fidelity (matching +# BigDecimal in Java/Kotlin and the branded Decimal in Node), but pydantic's +# default Decimal serializer emits a JSON STRING, which violates `type: number` +# and diverges from the SDKs that emit a bare number. The PlainSerializer widens +# the value to `float` ONLY on the JSON encode path (`when_used='json'`) so +# model_dump_json renders an unquoted number; in-Python access and the validated +# field value remain a full-precision Decimal. The JSON number type is itself an +# IEEE-754 double in practically every consumer, so the float widening matches +# what any number-emitting SDK already puts on the wire. +JsonNumber = Annotated[ + Decimal, + PlainSerializer(lambda value: float(value), return_type=float, when_used="json"), +] diff --git a/zitadel_client/api/.openapi b/zitadel_client/api/.openapi deleted file mode 100644 index e69de29b..00000000 diff --git a/zitadel_client/api/__init__.py b/zitadel_client/api/__init__.py index 02cb85a9..0990587e 100644 --- a/zitadel_client/api/__init__.py +++ b/zitadel_client/api/__init__.py @@ -1,33 +1,78 @@ -# flake8: noqa - # import apis into api package -from zitadel_client.api.action_service_api import ActionServiceApi -from zitadel_client.api.application_service_api import ApplicationServiceApi -from zitadel_client.api.authorization_service_api import AuthorizationServiceApi -from zitadel_client.api.beta_action_service_api import BetaActionServiceApi -from zitadel_client.api.beta_app_service_api import BetaAppServiceApi -from zitadel_client.api.beta_authorization_service_api import BetaAuthorizationServiceApi -from zitadel_client.api.beta_feature_service_api import BetaFeatureServiceApi -from zitadel_client.api.beta_instance_service_api import BetaInstanceServiceApi -from zitadel_client.api.beta_internal_permission_service_api import BetaInternalPermissionServiceApi -from zitadel_client.api.beta_oidc_service_api import BetaOIDCServiceApi -from zitadel_client.api.beta_organization_service_api import BetaOrganizationServiceApi -from zitadel_client.api.beta_project_service_api import BetaProjectServiceApi -from zitadel_client.api.beta_session_service_api import BetaSessionServiceApi -from zitadel_client.api.beta_settings_service_api import BetaSettingsServiceApi -from zitadel_client.api.beta_telemetry_service_api import BetaTelemetryServiceApi -from zitadel_client.api.beta_user_service_api import BetaUserServiceApi -from zitadel_client.api.beta_web_key_service_api import BetaWebKeyServiceApi -from zitadel_client.api.feature_service_api import FeatureServiceApi -from zitadel_client.api.identity_provider_service_api import IdentityProviderServiceApi -from zitadel_client.api.instance_service_api import InstanceServiceApi -from zitadel_client.api.internal_permission_service_api import InternalPermissionServiceApi -from zitadel_client.api.oidc_service_api import OIDCServiceApi -from zitadel_client.api.organization_service_api import OrganizationServiceApi -from zitadel_client.api.project_service_api import ProjectServiceApi -from zitadel_client.api.saml_service_api import SAMLServiceApi -from zitadel_client.api.session_service_api import SessionServiceApi -from zitadel_client.api.settings_service_api import SettingsServiceApi -from zitadel_client.api.user_service_api import UserServiceApi -from zitadel_client.api.web_key_service_api import WebKeyServiceApi - +from zitadel_client.api.action_service_api import ActionServiceApi as ActionServiceApi +from zitadel_client.api.application_service_api import ( + ApplicationServiceApi as ApplicationServiceApi, +) +from zitadel_client.api.authorization_service_api import ( + AuthorizationServiceApi as AuthorizationServiceApi, +) +from zitadel_client.api.beta_action_service_api import ( + BetaActionServiceApi as BetaActionServiceApi, +) +from zitadel_client.api.beta_app_service_api import ( + BetaAppServiceApi as BetaAppServiceApi, +) +from zitadel_client.api.beta_authorization_service_api import ( + BetaAuthorizationServiceApi as BetaAuthorizationServiceApi, +) +from zitadel_client.api.beta_feature_service_api import ( + BetaFeatureServiceApi as BetaFeatureServiceApi, +) +from zitadel_client.api.beta_instance_service_api import ( + BetaInstanceServiceApi as BetaInstanceServiceApi, +) +from zitadel_client.api.beta_internal_permission_service_api import ( + BetaInternalPermissionServiceApi as BetaInternalPermissionServiceApi, +) +from zitadel_client.api.beta_oidc_service_api import ( + BetaOIDCServiceApi as BetaOIDCServiceApi, +) +from zitadel_client.api.beta_organization_service_api import ( + BetaOrganizationServiceApi as BetaOrganizationServiceApi, +) +from zitadel_client.api.beta_project_service_api import ( + BetaProjectServiceApi as BetaProjectServiceApi, +) +from zitadel_client.api.beta_session_service_api import ( + BetaSessionServiceApi as BetaSessionServiceApi, +) +from zitadel_client.api.beta_settings_service_api import ( + BetaSettingsServiceApi as BetaSettingsServiceApi, +) +from zitadel_client.api.beta_telemetry_service_api import ( + BetaTelemetryServiceApi as BetaTelemetryServiceApi, +) +from zitadel_client.api.beta_user_service_api import ( + BetaUserServiceApi as BetaUserServiceApi, +) +from zitadel_client.api.beta_web_key_service_api import ( + BetaWebKeyServiceApi as BetaWebKeyServiceApi, +) +from zitadel_client.api.feature_service_api import ( + FeatureServiceApi as FeatureServiceApi, +) +from zitadel_client.api.identity_provider_service_api import ( + IdentityProviderServiceApi as IdentityProviderServiceApi, +) +from zitadel_client.api.instance_service_api import ( + InstanceServiceApi as InstanceServiceApi, +) +from zitadel_client.api.internal_permission_service_api import ( + InternalPermissionServiceApi as InternalPermissionServiceApi, +) +from zitadel_client.api.oidc_service_api import OIDCServiceApi as OIDCServiceApi +from zitadel_client.api.organization_service_api import ( + OrganizationServiceApi as OrganizationServiceApi, +) +from zitadel_client.api.project_service_api import ( + ProjectServiceApi as ProjectServiceApi, +) +from zitadel_client.api.saml_service_api import SAMLServiceApi as SAMLServiceApi +from zitadel_client.api.session_service_api import ( + SessionServiceApi as SessionServiceApi, +) +from zitadel_client.api.settings_service_api import ( + SettingsServiceApi as SettingsServiceApi, +) +from zitadel_client.api.user_service_api import UserServiceApi as UserServiceApi +from zitadel_client.api.web_key_service_api import WebKeyServiceApi as WebKeyServiceApi diff --git a/zitadel_client/api/action_service_api.py b/zitadel_client/api/action_service_api.py index 04f09f7c..716aefb4 100644 --- a/zitadel_client/api/action_service_api.py +++ b/zitadel_client/api/action_service_api.py @@ -1,1993 +1,1081 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.action_service_activate_public_key_request import ActionServiceActivatePublicKeyRequest -from zitadel_client.models.action_service_activate_public_key_response import ActionServiceActivatePublicKeyResponse -from zitadel_client.models.action_service_add_public_key_request import ActionServiceAddPublicKeyRequest -from zitadel_client.models.action_service_add_public_key_response import ActionServiceAddPublicKeyResponse -from zitadel_client.models.action_service_create_target_request import ActionServiceCreateTargetRequest -from zitadel_client.models.action_service_create_target_response import ActionServiceCreateTargetResponse -from zitadel_client.models.action_service_deactivate_public_key_request import ActionServiceDeactivatePublicKeyRequest -from zitadel_client.models.action_service_deactivate_public_key_response import ActionServiceDeactivatePublicKeyResponse -from zitadel_client.models.action_service_delete_target_request import ActionServiceDeleteTargetRequest -from zitadel_client.models.action_service_delete_target_response import ActionServiceDeleteTargetResponse -from zitadel_client.models.action_service_get_target_request import ActionServiceGetTargetRequest -from zitadel_client.models.action_service_get_target_response import ActionServiceGetTargetResponse -from zitadel_client.models.action_service_list_execution_functions_response import ActionServiceListExecutionFunctionsResponse -from zitadel_client.models.action_service_list_execution_methods_response import ActionServiceListExecutionMethodsResponse -from zitadel_client.models.action_service_list_execution_services_response import ActionServiceListExecutionServicesResponse -from zitadel_client.models.action_service_list_executions_request import ActionServiceListExecutionsRequest -from zitadel_client.models.action_service_list_executions_response import ActionServiceListExecutionsResponse -from zitadel_client.models.action_service_list_public_keys_request import ActionServiceListPublicKeysRequest -from zitadel_client.models.action_service_list_public_keys_response import ActionServiceListPublicKeysResponse -from zitadel_client.models.action_service_list_targets_request import ActionServiceListTargetsRequest -from zitadel_client.models.action_service_list_targets_response import ActionServiceListTargetsResponse -from zitadel_client.models.action_service_remove_public_key_request import ActionServiceRemovePublicKeyRequest -from zitadel_client.models.action_service_remove_public_key_response import ActionServiceRemovePublicKeyResponse -from zitadel_client.models.action_service_set_execution_request import ActionServiceSetExecutionRequest -from zitadel_client.models.action_service_set_execution_response import ActionServiceSetExecutionResponse -from zitadel_client.models.action_service_update_target_request import ActionServiceUpdateTargetRequest -from zitadel_client.models.action_service_update_target_response import ActionServiceUpdateTargetResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class ActionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def activate_public_key( self, action_service_activate_public_key_request: ActionServiceActivatePublicKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceActivatePublicKeyResponse: - """Activate Public Key +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.action_service_activate_public_key_request import ( + ActionServiceActivatePublicKeyRequest, +) +from zitadel_client.models.action_service_activate_public_key_response import ( + ActionServiceActivatePublicKeyResponse, +) +from zitadel_client.models.action_service_add_public_key_request import ( + ActionServiceAddPublicKeyRequest, +) +from zitadel_client.models.action_service_add_public_key_response import ( + ActionServiceAddPublicKeyResponse, +) +from zitadel_client.models.action_service_create_target_request import ( + ActionServiceCreateTargetRequest, +) +from zitadel_client.models.action_service_create_target_response import ( + ActionServiceCreateTargetResponse, +) +from zitadel_client.models.action_service_deactivate_public_key_request import ( + ActionServiceDeactivatePublicKeyRequest, +) +from zitadel_client.models.action_service_deactivate_public_key_response import ( + ActionServiceDeactivatePublicKeyResponse, +) +from zitadel_client.models.action_service_delete_target_request import ( + ActionServiceDeleteTargetRequest, +) +from zitadel_client.models.action_service_delete_target_response import ( + ActionServiceDeleteTargetResponse, +) +from zitadel_client.models.action_service_get_target_request import ( + ActionServiceGetTargetRequest, +) +from zitadel_client.models.action_service_get_target_response import ( + ActionServiceGetTargetResponse, +) +from zitadel_client.models.action_service_list_execution_functions_response import ( + ActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.action_service_list_execution_methods_response import ( + ActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.action_service_list_execution_services_response import ( + ActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.action_service_list_executions_request import ( + ActionServiceListExecutionsRequest, +) +from zitadel_client.models.action_service_list_executions_response import ( + ActionServiceListExecutionsResponse, +) +from zitadel_client.models.action_service_list_public_keys_request import ( + ActionServiceListPublicKeysRequest, +) +from zitadel_client.models.action_service_list_public_keys_response import ( + ActionServiceListPublicKeysResponse, +) +from zitadel_client.models.action_service_list_targets_request import ( + ActionServiceListTargetsRequest, +) +from zitadel_client.models.action_service_list_targets_response import ( + ActionServiceListTargetsResponse, +) +from zitadel_client.models.action_service_remove_public_key_request import ( + ActionServiceRemovePublicKeyRequest, +) +from zitadel_client.models.action_service_remove_public_key_response import ( + ActionServiceRemovePublicKeyResponse, +) +from zitadel_client.models.action_service_set_execution_request import ( + ActionServiceSetExecutionRequest, +) +from zitadel_client.models.action_service_set_execution_response import ( + ActionServiceSetExecutionResponse, +) +from zitadel_client.models.action_service_update_target_request import ( + ActionServiceUpdateTargetRequest, +) +from zitadel_client.models.action_service_update_target_response import ( + ActionServiceUpdateTargetResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class ActionServiceApi(BaseApi): + """ActionServiceApi provides methods for the ActionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def activate_public_key( + self, + action_service_activate_public_key_request: ActionServiceActivatePublicKeyRequest, + ) -> ActionServiceActivatePublicKeyResponse: + """Activate Public Key Activates the public key for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. Activating a new key will deactivate the current active key. Only one key can be active at a time. The active key is indicated in the `kid` header in the JWE token sent to the target. Activating a key that is already active is a no-op. Required permission: - `action.target.write` + :param action_service_activate_public_key_request: (required) + + :return: ActionServiceActivatePublicKeyResponse + :raises ApiException: if fails to make API call + """ + if action_service_activate_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_activate_public_key_request'" + ) - :param action_service_activate_public_key_request: (required) - :type action_service_activate_public_key_request: ActionServiceActivatePublicKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_public_key_serialize( - action_service_activate_public_key_request=action_service_activate_public_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_public_key_with_http_info( + action_service_activate_public_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceActivatePublicKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_public_key_serialize( + async def activate_public_key_with_http_info( self, - action_service_activate_public_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_activate_public_key_request is not None: - _body_params = action_service_activate_public_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_activate_public_key_request: ActionServiceActivatePublicKeyRequest, + ) -> "ApiResult[ActionServiceActivatePublicKeyResponse]": + """Activate Public Key (with HTTP info) + Activates the public key for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. Activating a new key will deactivate the current active key. Only one key can be active at a time. The active key is indicated in the `kid` header in the JWE token sent to the target. Activating a key that is already active is a no-op. Required permission: - `action.target.write` + :param action_service_activate_public_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_activate_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_activate_public_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ActivatePublicKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/ActivatePublicKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_activate_public_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceActivatePublicKeyResponse", + None, ) - - - - @validate_call - def add_public_key( self, action_service_add_public_key_request: ActionServiceAddPublicKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceAddPublicKeyResponse: + async def add_public_key( + self, + action_service_add_public_key_request: ActionServiceAddPublicKeyRequest, + ) -> ActionServiceAddPublicKeyResponse: """Add Public Key - Adds a public key to the target for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. The public key must be in PEM format and be either an RSA or an EC key. On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove), but also will be used as the `kid` header in the JWE token sent to the target to indicate which key was used for encryption. Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption. Providing an optional expiration date allows you to set a validity period for the key. After the expiration date, the key will be automatically deactivated and no longer used for payload encryption. Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions. You can have multiple inactive keys for rotation purposes, but only one active key at a time. Required permission: - `action.target.write` + :param action_service_add_public_key_request: (required) + + :return: ActionServiceAddPublicKeyResponse + :raises ApiException: if fails to make API call + """ + if action_service_add_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_add_public_key_request'" + ) - :param action_service_add_public_key_request: (required) - :type action_service_add_public_key_request: ActionServiceAddPublicKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_public_key_serialize( - action_service_add_public_key_request=action_service_add_public_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_public_key_with_http_info( + action_service_add_public_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceAddPublicKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_public_key_serialize( + async def add_public_key_with_http_info( self, - action_service_add_public_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_add_public_key_request is not None: - _body_params = action_service_add_public_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_add_public_key_request: ActionServiceAddPublicKeyRequest, + ) -> "ApiResult[ActionServiceAddPublicKeyResponse]": + """Add Public Key (with HTTP info) + Adds a public key to the target for payload encryption. The public key is used to encrypt the payload sent to the target when the payload type is set to `PAYLOAD_TYPE_JWE`. The public key must be in PEM format and be either an RSA or an EC key. On a successful addition, a key ID is returned which can not only be used to manage the key (activate, remove), but also will be used as the `kid` header in the JWE token sent to the target to indicate which key was used for encryption. Note that newly added keys are inactive by default. You must activate the key to use it for payload encryption. Providing an optional expiration date allows you to set a validity period for the key. After the expiration date, the key will be automatically deactivated and no longer used for payload encryption. Be sure to activate a new key before the current active key expires to avoid interruptions in your target executions. You can have multiple inactive keys for rotation purposes, but only one active key at a time. Required permission: - `action.target.write` + :param action_service_add_public_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_add_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_add_public_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/AddPublicKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/AddPublicKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_add_public_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceAddPublicKeyResponse", + None, ) - - - - @validate_call - def create_target( self, action_service_create_target_request: Optional[ActionServiceCreateTargetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceCreateTargetResponse: - if action_service_create_target_request is None: - action_service_create_target_request = {} + async def create_target( + self, + action_service_create_target_request: ActionServiceCreateTargetRequest, + ) -> ActionServiceCreateTargetResponse: """Create Target - Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + :param action_service_create_target_request: (required) - :param action_service_create_target_request: (required) - :type action_service_create_target_request: ActionServiceCreateTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_target_serialize( - action_service_create_target_request=action_service_create_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: ActionServiceCreateTargetResponse + :raises ApiException: if fails to make API call + """ + if action_service_create_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_create_target_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceCreateTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_target_with_http_info( + action_service_create_target_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_target_serialize( - self, - action_service_create_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_create_target_request is not None: - _body_params = action_service_create_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/CreateTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + async def create_target_with_http_info( + self, + action_service_create_target_request: ActionServiceCreateTargetRequest, + ) -> "ApiResult[ActionServiceCreateTargetResponse]": + """Create Target (with HTTP info) + Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + :param action_service_create_target_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_create_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_create_target_request'" + ) + path = "/zitadel.action.v2.ActionService/CreateTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_create_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceCreateTargetResponse", + None, + ) - @validate_call - def deactivate_public_key( self, action_service_deactivate_public_key_request: ActionServiceDeactivatePublicKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceDeactivatePublicKeyResponse: + async def deactivate_public_key( + self, + action_service_deactivate_public_key_request: ActionServiceDeactivatePublicKeyRequest, + ) -> ActionServiceDeactivatePublicKeyResponse: """Deactivate Public Key - Deactivates the public key for payload encryption. The public key will no longer be used to encrypt payloads sent to the target. Be aware that deactivating the active key will leave the target without an active key. Subsequent calls to the target with payload type `PAYLOAD_TYPE_JWE` will fail until a new key is activated. This endpoint can be used in break glass scenarios to quickly disable a compromised key. Deactivating a key that is already inactive is a no-op. Required permission: - `action.target.write` + :param action_service_deactivate_public_key_request: (required) + + :return: ActionServiceDeactivatePublicKeyResponse + :raises ApiException: if fails to make API call + """ + if action_service_deactivate_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_deactivate_public_key_request'" + ) - :param action_service_deactivate_public_key_request: (required) - :type action_service_deactivate_public_key_request: ActionServiceDeactivatePublicKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_public_key_serialize( - action_service_deactivate_public_key_request=action_service_deactivate_public_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_public_key_with_http_info( + action_service_deactivate_public_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceDeactivatePublicKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_public_key_serialize( + async def deactivate_public_key_with_http_info( self, - action_service_deactivate_public_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_deactivate_public_key_request is not None: - _body_params = action_service_deactivate_public_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_deactivate_public_key_request: ActionServiceDeactivatePublicKeyRequest, + ) -> "ApiResult[ActionServiceDeactivatePublicKeyResponse]": + """Deactivate Public Key (with HTTP info) + Deactivates the public key for payload encryption. The public key will no longer be used to encrypt payloads sent to the target. Be aware that deactivating the active key will leave the target without an active key. Subsequent calls to the target with payload type `PAYLOAD_TYPE_JWE` will fail until a new key is activated. This endpoint can be used in break glass scenarios to quickly disable a compromised key. Deactivating a key that is already inactive is a no-op. Required permission: - `action.target.write` + :param action_service_deactivate_public_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_deactivate_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_deactivate_public_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/DeactivatePublicKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/DeactivatePublicKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_deactivate_public_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceDeactivatePublicKeyResponse", + None, ) - - - - @validate_call - def delete_target( self, action_service_delete_target_request: ActionServiceDeleteTargetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceDeleteTargetResponse: + async def delete_target( + self, + action_service_delete_target_request: ActionServiceDeleteTargetRequest, + ) -> ActionServiceDeleteTargetResponse: """Delete Target - Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + :param action_service_delete_target_request: (required) + + :return: ActionServiceDeleteTargetResponse + :raises ApiException: if fails to make API call + """ + if action_service_delete_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_delete_target_request'" + ) - :param action_service_delete_target_request: (required) - :type action_service_delete_target_request: ActionServiceDeleteTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_target_serialize( - action_service_delete_target_request=action_service_delete_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_target_with_http_info( + action_service_delete_target_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceDeleteTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_target_serialize( + async def delete_target_with_http_info( self, - action_service_delete_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_delete_target_request is not None: - _body_params = action_service_delete_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_delete_target_request: ActionServiceDeleteTargetRequest, + ) -> "ApiResult[ActionServiceDeleteTargetResponse]": + """Delete Target (with HTTP info) + Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + :param action_service_delete_target_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_delete_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_delete_target_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/DeleteTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/DeleteTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_delete_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceDeleteTargetResponse", + None, ) - - - - @validate_call - def get_target( self, action_service_get_target_request: ActionServiceGetTargetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceGetTargetResponse: + async def get_target( + self, + action_service_get_target_request: ActionServiceGetTargetRequest, + ) -> ActionServiceGetTargetResponse: """Get Target - Returns the target identified by the requested ID. Required permission: - `action.target.read` + :param action_service_get_target_request: (required) + + :return: ActionServiceGetTargetResponse + :raises ApiException: if fails to make API call + """ + if action_service_get_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_get_target_request'" + ) - :param action_service_get_target_request: (required) - :type action_service_get_target_request: ActionServiceGetTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_target_serialize( - action_service_get_target_request=action_service_get_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceGetTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.get_target_with_http_info(action_service_get_target_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_target_serialize( + async def get_target_with_http_info( self, - action_service_get_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_get_target_request is not None: - _body_params = action_service_get_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_get_target_request: ActionServiceGetTargetRequest, + ) -> "ApiResult[ActionServiceGetTargetResponse]": + """Get Target (with HTTP info) + Returns the target identified by the requested ID. Required permission: - `action.target.read` + :param action_service_get_target_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_get_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_get_target_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/GetTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/GetTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_get_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceGetTargetResponse", + None, ) - - - - @validate_call - def list_execution_functions( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListExecutionFunctionsResponse: - if body is None: - body = {} + async def list_execution_functions( + self, + body: object, + ) -> ActionServiceListExecutionFunctionsResponse: """List Execution Functions - List all available functions which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_functions_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListExecutionFunctionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: ActionServiceListExecutionFunctionsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_functions_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_functions_serialize( + async def list_execution_functions_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[ActionServiceListExecutionFunctionsResponse]": + """List Execution Functions (with HTTP info) + List all available functions which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListExecutionFunctions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2.ActionService/ListExecutionFunctions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListExecutionFunctionsResponse", + None, ) - - - - @validate_call - def list_execution_methods( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListExecutionMethodsResponse: - if body is None: - body = {} + async def list_execution_methods( + self, + body: object, + ) -> ActionServiceListExecutionMethodsResponse: """List Execution Methods - List all available methods which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_methods_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListExecutionMethodsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: ActionServiceListExecutionMethodsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_methods_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_methods_serialize( + async def list_execution_methods_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[ActionServiceListExecutionMethodsResponse]": + """List Execution Methods (with HTTP info) + List all available methods which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListExecutionMethods', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2.ActionService/ListExecutionMethods" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListExecutionMethodsResponse", + None, ) - - - - @validate_call - def list_execution_services( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListExecutionServicesResponse: - if body is None: - body = {} + async def list_execution_services( + self, + body: object, + ) -> ActionServiceListExecutionServicesResponse: """List Execution Services - List all available services which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_services_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListExecutionServicesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: ActionServiceListExecutionServicesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_services_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_services_serialize( + async def list_execution_services_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[ActionServiceListExecutionServicesResponse]": + """List Execution Services (with HTTP info) + List all available services which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListExecutionServices', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2.ActionService/ListExecutionServices" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListExecutionServicesResponse", + None, ) - - - - @validate_call - def list_executions( self, action_service_list_executions_request: ActionServiceListExecutionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListExecutionsResponse: + async def list_executions( + self, + action_service_list_executions_request: ActionServiceListExecutionsRequest, + ) -> ActionServiceListExecutionsResponse: """List Executions - List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + :param action_service_list_executions_request: (required) + + :return: ActionServiceListExecutionsResponse + :raises ApiException: if fails to make API call + """ + if action_service_list_executions_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_executions_request'" + ) - :param action_service_list_executions_request: (required) - :type action_service_list_executions_request: ActionServiceListExecutionsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_executions_serialize( - action_service_list_executions_request=action_service_list_executions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_executions_with_http_info( + action_service_list_executions_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListExecutionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_executions_serialize( + async def list_executions_with_http_info( self, - action_service_list_executions_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_list_executions_request is not None: - _body_params = action_service_list_executions_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_list_executions_request: ActionServiceListExecutionsRequest, + ) -> "ApiResult[ActionServiceListExecutionsResponse]": + """List Executions (with HTTP info) + List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + :param action_service_list_executions_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_list_executions_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_executions_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListExecutions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/ListExecutions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_list_executions_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListExecutionsResponse", + None, ) - - - - @validate_call - def list_public_keys( self, action_service_list_public_keys_request: ActionServiceListPublicKeysRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListPublicKeysResponse: + async def list_public_keys( + self, + action_service_list_public_keys_request: ActionServiceListPublicKeysRequest, + ) -> ActionServiceListPublicKeysResponse: """List Public Keys - Lists all public keys of a target. The response includes which key is active and the key's expiration dates. This allows you to manage key rotations and ensure that your target always has an active key for payload encryption. Required permission: - `action.target.read` + :param action_service_list_public_keys_request: (required) + + :return: ActionServiceListPublicKeysResponse + :raises ApiException: if fails to make API call + """ + if action_service_list_public_keys_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_public_keys_request'" + ) - :param action_service_list_public_keys_request: (required) - :type action_service_list_public_keys_request: ActionServiceListPublicKeysRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_public_keys_serialize( - action_service_list_public_keys_request=action_service_list_public_keys_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_public_keys_with_http_info( + action_service_list_public_keys_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListPublicKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_public_keys_serialize( + async def list_public_keys_with_http_info( self, - action_service_list_public_keys_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_list_public_keys_request is not None: - _body_params = action_service_list_public_keys_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_list_public_keys_request: ActionServiceListPublicKeysRequest, + ) -> "ApiResult[ActionServiceListPublicKeysResponse]": + """List Public Keys (with HTTP info) + Lists all public keys of a target. The response includes which key is active and the key's expiration dates. This allows you to manage key rotations and ensure that your target always has an active key for payload encryption. Required permission: - `action.target.read` + :param action_service_list_public_keys_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_list_public_keys_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_public_keys_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListPublicKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/ListPublicKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_list_public_keys_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListPublicKeysResponse", + None, ) - - - - @validate_call - def list_targets( self, action_service_list_targets_request: ActionServiceListTargetsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceListTargetsResponse: + async def list_targets( + self, + action_service_list_targets_request: ActionServiceListTargetsRequest, + ) -> ActionServiceListTargetsResponse: """List targets - List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + :param action_service_list_targets_request: (required) + + :return: ActionServiceListTargetsResponse + :raises ApiException: if fails to make API call + """ + if action_service_list_targets_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_targets_request'" + ) - :param action_service_list_targets_request: (required) - :type action_service_list_targets_request: ActionServiceListTargetsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_targets_serialize( - action_service_list_targets_request=action_service_list_targets_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_targets_with_http_info( + action_service_list_targets_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceListTargetsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_targets_serialize( + async def list_targets_with_http_info( self, - action_service_list_targets_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_list_targets_request is not None: - _body_params = action_service_list_targets_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_list_targets_request: ActionServiceListTargetsRequest, + ) -> "ApiResult[ActionServiceListTargetsResponse]": + """List targets (with HTTP info) + List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + :param action_service_list_targets_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_list_targets_request is None: + raise ValueError( + "Missing the required parameter 'action_service_list_targets_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/ListTargets', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/ListTargets" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_list_targets_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceListTargetsResponse", + None, ) - - - - @validate_call - def remove_public_key( self, action_service_remove_public_key_request: ActionServiceRemovePublicKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceRemovePublicKeyResponse: + async def remove_public_key( + self, + action_service_remove_public_key_request: ActionServiceRemovePublicKeyRequest, + ) -> ActionServiceRemovePublicKeyResponse: """Remove Public Key - Removes the public key from the target. This is a permanent action and can not be undone. Note that you can only remove inactive keys. Attempting to remove an active key will result in an error. For break glass scenarios, deactivate the key first and then remove it. Removing a non-existing key is a no-op. Required permission: - `action.target.write` + :param action_service_remove_public_key_request: (required) + + :return: ActionServiceRemovePublicKeyResponse + :raises ApiException: if fails to make API call + """ + if action_service_remove_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_remove_public_key_request'" + ) - :param action_service_remove_public_key_request: (required) - :type action_service_remove_public_key_request: ActionServiceRemovePublicKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_public_key_serialize( - action_service_remove_public_key_request=action_service_remove_public_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_public_key_with_http_info( + action_service_remove_public_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceRemovePublicKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_public_key_serialize( + async def remove_public_key_with_http_info( self, - action_service_remove_public_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_remove_public_key_request is not None: - _body_params = action_service_remove_public_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_remove_public_key_request: ActionServiceRemovePublicKeyRequest, + ) -> "ApiResult[ActionServiceRemovePublicKeyResponse]": + """Remove Public Key (with HTTP info) + Removes the public key from the target. This is a permanent action and can not be undone. Note that you can only remove inactive keys. Attempting to remove an active key will result in an error. For break glass scenarios, deactivate the key first and then remove it. Removing a non-existing key is a no-op. Required permission: - `action.target.write` + :param action_service_remove_public_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_remove_public_key_request is None: + raise ValueError( + "Missing the required parameter 'action_service_remove_public_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/RemovePublicKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/RemovePublicKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_remove_public_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceRemovePublicKeyResponse", + None, ) - - - - @validate_call - def set_execution( self, action_service_set_execution_request: ActionServiceSetExecutionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceSetExecutionResponse: + async def set_execution( + self, + action_service_set_execution_request: ActionServiceSetExecutionRequest, + ) -> ActionServiceSetExecutionResponse: """Set Execution - Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + :param action_service_set_execution_request: (required) + + :return: ActionServiceSetExecutionResponse + :raises ApiException: if fails to make API call + """ + if action_service_set_execution_request is None: + raise ValueError( + "Missing the required parameter 'action_service_set_execution_request'" + ) - :param action_service_set_execution_request: (required) - :type action_service_set_execution_request: ActionServiceSetExecutionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_execution_serialize( - action_service_set_execution_request=action_service_set_execution_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_execution_with_http_info( + action_service_set_execution_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceSetExecutionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_execution_serialize( + async def set_execution_with_http_info( self, - action_service_set_execution_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_set_execution_request is not None: - _body_params = action_service_set_execution_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + action_service_set_execution_request: ActionServiceSetExecutionRequest, + ) -> "ApiResult[ActionServiceSetExecutionResponse]": + """Set Execution (with HTTP info) + Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + :param action_service_set_execution_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_set_execution_request is None: + raise ValueError( + "Missing the required parameter 'action_service_set_execution_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/SetExecution', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2.ActionService/SetExecution" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_set_execution_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceSetExecutionResponse", + None, ) - - - - @validate_call - def update_target( self, action_service_update_target_request: Optional[ActionServiceUpdateTargetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ActionServiceUpdateTargetResponse: - if action_service_update_target_request is None: - action_service_update_target_request = {} + async def update_target( + self, + action_service_update_target_request: ActionServiceUpdateTargetRequest, + ) -> ActionServiceUpdateTargetResponse: """Update Target - Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + :param action_service_update_target_request: (required) - :param action_service_update_target_request: (required) - :type action_service_update_target_request: ActionServiceUpdateTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_target_serialize( - action_service_update_target_request=action_service_update_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: ActionServiceUpdateTargetResponse + :raises ApiException: if fails to make API call + """ + if action_service_update_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_update_target_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ActionServiceUpdateTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.update_target_with_http_info( + action_service_update_target_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _update_target_serialize( - self, - action_service_update_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if action_service_update_target_request is not None: - _body_params = action_service_update_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2.ActionService/UpdateTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def update_target_with_http_info( + self, + action_service_update_target_request: ActionServiceUpdateTargetRequest, + ) -> "ApiResult[ActionServiceUpdateTargetResponse]": + """Update Target (with HTTP info) + Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + :param action_service_update_target_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if action_service_update_target_request is None: + raise ValueError( + "Missing the required parameter 'action_service_update_target_request'" + ) + path = "/zitadel.action.v2.ActionService/UpdateTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = action_service_update_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ActionServiceUpdateTargetResponse", + None, + ) diff --git a/zitadel_client/api/application_service_api.py b/zitadel_client/api/application_service_api.py index c0d252f0..4d74b783 100644 --- a/zitadel_client/api/application_service_api.py +++ b/zitadel_client/api/application_service_api.py @@ -1,1599 +1,894 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.application_service_create_application_key_request import ApplicationServiceCreateApplicationKeyRequest -from zitadel_client.models.application_service_create_application_key_response import ApplicationServiceCreateApplicationKeyResponse -from zitadel_client.models.application_service_create_application_request import ApplicationServiceCreateApplicationRequest -from zitadel_client.models.application_service_create_application_response import ApplicationServiceCreateApplicationResponse -from zitadel_client.models.application_service_deactivate_application_request import ApplicationServiceDeactivateApplicationRequest -from zitadel_client.models.application_service_deactivate_application_response import ApplicationServiceDeactivateApplicationResponse -from zitadel_client.models.application_service_delete_application_key_request import ApplicationServiceDeleteApplicationKeyRequest -from zitadel_client.models.application_service_delete_application_key_response import ApplicationServiceDeleteApplicationKeyResponse -from zitadel_client.models.application_service_delete_application_request import ApplicationServiceDeleteApplicationRequest -from zitadel_client.models.application_service_delete_application_response import ApplicationServiceDeleteApplicationResponse -from zitadel_client.models.application_service_generate_client_secret_request import ApplicationServiceGenerateClientSecretRequest -from zitadel_client.models.application_service_generate_client_secret_response import ApplicationServiceGenerateClientSecretResponse -from zitadel_client.models.application_service_get_application_key_request import ApplicationServiceGetApplicationKeyRequest -from zitadel_client.models.application_service_get_application_key_response import ApplicationServiceGetApplicationKeyResponse -from zitadel_client.models.application_service_get_application_request import ApplicationServiceGetApplicationRequest -from zitadel_client.models.application_service_get_application_response import ApplicationServiceGetApplicationResponse -from zitadel_client.models.application_service_list_application_keys_request import ApplicationServiceListApplicationKeysRequest -from zitadel_client.models.application_service_list_application_keys_response import ApplicationServiceListApplicationKeysResponse -from zitadel_client.models.application_service_list_applications_request import ApplicationServiceListApplicationsRequest -from zitadel_client.models.application_service_list_applications_response import ApplicationServiceListApplicationsResponse -from zitadel_client.models.application_service_reactivate_application_request import ApplicationServiceReactivateApplicationRequest -from zitadel_client.models.application_service_reactivate_application_response import ApplicationServiceReactivateApplicationResponse -from zitadel_client.models.application_service_update_application_request import ApplicationServiceUpdateApplicationRequest -from zitadel_client.models.application_service_update_application_response import ApplicationServiceUpdateApplicationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class ApplicationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_application( self, application_service_create_application_request: Optional[ApplicationServiceCreateApplicationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceCreateApplicationResponse: - if application_service_create_application_request is None: - application_service_create_application_request = {} - """Create Application +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.application_service_create_application_key_request import ( + ApplicationServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.application_service_create_application_key_response import ( + ApplicationServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.application_service_create_application_request import ( + ApplicationServiceCreateApplicationRequest, +) +from zitadel_client.models.application_service_create_application_response import ( + ApplicationServiceCreateApplicationResponse, +) +from zitadel_client.models.application_service_deactivate_application_request import ( + ApplicationServiceDeactivateApplicationRequest, +) +from zitadel_client.models.application_service_deactivate_application_response import ( + ApplicationServiceDeactivateApplicationResponse, +) +from zitadel_client.models.application_service_delete_application_key_request import ( + ApplicationServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.application_service_delete_application_key_response import ( + ApplicationServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.application_service_delete_application_request import ( + ApplicationServiceDeleteApplicationRequest, +) +from zitadel_client.models.application_service_delete_application_response import ( + ApplicationServiceDeleteApplicationResponse, +) +from zitadel_client.models.application_service_generate_client_secret_request import ( + ApplicationServiceGenerateClientSecretRequest, +) +from zitadel_client.models.application_service_generate_client_secret_response import ( + ApplicationServiceGenerateClientSecretResponse, +) +from zitadel_client.models.application_service_get_application_key_request import ( + ApplicationServiceGetApplicationKeyRequest, +) +from zitadel_client.models.application_service_get_application_key_response import ( + ApplicationServiceGetApplicationKeyResponse, +) +from zitadel_client.models.application_service_get_application_request import ( + ApplicationServiceGetApplicationRequest, +) +from zitadel_client.models.application_service_get_application_response import ( + ApplicationServiceGetApplicationResponse, +) +from zitadel_client.models.application_service_list_application_keys_request import ( + ApplicationServiceListApplicationKeysRequest, +) +from zitadel_client.models.application_service_list_application_keys_response import ( + ApplicationServiceListApplicationKeysResponse, +) +from zitadel_client.models.application_service_list_applications_request import ( + ApplicationServiceListApplicationsRequest, +) +from zitadel_client.models.application_service_list_applications_response import ( + ApplicationServiceListApplicationsResponse, +) +from zitadel_client.models.application_service_reactivate_application_request import ( + ApplicationServiceReactivateApplicationRequest, +) +from zitadel_client.models.application_service_reactivate_application_response import ( + ApplicationServiceReactivateApplicationResponse, +) +from zitadel_client.models.application_service_update_application_request import ( + ApplicationServiceUpdateApplicationRequest, +) +from zitadel_client.models.application_service_update_application_response import ( + ApplicationServiceUpdateApplicationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class ApplicationServiceApi(BaseApi): + """ApplicationServiceApi provides methods for the ApplicationService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def create_application( + self, + application_service_create_application_request: ApplicationServiceCreateApplicationRequest, + ) -> ApplicationServiceCreateApplicationResponse: + """Create Application Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write + :param application_service_create_application_request: (required) - :param application_service_create_application_request: (required) - :type application_service_create_application_request: ApplicationServiceCreateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_application_serialize( - application_service_create_application_request=application_service_create_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: ApplicationServiceCreateApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_create_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_create_application_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceCreateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_application_with_http_info( + application_service_create_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_application_serialize( - self, - application_service_create_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_create_application_request is not None: - _body_params = application_service_create_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/CreateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def create_application_with_http_info( + self, + application_service_create_application_request: ApplicationServiceCreateApplicationRequest, + ) -> "ApiResult[ApplicationServiceCreateApplicationResponse]": + """Create Application (with HTTP info) + Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write + :param application_service_create_application_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_create_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_create_application_request'" + ) + path = "/zitadel.application.v2.ApplicationService/CreateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_create_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceCreateApplicationResponse", + None, + ) - @validate_call - def create_application_key( self, application_service_create_application_key_request: ApplicationServiceCreateApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceCreateApplicationKeyResponse: + async def create_application_key( + self, + application_service_create_application_key_request: ApplicationServiceCreateApplicationKeyRequest, + ) -> ApplicationServiceCreateApplicationKeyResponse: """Create Application Key - Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + :param application_service_create_application_key_request: (required) + + :return: ApplicationServiceCreateApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if application_service_create_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_create_application_key_request'" + ) - :param application_service_create_application_key_request: (required) - :type application_service_create_application_key_request: ApplicationServiceCreateApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_application_key_serialize( - application_service_create_application_key_request=application_service_create_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceCreateApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_application_key_with_http_info( + application_service_create_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_application_key_serialize( - self, - application_service_create_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_create_application_key_request is not None: - _body_params = application_service_create_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def create_application_key_with_http_info( + self, + application_service_create_application_key_request: ApplicationServiceCreateApplicationKeyRequest, + ) -> "ApiResult[ApplicationServiceCreateApplicationKeyResponse]": + """Create Application Key (with HTTP info) + Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + :param application_service_create_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_create_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_create_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/CreateApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/CreateApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_create_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceCreateApplicationKeyResponse", + None, + ) - @validate_call - def deactivate_application( self, application_service_deactivate_application_request: ApplicationServiceDeactivateApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceDeactivateApplicationResponse: + async def deactivate_application( + self, + application_service_deactivate_application_request: ApplicationServiceDeactivateApplicationRequest, + ) -> ApplicationServiceDeactivateApplicationResponse: """Deactivate Application - Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param application_service_deactivate_application_request: (required) + + :return: ApplicationServiceDeactivateApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_deactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_deactivate_application_request'" + ) - :param application_service_deactivate_application_request: (required) - :type application_service_deactivate_application_request: ApplicationServiceDeactivateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_application_serialize( - application_service_deactivate_application_request=application_service_deactivate_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceDeactivateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.deactivate_application_with_http_info( + application_service_deactivate_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _deactivate_application_serialize( - self, - application_service_deactivate_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_deactivate_application_request is not None: - _body_params = application_service_deactivate_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def deactivate_application_with_http_info( + self, + application_service_deactivate_application_request: ApplicationServiceDeactivateApplicationRequest, + ) -> "ApiResult[ApplicationServiceDeactivateApplicationResponse]": + """Deactivate Application (with HTTP info) + Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param application_service_deactivate_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_deactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_deactivate_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/DeactivateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/DeactivateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_deactivate_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceDeactivateApplicationResponse", + None, + ) - @validate_call - def delete_application( self, application_service_delete_application_request: ApplicationServiceDeleteApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceDeleteApplicationResponse: + async def delete_application( + self, + application_service_delete_application_request: ApplicationServiceDeleteApplicationRequest, + ) -> ApplicationServiceDeleteApplicationResponse: """Delete Application - Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete + :param application_service_delete_application_request: (required) + + :return: ApplicationServiceDeleteApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_delete_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_delete_application_request'" + ) - :param application_service_delete_application_request: (required) - :type application_service_delete_application_request: ApplicationServiceDeleteApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_application_serialize( - application_service_delete_application_request=application_service_delete_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceDeleteApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.delete_application_with_http_info( + application_service_delete_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _delete_application_serialize( - self, - application_service_delete_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_delete_application_request is not None: - _body_params = application_service_delete_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def delete_application_with_http_info( + self, + application_service_delete_application_request: ApplicationServiceDeleteApplicationRequest, + ) -> "ApiResult[ApplicationServiceDeleteApplicationResponse]": + """Delete Application (with HTTP info) + Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete + :param application_service_delete_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_delete_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_delete_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/DeleteApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/DeleteApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_delete_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceDeleteApplicationResponse", + None, + ) - @validate_call - def delete_application_key( self, application_service_delete_application_key_request: ApplicationServiceDeleteApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceDeleteApplicationKeyResponse: + async def delete_application_key( + self, + application_service_delete_application_key_request: ApplicationServiceDeleteApplicationKeyRequest, + ) -> ApplicationServiceDeleteApplicationKeyResponse: """Delete Application Key - Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + :param application_service_delete_application_key_request: (required) + + :return: ApplicationServiceDeleteApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if application_service_delete_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_delete_application_key_request'" + ) - :param application_service_delete_application_key_request: (required) - :type application_service_delete_application_key_request: ApplicationServiceDeleteApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_application_key_serialize( - application_service_delete_application_key_request=application_service_delete_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceDeleteApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.delete_application_key_with_http_info( + application_service_delete_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _delete_application_key_serialize( - self, - application_service_delete_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_delete_application_key_request is not None: - _body_params = application_service_delete_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def delete_application_key_with_http_info( + self, + application_service_delete_application_key_request: ApplicationServiceDeleteApplicationKeyRequest, + ) -> "ApiResult[ApplicationServiceDeleteApplicationKeyResponse]": + """Delete Application Key (with HTTP info) + Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + :param application_service_delete_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_delete_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_delete_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/DeleteApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/DeleteApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_delete_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceDeleteApplicationKeyResponse", + None, + ) - @validate_call - def generate_client_secret( self, application_service_generate_client_secret_request: ApplicationServiceGenerateClientSecretRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceGenerateClientSecretResponse: + async def generate_client_secret( + self, + application_service_generate_client_secret_request: ApplicationServiceGenerateClientSecretRequest, + ) -> ApplicationServiceGenerateClientSecretResponse: """Generate Client Secret - Generates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write + :param application_service_generate_client_secret_request: (required) + + :return: ApplicationServiceGenerateClientSecretResponse + :raises ApiException: if fails to make API call + """ + if application_service_generate_client_secret_request is None: + raise ValueError( + "Missing the required parameter 'application_service_generate_client_secret_request'" + ) - :param application_service_generate_client_secret_request: (required) - :type application_service_generate_client_secret_request: ApplicationServiceGenerateClientSecretRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._generate_client_secret_serialize( - application_service_generate_client_secret_request=application_service_generate_client_secret_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceGenerateClientSecretResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.generate_client_secret_with_http_info( + application_service_generate_client_secret_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _generate_client_secret_serialize( - self, - application_service_generate_client_secret_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_generate_client_secret_request is not None: - _body_params = application_service_generate_client_secret_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def generate_client_secret_with_http_info( + self, + application_service_generate_client_secret_request: ApplicationServiceGenerateClientSecretRequest, + ) -> "ApiResult[ApplicationServiceGenerateClientSecretResponse]": + """Generate Client Secret (with HTTP info) + Generates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write + :param application_service_generate_client_secret_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_generate_client_secret_request is None: + raise ValueError( + "Missing the required parameter 'application_service_generate_client_secret_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/GenerateClientSecret', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/GenerateClientSecret" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_generate_client_secret_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceGenerateClientSecretResponse", + None, + ) - @validate_call - def get_application( self, application_service_get_application_request: ApplicationServiceGetApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceGetApplicationResponse: + async def get_application( + self, + application_service_get_application_request: ApplicationServiceGetApplicationRequest, + ) -> ApplicationServiceGetApplicationResponse: """Get Application - Retrieves the application matching the provided ID. Required permissions: - project.app.read + :param application_service_get_application_request: (required) + + :return: ApplicationServiceGetApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_get_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_get_application_request'" + ) - :param application_service_get_application_request: (required) - :type application_service_get_application_request: ApplicationServiceGetApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_serialize( - application_service_get_application_request=application_service_get_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceGetApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_application_with_http_info( + application_service_get_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_application_serialize( - self, - application_service_get_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_get_application_request is not None: - _body_params = application_service_get_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_application_with_http_info( + self, + application_service_get_application_request: ApplicationServiceGetApplicationRequest, + ) -> "ApiResult[ApplicationServiceGetApplicationResponse]": + """Get Application (with HTTP info) + Retrieves the application matching the provided ID. Required permissions: - project.app.read + :param application_service_get_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_get_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_get_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/GetApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/GetApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_get_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceGetApplicationResponse", + None, + ) - @validate_call - def get_application_key( self, application_service_get_application_key_request: ApplicationServiceGetApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceGetApplicationKeyResponse: + async def get_application_key( + self, + application_service_get_application_key_request: ApplicationServiceGetApplicationKeyRequest, + ) -> ApplicationServiceGetApplicationKeyResponse: """Get Application Key - Retrieves the application key matching the provided ID. Specifying a project, organization and application ID is optional but help with filtering/performance. Required permissions: - project.app.read + :param application_service_get_application_key_request: (required) + + :return: ApplicationServiceGetApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if application_service_get_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_get_application_key_request'" + ) - :param application_service_get_application_key_request: (required) - :type application_service_get_application_key_request: ApplicationServiceGetApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_key_serialize( - application_service_get_application_key_request=application_service_get_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceGetApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_application_key_with_http_info( + application_service_get_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_application_key_serialize( - self, - application_service_get_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_get_application_key_request is not None: - _body_params = application_service_get_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_application_key_with_http_info( + self, + application_service_get_application_key_request: ApplicationServiceGetApplicationKeyRequest, + ) -> "ApiResult[ApplicationServiceGetApplicationKeyResponse]": + """Get Application Key (with HTTP info) + Retrieves the application key matching the provided ID. Specifying a project, organization and application ID is optional but help with filtering/performance. Required permissions: - project.app.read + :param application_service_get_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_get_application_key_request is None: + raise ValueError( + "Missing the required parameter 'application_service_get_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/GetApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/GetApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_get_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceGetApplicationKeyResponse", + None, + ) - @validate_call - def list_application_keys( self, application_service_list_application_keys_request: ApplicationServiceListApplicationKeysRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceListApplicationKeysResponse: + async def list_application_keys( + self, + application_service_list_application_keys_request: ApplicationServiceListApplicationKeysRequest, + ) -> ApplicationServiceListApplicationKeysResponse: """List Application Keys - Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by application, project or organization ID. Required permissions: - project.app.read + :param application_service_list_application_keys_request: (required) + + :return: ApplicationServiceListApplicationKeysResponse + :raises ApiException: if fails to make API call + """ + if application_service_list_application_keys_request is None: + raise ValueError( + "Missing the required parameter 'application_service_list_application_keys_request'" + ) - :param application_service_list_application_keys_request: (required) - :type application_service_list_application_keys_request: ApplicationServiceListApplicationKeysRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_application_keys_serialize( - application_service_list_application_keys_request=application_service_list_application_keys_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceListApplicationKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.list_application_keys_with_http_info( + application_service_list_application_keys_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _list_application_keys_serialize( - self, - application_service_list_application_keys_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_list_application_keys_request is not None: - _body_params = application_service_list_application_keys_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def list_application_keys_with_http_info( + self, + application_service_list_application_keys_request: ApplicationServiceListApplicationKeysRequest, + ) -> "ApiResult[ApplicationServiceListApplicationKeysResponse]": + """List Application Keys (with HTTP info) + Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by application, project or organization ID. Required permissions: - project.app.read + :param application_service_list_application_keys_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_list_application_keys_request is None: + raise ValueError( + "Missing the required parameter 'application_service_list_application_keys_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/ListApplicationKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/ListApplicationKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_list_application_keys_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceListApplicationKeysResponse", + None, + ) - @validate_call - def list_applications( self, application_service_list_applications_request: ApplicationServiceListApplicationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceListApplicationsResponse: + async def list_applications( + self, + application_service_list_applications_request: ApplicationServiceListApplicationsRequest, + ) -> ApplicationServiceListApplicationsResponse: """List Applications - Returns a list of applications matching the input parameters. The results can be filtered by project, state, type and name. It can be sorted by id, name, creation date, change date or state. Required permissions: - project.app.read + :param application_service_list_applications_request: (required) + + :return: ApplicationServiceListApplicationsResponse + :raises ApiException: if fails to make API call + """ + if application_service_list_applications_request is None: + raise ValueError( + "Missing the required parameter 'application_service_list_applications_request'" + ) - :param application_service_list_applications_request: (required) - :type application_service_list_applications_request: ApplicationServiceListApplicationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_applications_serialize( - application_service_list_applications_request=application_service_list_applications_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceListApplicationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.list_applications_with_http_info( + application_service_list_applications_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _list_applications_serialize( - self, - application_service_list_applications_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_list_applications_request is not None: - _body_params = application_service_list_applications_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def list_applications_with_http_info( + self, + application_service_list_applications_request: ApplicationServiceListApplicationsRequest, + ) -> "ApiResult[ApplicationServiceListApplicationsResponse]": + """List Applications (with HTTP info) + Returns a list of applications matching the input parameters. The results can be filtered by project, state, type and name. It can be sorted by id, name, creation date, change date or state. Required permissions: - project.app.read + :param application_service_list_applications_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_list_applications_request is None: + raise ValueError( + "Missing the required parameter 'application_service_list_applications_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/ListApplications', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.application.v2.ApplicationService/ListApplications" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_list_applications_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceListApplicationsResponse", + None, + ) - @validate_call - def reactivate_application( self, application_service_reactivate_application_request: ApplicationServiceReactivateApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceReactivateApplicationResponse: + async def reactivate_application( + self, + application_service_reactivate_application_request: ApplicationServiceReactivateApplicationRequest, + ) -> ApplicationServiceReactivateApplicationResponse: """Reactivate Application - Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param application_service_reactivate_application_request: (required) + + :return: ApplicationServiceReactivateApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_reactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_reactivate_application_request'" + ) - :param application_service_reactivate_application_request: (required) - :type application_service_reactivate_application_request: ApplicationServiceReactivateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reactivate_application_serialize( - application_service_reactivate_application_request=application_service_reactivate_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.reactivate_application_with_http_info( + application_service_reactivate_application_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceReactivateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _reactivate_application_serialize( + async def reactivate_application_with_http_info( self, - application_service_reactivate_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_reactivate_application_request is not None: - _body_params = application_service_reactivate_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + application_service_reactivate_application_request: ApplicationServiceReactivateApplicationRequest, + ) -> "ApiResult[ApplicationServiceReactivateApplicationResponse]": + """Reactivate Application (with HTTP info) + Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param application_service_reactivate_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_reactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_reactivate_application_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/ReactivateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.application.v2.ApplicationService/ReactivateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_reactivate_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceReactivateApplicationResponse", + None, + ) - @validate_call - def update_application( self, application_service_update_application_request: Optional[ApplicationServiceUpdateApplicationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApplicationServiceUpdateApplicationResponse: - if application_service_update_application_request is None: - application_service_update_application_request = {} + async def update_application( + self, + application_service_update_application_request: ApplicationServiceUpdateApplicationRequest, + ) -> ApplicationServiceUpdateApplicationResponse: """Update Application - Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write + :param application_service_update_application_request: (required) - :param application_service_update_application_request: (required) - :type application_service_update_application_request: ApplicationServiceUpdateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_application_serialize( - application_service_update_application_request=application_service_update_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: ApplicationServiceUpdateApplicationResponse + :raises ApiException: if fails to make API call + """ + if application_service_update_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_update_application_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ApplicationServiceUpdateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.update_application_with_http_info( + application_service_update_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _update_application_serialize( - self, - application_service_update_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if application_service_update_application_request is not None: - _body_params = application_service_update_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.application.v2.ApplicationService/UpdateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def update_application_with_http_info( + self, + application_service_update_application_request: ApplicationServiceUpdateApplicationRequest, + ) -> "ApiResult[ApplicationServiceUpdateApplicationResponse]": + """Update Application (with HTTP info) + Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write + :param application_service_update_application_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if application_service_update_application_request is None: + raise ValueError( + "Missing the required parameter 'application_service_update_application_request'" + ) + path = "/zitadel.application.v2.ApplicationService/UpdateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = application_service_update_application_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ApplicationServiceUpdateApplicationResponse", + None, + ) diff --git a/zitadel_client/api/authorization_service_api.py b/zitadel_client/api/authorization_service_api.py index 928acfb7..69baadbc 100644 --- a/zitadel_client/api/authorization_service_api.py +++ b/zitadel_client/api/authorization_service_api.py @@ -1,815 +1,462 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.authorization_service_activate_authorization_request import AuthorizationServiceActivateAuthorizationRequest -from zitadel_client.models.authorization_service_activate_authorization_response import AuthorizationServiceActivateAuthorizationResponse -from zitadel_client.models.authorization_service_create_authorization_request import AuthorizationServiceCreateAuthorizationRequest -from zitadel_client.models.authorization_service_create_authorization_response import AuthorizationServiceCreateAuthorizationResponse -from zitadel_client.models.authorization_service_deactivate_authorization_request import AuthorizationServiceDeactivateAuthorizationRequest -from zitadel_client.models.authorization_service_deactivate_authorization_response import AuthorizationServiceDeactivateAuthorizationResponse -from zitadel_client.models.authorization_service_delete_authorization_request import AuthorizationServiceDeleteAuthorizationRequest -from zitadel_client.models.authorization_service_delete_authorization_response import AuthorizationServiceDeleteAuthorizationResponse -from zitadel_client.models.authorization_service_list_authorizations_request import AuthorizationServiceListAuthorizationsRequest -from zitadel_client.models.authorization_service_list_authorizations_response import AuthorizationServiceListAuthorizationsResponse -from zitadel_client.models.authorization_service_update_authorization_request import AuthorizationServiceUpdateAuthorizationRequest -from zitadel_client.models.authorization_service_update_authorization_response import AuthorizationServiceUpdateAuthorizationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class AuthorizationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.authorization_service_activate_authorization_request import ( + AuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_activate_authorization_response import ( + AuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_create_authorization_request import ( + AuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_create_authorization_response import ( + AuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_deactivate_authorization_request import ( + AuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_deactivate_authorization_response import ( + AuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_delete_authorization_request import ( + AuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.authorization_service_delete_authorization_response import ( + AuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.authorization_service_list_authorizations_request import ( + AuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.authorization_service_list_authorizations_response import ( + AuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.authorization_service_update_authorization_request import ( + AuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_update_authorization_response import ( + AuthorizationServiceUpdateAuthorizationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class AuthorizationServiceApi(BaseApi): + """AuthorizationServiceApi provides methods for the AuthorizationService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def activate_authorization( self, authorization_service_activate_authorization_request: AuthorizationServiceActivateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceActivateAuthorizationResponse: + async def activate_authorization( + self, + authorization_service_activate_authorization_request: AuthorizationServiceActivateAuthorizationRequest, + ) -> AuthorizationServiceActivateAuthorizationResponse: """Activate Authorization - ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + :param authorization_service_activate_authorization_request: (required) + + :return: AuthorizationServiceActivateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_activate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_activate_authorization_request'" + ) - :param authorization_service_activate_authorization_request: (required) - :type authorization_service_activate_authorization_request: AuthorizationServiceActivateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_authorization_serialize( - authorization_service_activate_authorization_request=authorization_service_activate_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_authorization_with_http_info( + authorization_service_activate_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceActivateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_authorization_serialize( + async def activate_authorization_with_http_info( self, - authorization_service_activate_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_activate_authorization_request is not None: - _body_params = authorization_service_activate_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_activate_authorization_request: AuthorizationServiceActivateAuthorizationRequest, + ) -> "ApiResult[AuthorizationServiceActivateAuthorizationResponse]": + """Activate Authorization (with HTTP info) + ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + :param authorization_service_activate_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_activate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_activate_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/ActivateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/ActivateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_activate_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceActivateAuthorizationResponse", + None, ) - - - - @validate_call - def create_authorization( self, authorization_service_create_authorization_request: AuthorizationServiceCreateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceCreateAuthorizationResponse: + async def create_authorization( + self, + authorization_service_create_authorization_request: AuthorizationServiceCreateAuthorizationRequest, + ) -> AuthorizationServiceCreateAuthorizationResponse: """Create Authorization - CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + :param authorization_service_create_authorization_request: (required) + + :return: AuthorizationServiceCreateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_create_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_create_authorization_request'" + ) - :param authorization_service_create_authorization_request: (required) - :type authorization_service_create_authorization_request: AuthorizationServiceCreateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_authorization_serialize( - authorization_service_create_authorization_request=authorization_service_create_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_authorization_with_http_info( + authorization_service_create_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceCreateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_authorization_serialize( + async def create_authorization_with_http_info( self, - authorization_service_create_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_create_authorization_request is not None: - _body_params = authorization_service_create_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_create_authorization_request: AuthorizationServiceCreateAuthorizationRequest, + ) -> "ApiResult[AuthorizationServiceCreateAuthorizationResponse]": + """Create Authorization (with HTTP info) + CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + :param authorization_service_create_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_create_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_create_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/CreateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/CreateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_create_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceCreateAuthorizationResponse", + None, ) - - - - @validate_call - def deactivate_authorization( self, authorization_service_deactivate_authorization_request: AuthorizationServiceDeactivateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceDeactivateAuthorizationResponse: + async def deactivate_authorization( + self, + authorization_service_deactivate_authorization_request: AuthorizationServiceDeactivateAuthorizationRequest, + ) -> AuthorizationServiceDeactivateAuthorizationResponse: """Deactivate Authorization - DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + :param authorization_service_deactivate_authorization_request: (required) + + :return: AuthorizationServiceDeactivateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_deactivate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_deactivate_authorization_request'" + ) - :param authorization_service_deactivate_authorization_request: (required) - :type authorization_service_deactivate_authorization_request: AuthorizationServiceDeactivateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_authorization_serialize( - authorization_service_deactivate_authorization_request=authorization_service_deactivate_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_authorization_with_http_info( + authorization_service_deactivate_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceDeactivateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_authorization_serialize( + async def deactivate_authorization_with_http_info( self, - authorization_service_deactivate_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_deactivate_authorization_request is not None: - _body_params = authorization_service_deactivate_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_deactivate_authorization_request: AuthorizationServiceDeactivateAuthorizationRequest, + ) -> "ApiResult[AuthorizationServiceDeactivateAuthorizationResponse]": + """Deactivate Authorization (with HTTP info) + DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + :param authorization_service_deactivate_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_deactivate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_deactivate_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/DeactivateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/DeactivateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_deactivate_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceDeactivateAuthorizationResponse", + None, ) - - - - @validate_call - def delete_authorization( self, authorization_service_delete_authorization_request: AuthorizationServiceDeleteAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceDeleteAuthorizationResponse: + async def delete_authorization( + self, + authorization_service_delete_authorization_request: AuthorizationServiceDeleteAuthorizationRequest, + ) -> AuthorizationServiceDeleteAuthorizationResponse: """Delete Authorization - DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + :param authorization_service_delete_authorization_request: (required) + + :return: AuthorizationServiceDeleteAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_delete_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_delete_authorization_request'" + ) - :param authorization_service_delete_authorization_request: (required) - :type authorization_service_delete_authorization_request: AuthorizationServiceDeleteAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_authorization_serialize( - authorization_service_delete_authorization_request=authorization_service_delete_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_authorization_with_http_info( + authorization_service_delete_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceDeleteAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_authorization_serialize( + async def delete_authorization_with_http_info( self, - authorization_service_delete_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_delete_authorization_request is not None: - _body_params = authorization_service_delete_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_delete_authorization_request: AuthorizationServiceDeleteAuthorizationRequest, + ) -> "ApiResult[AuthorizationServiceDeleteAuthorizationResponse]": + """Delete Authorization (with HTTP info) + DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + :param authorization_service_delete_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_delete_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_delete_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/DeleteAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/DeleteAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_delete_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceDeleteAuthorizationResponse", + None, ) - - - - @validate_call - def list_authorizations( self, authorization_service_list_authorizations_request: AuthorizationServiceListAuthorizationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceListAuthorizationsResponse: + async def list_authorizations( + self, + authorization_service_list_authorizations_request: AuthorizationServiceListAuthorizationsRequest, + ) -> AuthorizationServiceListAuthorizationsResponse: """List Authorizations - ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + :param authorization_service_list_authorizations_request: (required) + + :return: AuthorizationServiceListAuthorizationsResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_list_authorizations_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_list_authorizations_request'" + ) - :param authorization_service_list_authorizations_request: (required) - :type authorization_service_list_authorizations_request: AuthorizationServiceListAuthorizationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_authorizations_serialize( - authorization_service_list_authorizations_request=authorization_service_list_authorizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_authorizations_with_http_info( + authorization_service_list_authorizations_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceListAuthorizationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_authorizations_serialize( + async def list_authorizations_with_http_info( self, - authorization_service_list_authorizations_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_list_authorizations_request is not None: - _body_params = authorization_service_list_authorizations_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_list_authorizations_request: AuthorizationServiceListAuthorizationsRequest, + ) -> "ApiResult[AuthorizationServiceListAuthorizationsResponse]": + """List Authorizations (with HTTP info) + ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + :param authorization_service_list_authorizations_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_list_authorizations_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_list_authorizations_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/ListAuthorizations', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/ListAuthorizations" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_list_authorizations_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceListAuthorizationsResponse", + None, ) - - - - @validate_call - def update_authorization( self, authorization_service_update_authorization_request: AuthorizationServiceUpdateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AuthorizationServiceUpdateAuthorizationResponse: + async def update_authorization( + self, + authorization_service_update_authorization_request: AuthorizationServiceUpdateAuthorizationRequest, + ) -> AuthorizationServiceUpdateAuthorizationResponse: """Update Authorization - UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + :param authorization_service_update_authorization_request: (required) + + :return: AuthorizationServiceUpdateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if authorization_service_update_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_update_authorization_request'" + ) - :param authorization_service_update_authorization_request: (required) - :type authorization_service_update_authorization_request: AuthorizationServiceUpdateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_authorization_serialize( - authorization_service_update_authorization_request=authorization_service_update_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_authorization_with_http_info( + authorization_service_update_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "AuthorizationServiceUpdateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_authorization_serialize( + async def update_authorization_with_http_info( self, - authorization_service_update_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if authorization_service_update_authorization_request is not None: - _body_params = authorization_service_update_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + authorization_service_update_authorization_request: AuthorizationServiceUpdateAuthorizationRequest, + ) -> "ApiResult[AuthorizationServiceUpdateAuthorizationResponse]": + """Update Authorization (with HTTP info) + UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + :param authorization_service_update_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if authorization_service_update_authorization_request is None: + raise ValueError( + "Missing the required parameter 'authorization_service_update_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2.AuthorizationService/UpdateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2.AuthorizationService/UpdateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = authorization_service_update_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "AuthorizationServiceUpdateAuthorizationResponse", + None, ) - - diff --git a/zitadel_client/api/base_api.py b/zitadel_client/api/base_api.py new file mode 100644 index 00000000..4c319dcc --- /dev/null +++ b/zitadel_client/api/base_api.py @@ -0,0 +1,434 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +import asyncio +from typing import Any, Dict, List, Optional, TypeVar, Union +from urllib.parse import quote_plus, urlencode + +from ..api_client import ApiClient +from ..api_http_response import ApiHttpResponse +from ..api_result import ApiResult +from ..default_api_client import DefaultApiClient +from ..configuration import Configuration +from ..object_serializer import ObjectSerializer +from ..value_serializer import ValueSerializer, AllowReservedValue +from ..header_selector import HeaderSelector +from ..trace_context_util import inject_trace_context +from ..errors import ApiException +from ..auth.authenticator import Authenticator + +T = TypeVar("T") + + +class _NoAuth: + """Internal no-auth sentinel type. + + An operation declared with ``security: []`` in the spec is explicitly + unauthenticated. To distinguish "this operation suppresses auth" from + "this operation has no per-call override" (both of which were previously + represented by ``None``), the generated api methods pass the singleton + :data:`NO_AUTH` instance of this type as the ``auth`` argument. + + The auth argument therefore has three states: + + * ``NO_AUTH`` -> no auth applied; do NOT fall back to the + client-level authenticator (``security: []`` operation). + * ``None`` -> no per-call override; fall back to the + client-level authenticator (secured operation). + * a real :class:`Authenticator` -> per-call override; use it. + + The sentinel is identity-comparable (``auth is NO_AUTH``) and never leaves + the generated client; callers never see it. + """ + + __slots__ = () + + +# Module-level singleton no-auth sentinel. Identity-compared in +# _invoke_api_for_result; see _NoAuth for the three-state contract. +NO_AUTH = _NoAuth() + +_COOKIE_NAME_CHARS = frozenset( + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&'*+-.^_`|~" +) + + +def _is_valid_cookie_name(name: str) -> bool: + """RFC 6265 cookie-name validation (RFC 7230 token).""" + if not name: + return False + return all(c in _COOKIE_NAME_CHARS for c in name) + + +def _is_valid_cookie_value(value: str) -> bool: + """RFC 6265 cookie-value validation (cookie-octet*).""" + for c in value: + code = ord(c) + if not ( + code == 0x21 + or 0x23 <= code <= 0x2B + or 0x2D <= code <= 0x3A + or 0x3C <= code <= 0x5B + or 0x5D <= code <= 0x7E + ): + return False + return True + + +class BaseApi: + """Base class for all API classes. + + Provides the invoke_api method that handles URL construction, header + selection, body serialization, request dispatch, and response + deserialization. + """ + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + """Create an API instance. + + When called with no arguments, uses the default configuration and + a default-constructed :class:`DefaultApiClient` (with default + transport settings). + + When called with a configuration only, creates a + :class:`DefaultApiClient` with default transport settings. + + When called with both an api_client and config, uses the provided + instances directly (this is the path used by :class:`Client`). + + Args: + api_client: The HTTP transport client. If ``None``, a + :class:`DefaultApiClient` with default transport is created. + config: API-level configuration (base URL and default headers). + If ``None``, the default configuration is used. + authenticator: Default authenticator for operations without + explicit auth. + """ + self._config = config or Configuration.default_configuration() + self._api_client = api_client or DefaultApiClient() + self._authenticator = authenticator + self._object_serializer = ObjectSerializer() + self._header_selector = HeaderSelector() + + async def _invoke_api_for_result( + self, + method: str, + path: str, + query_params: Dict[str, Any], + header_params: Dict[str, str], + body: Any, + accepts: List[str], + content_type: Optional[str], + return_type: Optional[str], + auth: Union[Authenticator, "_NoAuth", None] = None, + ) -> "ApiResult[Any]": + """Invoke an API operation and return the full result including status + code, headers, and raw body alongside the deserialized data. + + Args: + method: HTTP method (GET, POST, PUT, DELETE, etc.). + path: URL path (with path params already substituted). + query_params: Query parameters. + header_params: Custom header parameters. + body: Request body (model object or None). + accepts: Acceptable response content types. + content_type: Request content type. + return_type: Return type for deserialization (None for void). + auth: Operation-specific auth resolution. Three states: + ``NO_AUTH`` suppresses auth (``security: []`` operation), + ``None`` falls back to the client-level authenticator, and a + real :class:`Authenticator` is a per-call override. + + Returns: + ApiResult containing deserialized data, status code, raw body, + and headers. + + Raises: + ApiException: If the API call fails. + """ + if path.startswith("http://") or path.startswith("https://"): + url = path + else: + # Strip trailing slash from baseUrl when path starts with `/` + # so baseUrl='https://x/' + path='/y' produces 'https://x/y', + # not 'https://x//y' which most servers route to 404. Matches + # Java/C#/Go/Swift/Dart/Kotlin which collapse via URI parsers. + url = ( + self._config.base_url.rstrip("/") + path + if path.startswith("/") + else self._config.base_url + path + ) + + # Resolve auth into three states (see _NoAuth): + # - auth is NO_AUTH -> suppress auth; do NOT fall back to the + # client authenticator (security: [] op). + # - auth is None -> no per-call override; fall back to the + # client-level authenticator. + # - auth is an Authenticator -> per-call override; use it. + effective_auth: Optional[Authenticator] + if isinstance(auth, _NoAuth): + effective_auth = None + elif auth is not None: + effective_auth = auth + else: + effective_auth = self._authenticator + + if effective_auth is not None: + query_params.update(effective_auth.get_query_params()) + + if query_params: + filtered = {k: v for k, v in query_params.items() if v is not None} + if filtered: + # OAS allowReserved: a value wrapped in AllowReservedValue keeps + # RFC 3986 reserved characters literal instead of percent-encoding + # them. Such values are encoded separately, with a + # reserved-preserving quoter, from the default-encoded parameters. + # When no parameter opts in, `reserved` stays empty and the output + # is byte-identical to encoding every parameter with the default + # quoter. + normalized: dict[str, str | list[str]] = {} + reserved: dict[str, str | list[str]] = {} + for k, v in filtered.items(): + target = normalized + if isinstance(v, AllowReservedValue): + v = v.value + target = reserved + if isinstance(v, list): + target[k] = [ + self._object_serializer.stringify(item) for item in v + ] + else: + target[k] = self._object_serializer.stringify(v) + parts: list[str] = [] + if normalized: + parts.append(urlencode(normalized, doseq=True)) + if reserved: + reserved_parts: list[str] = [] + for reserved_key, reserved_value in reserved.items(): + reserved_items = ( + reserved_value + if isinstance(reserved_value, list) + else [reserved_value] + ) + encoded_key = quote_plus(reserved_key) + for reserved_item in reserved_items: + reserved_parts.append( + encoded_key + + "=" + + ValueSerializer.encode_query_allowing_reserved( + reserved_item + ) + ) + parts.append("&".join(reserved_parts)) + query_string = "&".join(parts) + if query_string: + url += "?" + query_string + + is_multipart = content_type == "multipart/form-data" + headers = self._header_selector.select_headers( + accepts, content_type or "", is_multipart + ) + headers.update(self._config.default_headers) + if header_params: + headers.update(header_params) + if effective_auth is not None: + # Offload auth-header acquisition to a worker thread. For OAuth this + # call acquires a threading.Lock and may perform a blocking HTTP + # token exchange; running it inline on the event-loop thread would + # freeze every other coroutine for the duration of the token fetch. + # The request send below is already offloaded via asyncio.to_thread, + # so offloading the auth step keeps the whole auth+send path off the + # loop thread and lets concurrent requests make progress. + auth_headers = await asyncio.to_thread(effective_auth.get_auth_headers) + headers.update(auth_headers) + cookies = effective_auth.get_cookie_params() + if cookies: + # RFC 6265 — don't URL-encode cookie name/value; most cookie + # parsers don't URL-decode, so `=` (base64 padding) would + # arrive as literal `%3D` and break JWT/session cookies. + # Validate and pass through raw instead. + cookie_parts = [] + for k, v in cookies.items(): + name = str(k) + value = str(v) + if not _is_valid_cookie_name(name): + raise ValueError( + f"Cookie name '{name}' contains characters forbidden by RFC 6265" + ) + if not _is_valid_cookie_value(value): + raise ValueError( + f"Cookie value for '{name}' contains characters forbidden by RFC 6265" + ) + cookie_parts.append(f"{name}={value}") + cookie_str = "; ".join(cookie_parts) + existing = headers.get("Cookie", "") + if existing: + headers["Cookie"] = existing + "; " + cookie_str + else: + headers["Cookie"] = cookie_str + inject_trace_context(headers) + + # Remove Content-Type when there is no body (semantically wrong to send it) + if body is None: + headers.pop("Content-Type", None) + + serialized_body = None + if body is not None: + if content_type == "multipart/form-data": + serialized_body = body + elif content_type is not None and ( + content_type.startswith("image/") + or content_type == "application/octet-stream" + ): + # Raw-binary selection. When the operation also declares a + # multipart content type the body was assembled as a dict of + # form parts (file + optional metadata). A raw binary request + # has no envelope, so we must NOT hand that dict to the + # transport -- it would dispatch on `isinstance(body, dict)` + # and emit a multipart/form-data body, contradicting the + # caller's explicit octet-stream selection. Instead, send the + # single file part's raw bytes; the text metadata parts have + # no place on the wire for a raw stream and are dropped. A + # body that is already bytes / a file-like object is passed + # through unchanged. + if isinstance(body, dict): + binary_part = None + for _part_value in body.values(): + if isinstance(_part_value, (bytes, bytearray)) or hasattr( + _part_value, "read" + ): + binary_part = _part_value + break + serialized_body = binary_part if binary_part is not None else body + else: + serialized_body = body + elif content_type == "text/plain": + serialized_body = str(body) + elif content_type == "application/x-www-form-urlencoded": + # Build a (key, value) pair list so array values become + # repeated keys (`tags=a&tags=b`) rather than a single + # `tags=['a', 'b']` Python-repr. Each scalar is stringified + # through ObjectSerializer so bools render as `true`/`false` + # and enums/dates use their wire form, matching the other + # SDKs. None-valued fields are omitted, and None elements + # inside an array are skipped. urlencode(..., doseq=True) + # then percent-encodes with `quote_plus`, so a space becomes + # `+` (HTML form encoding), not `%20`. + form_pairs: List[tuple[str, str]] = [] + for form_key, form_value in body.items(): + if form_value is None: + continue + if isinstance(form_value, list): + for form_item in form_value: + if form_item is None: + continue + form_pairs.append( + (form_key, self._object_serializer.stringify(form_item)) + ) + else: + form_pairs.append( + (form_key, self._object_serializer.stringify(form_value)) + ) + serialized_body = urlencode(form_pairs, doseq=True) + else: + serialized_body = self._object_serializer.serialize(body) + + response = await asyncio.to_thread( + self._api_client.send_request, method, url, headers, serialized_body + ) + + if response.status_code < 200 or response.status_code >= 300: + self._throw_api_exception(response) + + data: Any = None + if return_type is not None and response.body: + resp_content_type = "" + for k, v in response.headers.items(): + if k.lower() == "content-type": + resp_content_type = v.split(";")[0].strip() + break + if resp_content_type and not self._header_selector.is_json_mime( + resp_content_type + ): + if return_type == "bytes": + import base64 + + data = base64.b64decode(response.body) if response.body else b"" + else: + data = response.body + else: + data = self._object_serializer.deserialize(response.body, return_type) + + return ApiResult( + status_code=response.status_code, + data=data, + raw_body=response.body, + headers=response.headers, + ) + + async def _invoke_api( + self, + method: str, + path: str, + query_params: Dict[str, Any], + header_params: Dict[str, str], + body: Any, + accepts: List[str], + content_type: Optional[str], + return_type: Optional[str], + auth: Union[Authenticator, "_NoAuth", None] = None, + ) -> Any: + """Invoke an API operation. + + Args: + method: HTTP method (GET, POST, PUT, DELETE, etc.). + path: URL path (with path params already substituted). + query_params: Query parameters. + header_params: Custom header parameters. + body: Request body (model object or None). + accepts: Acceptable response content types. + content_type: Request content type. + return_type: Return type for deserialization (None for void). + auth: Operation-specific auth resolution. Three states: + ``NO_AUTH`` suppresses auth (``security: []`` operation), + ``None`` falls back to the client-level authenticator, and a + real :class:`Authenticator` is a per-call override. + + Returns: + Deserialized response or None. + + Raises: + ApiException: If the API call fails. + """ + result = await self._invoke_api_for_result( + method, + path, + query_params, + header_params, + body, + accepts, + content_type, + return_type, + auth, + ) + return result.data + + @staticmethod + def _throw_api_exception(response: "ApiHttpResponse") -> None: + """Raise the exception :meth:`ApiException.from_response` maps the + error response to. The body is parsed as JSON where possible so that + structured error data (e.g. from a ``default`` response schema) is + available via :attr:`ApiException.error_body`. + """ + raise ApiException.from_response( + response.status_code, response.headers, response.body + ) diff --git a/zitadel_client/api/beta_action_service_api.py b/zitadel_client/api/beta_action_service_api.py index e5ba7546..4b92da8a 100644 --- a/zitadel_client/api/beta_action_service_api.py +++ b/zitadel_client/api/beta_action_service_api.py @@ -1,1343 +1,723 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.beta_action_service_create_target_request import BetaActionServiceCreateTargetRequest -from zitadel_client.models.beta_action_service_create_target_response import BetaActionServiceCreateTargetResponse -from zitadel_client.models.beta_action_service_delete_target_request import BetaActionServiceDeleteTargetRequest -from zitadel_client.models.beta_action_service_delete_target_response import BetaActionServiceDeleteTargetResponse -from zitadel_client.models.beta_action_service_get_target_request import BetaActionServiceGetTargetRequest -from zitadel_client.models.beta_action_service_get_target_response import BetaActionServiceGetTargetResponse -from zitadel_client.models.beta_action_service_list_execution_functions_response import BetaActionServiceListExecutionFunctionsResponse -from zitadel_client.models.beta_action_service_list_execution_methods_response import BetaActionServiceListExecutionMethodsResponse -from zitadel_client.models.beta_action_service_list_execution_services_response import BetaActionServiceListExecutionServicesResponse -from zitadel_client.models.beta_action_service_list_executions_request import BetaActionServiceListExecutionsRequest -from zitadel_client.models.beta_action_service_list_executions_response import BetaActionServiceListExecutionsResponse -from zitadel_client.models.beta_action_service_list_targets_request import BetaActionServiceListTargetsRequest -from zitadel_client.models.beta_action_service_list_targets_response import BetaActionServiceListTargetsResponse -from zitadel_client.models.beta_action_service_set_execution_request import BetaActionServiceSetExecutionRequest -from zitadel_client.models.beta_action_service_set_execution_response import BetaActionServiceSetExecutionResponse -from zitadel_client.models.beta_action_service_update_target_request import BetaActionServiceUpdateTargetRequest -from zitadel_client.models.beta_action_service_update_target_response import BetaActionServiceUpdateTargetResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaActionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_target( self, beta_action_service_create_target_request: Optional[BetaActionServiceCreateTargetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceCreateTargetResponse: - if beta_action_service_create_target_request is None: - beta_action_service_create_target_request = {} - """Create Target +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_action_service_create_target_request import ( + BetaActionServiceCreateTargetRequest, +) +from zitadel_client.models.beta_action_service_create_target_response import ( + BetaActionServiceCreateTargetResponse, +) +from zitadel_client.models.beta_action_service_delete_target_request import ( + BetaActionServiceDeleteTargetRequest, +) +from zitadel_client.models.beta_action_service_delete_target_response import ( + BetaActionServiceDeleteTargetResponse, +) +from zitadel_client.models.beta_action_service_get_target_request import ( + BetaActionServiceGetTargetRequest, +) +from zitadel_client.models.beta_action_service_get_target_response import ( + BetaActionServiceGetTargetResponse, +) +from zitadel_client.models.beta_action_service_list_execution_functions_response import ( + BetaActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_methods_response import ( + BetaActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_services_response import ( + BetaActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.beta_action_service_list_executions_request import ( + BetaActionServiceListExecutionsRequest, +) +from zitadel_client.models.beta_action_service_list_executions_response import ( + BetaActionServiceListExecutionsResponse, +) +from zitadel_client.models.beta_action_service_list_targets_request import ( + BetaActionServiceListTargetsRequest, +) +from zitadel_client.models.beta_action_service_list_targets_response import ( + BetaActionServiceListTargetsResponse, +) +from zitadel_client.models.beta_action_service_set_execution_request import ( + BetaActionServiceSetExecutionRequest, +) +from zitadel_client.models.beta_action_service_set_execution_response import ( + BetaActionServiceSetExecutionResponse, +) +from zitadel_client.models.beta_action_service_update_target_request import ( + BetaActionServiceUpdateTargetRequest, +) +from zitadel_client.models.beta_action_service_update_target_response import ( + BetaActionServiceUpdateTargetResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaActionServiceApi(BaseApi): + """BetaActionServiceApi provides methods for the BetaActionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def create_target( + self, + beta_action_service_create_target_request: BetaActionServiceCreateTargetRequest, + ) -> BetaActionServiceCreateTargetResponse: + """Create Target Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + :param beta_action_service_create_target_request: (required) - :param beta_action_service_create_target_request: (required) - :type beta_action_service_create_target_request: BetaActionServiceCreateTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_target_serialize( - beta_action_service_create_target_request=beta_action_service_create_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaActionServiceCreateTargetResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_create_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_create_target_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceCreateTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_target_with_http_info( + beta_action_service_create_target_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_target_serialize( - self, - beta_action_service_create_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_create_target_request is not None: - _body_params = beta_action_service_create_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/CreateTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + return result.data + async def create_target_with_http_info( + self, + beta_action_service_create_target_request: BetaActionServiceCreateTargetRequest, + ) -> "ApiResult[BetaActionServiceCreateTargetResponse]": + """Create Target (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new target to your endpoint, which can be used in executions. Required permission: - `action.target.write` + :param beta_action_service_create_target_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_create_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_create_target_request'" + ) + path = "/zitadel.action.v2beta.ActionService/CreateTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_create_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceCreateTargetResponse", + None, + ) - @validate_call - def delete_target( self, beta_action_service_delete_target_request: BetaActionServiceDeleteTargetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceDeleteTargetResponse: + async def delete_target( + self, + beta_action_service_delete_target_request: BetaActionServiceDeleteTargetRequest, + ) -> BetaActionServiceDeleteTargetResponse: """Delete Target - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + :param beta_action_service_delete_target_request: (required) + + :return: BetaActionServiceDeleteTargetResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_delete_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_delete_target_request'" + ) - :param beta_action_service_delete_target_request: (required) - :type beta_action_service_delete_target_request: BetaActionServiceDeleteTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_target_serialize( - beta_action_service_delete_target_request=beta_action_service_delete_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_target_with_http_info( + beta_action_service_delete_target_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceDeleteTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_target_serialize( + async def delete_target_with_http_info( self, - beta_action_service_delete_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_delete_target_request is not None: - _body_params = beta_action_service_delete_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_action_service_delete_target_request: BetaActionServiceDeleteTargetRequest, + ) -> "ApiResult[BetaActionServiceDeleteTargetResponse]": + """Delete Target (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing target. This will remove it from any configured execution as well. In case the target is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `action.target.delete` + :param beta_action_service_delete_target_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_delete_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_delete_target_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/DeleteTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2beta.ActionService/DeleteTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_delete_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceDeleteTargetResponse", + None, ) - - - - @validate_call - def get_target( self, beta_action_service_get_target_request: BetaActionServiceGetTargetRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceGetTargetResponse: + async def get_target( + self, + beta_action_service_get_target_request: BetaActionServiceGetTargetRequest, + ) -> BetaActionServiceGetTargetResponse: """Get Target - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the target identified by the requested ID. Required permission: - `action.target.read` + :param beta_action_service_get_target_request: (required) + + :return: BetaActionServiceGetTargetResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_get_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_get_target_request'" + ) - :param beta_action_service_get_target_request: (required) - :type beta_action_service_get_target_request: BetaActionServiceGetTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_target_serialize( - beta_action_service_get_target_request=beta_action_service_get_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_target_with_http_info( + beta_action_service_get_target_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceGetTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_target_serialize( + async def get_target_with_http_info( self, - beta_action_service_get_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_get_target_request is not None: - _body_params = beta_action_service_get_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_action_service_get_target_request: BetaActionServiceGetTargetRequest, + ) -> "ApiResult[BetaActionServiceGetTargetResponse]": + """Get Target (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the target identified by the requested ID. Required permission: - `action.target.read` + :param beta_action_service_get_target_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_get_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_get_target_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/GetTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2beta.ActionService/GetTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_get_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceGetTargetResponse", + None, ) - - - - @validate_call - def list_execution_functions( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceListExecutionFunctionsResponse: - if body is None: - body = {} + async def list_execution_functions( + self, + body: object, + ) -> BetaActionServiceListExecutionFunctionsResponse: """List Execution Functions - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available functions which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_functions_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceListExecutionFunctionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: BetaActionServiceListExecutionFunctionsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_functions_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_functions_serialize( + async def list_execution_functions_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[BetaActionServiceListExecutionFunctionsResponse]": + """List Execution Functions (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available functions which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/ListExecutionFunctions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2beta.ActionService/ListExecutionFunctions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceListExecutionFunctionsResponse", + None, ) - - - - @validate_call - def list_execution_methods( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceListExecutionMethodsResponse: - if body is None: - body = {} + async def list_execution_methods( + self, + body: object, + ) -> BetaActionServiceListExecutionMethodsResponse: """List Execution Methods - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available methods which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_methods_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceListExecutionMethodsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: BetaActionServiceListExecutionMethodsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_methods_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_methods_serialize( + async def list_execution_methods_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[BetaActionServiceListExecutionMethodsResponse]": + """List Execution Methods (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available methods which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/ListExecutionMethods', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2beta.ActionService/ListExecutionMethods" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceListExecutionMethodsResponse", + None, ) - - - - @validate_call - def list_execution_services( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceListExecutionServicesResponse: - if body is None: - body = {} + async def list_execution_services( + self, + body: object, + ) -> BetaActionServiceListExecutionServicesResponse: """List Execution Services - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available services which can be used as condition for executions. + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_execution_services_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceListExecutionServicesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: BetaActionServiceListExecutionServicesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_execution_services_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_execution_services_serialize( + async def list_execution_services_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[BetaActionServiceListExecutionServicesResponse]": + """List Execution Services (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all available services which can be used as condition for executions. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/ListExecutionServices', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.action.v2beta.ActionService/ListExecutionServices" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceListExecutionServicesResponse", + None, ) - - - - @validate_call - def list_executions( self, beta_action_service_list_executions_request: BetaActionServiceListExecutionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceListExecutionsResponse: + async def list_executions( + self, + beta_action_service_list_executions_request: BetaActionServiceListExecutionsRequest, + ) -> BetaActionServiceListExecutionsResponse: """List Executions - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + :param beta_action_service_list_executions_request: (required) + + :return: BetaActionServiceListExecutionsResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_list_executions_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_list_executions_request'" + ) - :param beta_action_service_list_executions_request: (required) - :type beta_action_service_list_executions_request: BetaActionServiceListExecutionsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_executions_serialize( - beta_action_service_list_executions_request=beta_action_service_list_executions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_executions_with_http_info( + beta_action_service_list_executions_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceListExecutionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_executions_serialize( + async def list_executions_with_http_info( self, - beta_action_service_list_executions_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_list_executions_request is not None: - _body_params = beta_action_service_list_executions_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_action_service_list_executions_request: BetaActionServiceListExecutionsRequest, + ) -> "ApiResult[BetaActionServiceListExecutionsResponse]": + """List Executions (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching executions. By default all executions of the instance are returned that have at least one execution target. Make sure to include a limit and sorting for pagination. Required permission: - `action.execution.read` + :param beta_action_service_list_executions_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_list_executions_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_list_executions_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/ListExecutions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2beta.ActionService/ListExecutions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_list_executions_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceListExecutionsResponse", + None, ) - - - - @validate_call - def list_targets( self, beta_action_service_list_targets_request: BetaActionServiceListTargetsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceListTargetsResponse: + async def list_targets( + self, + beta_action_service_list_targets_request: BetaActionServiceListTargetsRequest, + ) -> BetaActionServiceListTargetsResponse: """List targets - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + :param beta_action_service_list_targets_request: (required) + + :return: BetaActionServiceListTargetsResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_list_targets_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_list_targets_request'" + ) - :param beta_action_service_list_targets_request: (required) - :type beta_action_service_list_targets_request: BetaActionServiceListTargetsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_targets_serialize( - beta_action_service_list_targets_request=beta_action_service_list_targets_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_targets_with_http_info( + beta_action_service_list_targets_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceListTargetsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_targets_serialize( + async def list_targets_with_http_info( self, - beta_action_service_list_targets_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_list_targets_request is not None: - _body_params = beta_action_service_list_targets_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_action_service_list_targets_request: BetaActionServiceListTargetsRequest, + ) -> "ApiResult[BetaActionServiceListTargetsResponse]": + """List targets (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching targets. By default all targets of the instance are returned. Make sure to include a limit and sorting for pagination. Required permission: - `action.target.read` + :param beta_action_service_list_targets_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_list_targets_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_list_targets_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/ListTargets', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2beta.ActionService/ListTargets" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_list_targets_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceListTargetsResponse", + None, ) - - - - @validate_call - def set_execution( self, beta_action_service_set_execution_request: BetaActionServiceSetExecutionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceSetExecutionResponse: + async def set_execution( + self, + beta_action_service_set_execution_request: BetaActionServiceSetExecutionRequest, + ) -> BetaActionServiceSetExecutionResponse: """Set Execution - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + :param beta_action_service_set_execution_request: (required) + + :return: BetaActionServiceSetExecutionResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_set_execution_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_set_execution_request'" + ) - :param beta_action_service_set_execution_request: (required) - :type beta_action_service_set_execution_request: BetaActionServiceSetExecutionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_execution_serialize( - beta_action_service_set_execution_request=beta_action_service_set_execution_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_execution_with_http_info( + beta_action_service_set_execution_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceSetExecutionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_execution_serialize( + async def set_execution_with_http_info( self, - beta_action_service_set_execution_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_set_execution_request is not None: - _body_params = beta_action_service_set_execution_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_action_service_set_execution_request: BetaActionServiceSetExecutionRequest, + ) -> "ApiResult[BetaActionServiceSetExecutionResponse]": + """Set Execution (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Sets an execution to call a target or include the targets of another execution. Setting an empty list of targets will remove all targets from the execution, making it a noop. Required permission: - `action.execution.write` + :param beta_action_service_set_execution_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_set_execution_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_set_execution_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/SetExecution', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.action.v2beta.ActionService/SetExecution" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_set_execution_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceSetExecutionResponse", + None, ) - - - - @validate_call - def update_target( self, beta_action_service_update_target_request: Optional[BetaActionServiceUpdateTargetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaActionServiceUpdateTargetResponse: - if beta_action_service_update_target_request is None: - beta_action_service_update_target_request = {} + async def update_target( + self, + beta_action_service_update_target_request: BetaActionServiceUpdateTargetRequest, + ) -> BetaActionServiceUpdateTargetResponse: """Update Target - Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + :param beta_action_service_update_target_request: (required) - :param beta_action_service_update_target_request: (required) - :type beta_action_service_update_target_request: BetaActionServiceUpdateTargetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_target_serialize( - beta_action_service_update_target_request=beta_action_service_update_target_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaActionServiceUpdateTargetResponse + :raises ApiException: if fails to make API call + """ + if beta_action_service_update_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_update_target_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaActionServiceUpdateTargetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.update_target_with_http_info( + beta_action_service_update_target_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _update_target_serialize( - self, - beta_action_service_update_target_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_action_service_update_target_request is not None: - _body_params = beta_action_service_update_target_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.action.v2beta.ActionService/UpdateTarget', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def update_target_with_http_info( + self, + beta_action_service_update_target_request: BetaActionServiceUpdateTargetRequest, + ) -> "ApiResult[BetaActionServiceUpdateTargetResponse]": + """Update Target (with HTTP info) + Deprecated: please move to the corresponding endpoint under action service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing target. To generate a new signing key set the optional expirationSigningKey. Required permission: - `action.target.write` + :param beta_action_service_update_target_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_action_service_update_target_request is None: + raise ValueError( + "Missing the required parameter 'beta_action_service_update_target_request'" + ) + path = "/zitadel.action.v2beta.ActionService/UpdateTarget" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_action_service_update_target_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaActionServiceUpdateTargetResponse", + None, + ) diff --git a/zitadel_client/api/beta_app_service_api.py b/zitadel_client/api/beta_app_service_api.py index 567b3f6f..0ce0f6cd 100644 --- a/zitadel_client/api/beta_app_service_api.py +++ b/zitadel_client/api/beta_app_service_api.py @@ -1,1603 +1,894 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_app_service_create_application_key_request import BetaAppServiceCreateApplicationKeyRequest -from zitadel_client.models.beta_app_service_create_application_key_response import BetaAppServiceCreateApplicationKeyResponse -from zitadel_client.models.beta_app_service_create_application_request import BetaAppServiceCreateApplicationRequest -from zitadel_client.models.beta_app_service_create_application_response import BetaAppServiceCreateApplicationResponse -from zitadel_client.models.beta_app_service_deactivate_application_request import BetaAppServiceDeactivateApplicationRequest -from zitadel_client.models.beta_app_service_deactivate_application_response import BetaAppServiceDeactivateApplicationResponse -from zitadel_client.models.beta_app_service_delete_application_key_request import BetaAppServiceDeleteApplicationKeyRequest -from zitadel_client.models.beta_app_service_delete_application_key_response import BetaAppServiceDeleteApplicationKeyResponse -from zitadel_client.models.beta_app_service_delete_application_request import BetaAppServiceDeleteApplicationRequest -from zitadel_client.models.beta_app_service_delete_application_response import BetaAppServiceDeleteApplicationResponse -from zitadel_client.models.beta_app_service_get_application_key_request import BetaAppServiceGetApplicationKeyRequest -from zitadel_client.models.beta_app_service_get_application_key_response import BetaAppServiceGetApplicationKeyResponse -from zitadel_client.models.beta_app_service_get_application_request import BetaAppServiceGetApplicationRequest -from zitadel_client.models.beta_app_service_get_application_response import BetaAppServiceGetApplicationResponse -from zitadel_client.models.beta_app_service_list_application_keys_request import BetaAppServiceListApplicationKeysRequest -from zitadel_client.models.beta_app_service_list_application_keys_response import BetaAppServiceListApplicationKeysResponse -from zitadel_client.models.beta_app_service_list_applications_request import BetaAppServiceListApplicationsRequest -from zitadel_client.models.beta_app_service_list_applications_response import BetaAppServiceListApplicationsResponse -from zitadel_client.models.beta_app_service_reactivate_application_request import BetaAppServiceReactivateApplicationRequest -from zitadel_client.models.beta_app_service_reactivate_application_response import BetaAppServiceReactivateApplicationResponse -from zitadel_client.models.beta_app_service_regenerate_client_secret_request import BetaAppServiceRegenerateClientSecretRequest -from zitadel_client.models.beta_app_service_regenerate_client_secret_response import BetaAppServiceRegenerateClientSecretResponse -from zitadel_client.models.beta_app_service_update_application_request import BetaAppServiceUpdateApplicationRequest -from zitadel_client.models.beta_app_service_update_application_response import BetaAppServiceUpdateApplicationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaAppServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_application( self, beta_app_service_create_application_request: Optional[BetaAppServiceCreateApplicationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceCreateApplicationResponse: - if beta_app_service_create_application_request is None: - beta_app_service_create_application_request = {} - """Create Application +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_app_service_create_application_key_request import ( + BetaAppServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_create_application_key_response import ( + BetaAppServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_create_application_request import ( + BetaAppServiceCreateApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_application_response import ( + BetaAppServiceCreateApplicationResponse, +) +from zitadel_client.models.beta_app_service_deactivate_application_request import ( + BetaAppServiceDeactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_deactivate_application_response import ( + BetaAppServiceDeactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_delete_application_key_request import ( + BetaAppServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_delete_application_key_response import ( + BetaAppServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_delete_application_request import ( + BetaAppServiceDeleteApplicationRequest, +) +from zitadel_client.models.beta_app_service_delete_application_response import ( + BetaAppServiceDeleteApplicationResponse, +) +from zitadel_client.models.beta_app_service_get_application_key_request import ( + BetaAppServiceGetApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_get_application_key_response import ( + BetaAppServiceGetApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_get_application_request import ( + BetaAppServiceGetApplicationRequest, +) +from zitadel_client.models.beta_app_service_get_application_response import ( + BetaAppServiceGetApplicationResponse, +) +from zitadel_client.models.beta_app_service_list_application_keys_request import ( + BetaAppServiceListApplicationKeysRequest, +) +from zitadel_client.models.beta_app_service_list_application_keys_response import ( + BetaAppServiceListApplicationKeysResponse, +) +from zitadel_client.models.beta_app_service_list_applications_request import ( + BetaAppServiceListApplicationsRequest, +) +from zitadel_client.models.beta_app_service_list_applications_response import ( + BetaAppServiceListApplicationsResponse, +) +from zitadel_client.models.beta_app_service_reactivate_application_request import ( + BetaAppServiceReactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_reactivate_application_response import ( + BetaAppServiceReactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_request import ( + BetaAppServiceRegenerateClientSecretRequest, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_response import ( + BetaAppServiceRegenerateClientSecretResponse, +) +from zitadel_client.models.beta_app_service_update_application_request import ( + BetaAppServiceUpdateApplicationRequest, +) +from zitadel_client.models.beta_app_service_update_application_response import ( + BetaAppServiceUpdateApplicationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaAppServiceApi(BaseApi): + """BetaAppServiceApi provides methods for the BetaAppService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def create_application( + self, + beta_app_service_create_application_request: BetaAppServiceCreateApplicationRequest, + ) -> BetaAppServiceCreateApplicationResponse: + """Create Application Deprecated: use [application service v2 CreateApplication](apis/resources/application_service_v2/application-service-create-application.api.mdx) instead. Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write + :param beta_app_service_create_application_request: (required) - :param beta_app_service_create_application_request: (required) - :type beta_app_service_create_application_request: BetaAppServiceCreateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_application_serialize( - beta_app_service_create_application_request=beta_app_service_create_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaAppServiceCreateApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_create_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_create_application_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceCreateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_application_with_http_info( + beta_app_service_create_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_application_serialize( - self, - beta_app_service_create_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_create_application_request is not None: - _body_params = beta_app_service_create_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/CreateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def create_application_with_http_info( + self, + beta_app_service_create_application_request: BetaAppServiceCreateApplicationRequest, + ) -> "ApiResult[BetaAppServiceCreateApplicationResponse]": + """Create Application (with HTTP info) + Deprecated: use [application service v2 CreateApplication](apis/resources/application_service_v2/application-service-create-application.api.mdx) instead. Create an application. The application can be OIDC, API or SAML type, based on the input. Required permissions: - project.app.write + :param beta_app_service_create_application_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_create_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_create_application_request'" + ) + path = "/zitadel.app.v2beta.AppService/CreateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_create_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceCreateApplicationResponse", + None, + ) - @validate_call - def create_application_key( self, beta_app_service_create_application_key_request: BetaAppServiceCreateApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceCreateApplicationKeyResponse: + async def create_application_key( + self, + beta_app_service_create_application_key_request: BetaAppServiceCreateApplicationKeyRequest, + ) -> BetaAppServiceCreateApplicationKeyResponse: """Create Application Key - Deprecated: use [application service v2 CreateApplicationKey](apis/resources/application_service_v2/application-service-create-application-key.api.mdx) instead. Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + :param beta_app_service_create_application_key_request: (required) + + :return: BetaAppServiceCreateApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_create_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_create_application_key_request'" + ) - :param beta_app_service_create_application_key_request: (required) - :type beta_app_service_create_application_key_request: BetaAppServiceCreateApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_application_key_serialize( - beta_app_service_create_application_key_request=beta_app_service_create_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceCreateApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_application_key_with_http_info( + beta_app_service_create_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_application_key_serialize( - self, - beta_app_service_create_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_create_application_key_request is not None: - _body_params = beta_app_service_create_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def create_application_key_with_http_info( + self, + beta_app_service_create_application_key_request: BetaAppServiceCreateApplicationKeyRequest, + ) -> "ApiResult[BetaAppServiceCreateApplicationKeyResponse]": + """Create Application Key (with HTTP info) + Deprecated: use [application service v2 CreateApplicationKey](apis/resources/application_service_v2/application-service-create-application-key.api.mdx) instead. Create a new application key, which is used to authorize an API application. Key details are returned in the response. They must be stored safely, as it will not be possible to retrieve them again. Required permissions: - `project.app.write` + :param beta_app_service_create_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_create_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_create_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/CreateApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/CreateApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_create_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceCreateApplicationKeyResponse", + None, + ) - @validate_call - def deactivate_application( self, beta_app_service_deactivate_application_request: BetaAppServiceDeactivateApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceDeactivateApplicationResponse: + async def deactivate_application( + self, + beta_app_service_deactivate_application_request: BetaAppServiceDeactivateApplicationRequest, + ) -> BetaAppServiceDeactivateApplicationResponse: """Deactivate Application - Deprecated: use [application service v2 DeactivateApplication](apis/resources/application_service_v2/application-service-deactivate-application.api.mdx) instead. Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param beta_app_service_deactivate_application_request: (required) + + :return: BetaAppServiceDeactivateApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_deactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_deactivate_application_request'" + ) - :param beta_app_service_deactivate_application_request: (required) - :type beta_app_service_deactivate_application_request: BetaAppServiceDeactivateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_application_serialize( - beta_app_service_deactivate_application_request=beta_app_service_deactivate_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceDeactivateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.deactivate_application_with_http_info( + beta_app_service_deactivate_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _deactivate_application_serialize( - self, - beta_app_service_deactivate_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_deactivate_application_request is not None: - _body_params = beta_app_service_deactivate_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def deactivate_application_with_http_info( + self, + beta_app_service_deactivate_application_request: BetaAppServiceDeactivateApplicationRequest, + ) -> "ApiResult[BetaAppServiceDeactivateApplicationResponse]": + """Deactivate Application (with HTTP info) + Deprecated: use [application service v2 DeactivateApplication](apis/resources/application_service_v2/application-service-deactivate-application.api.mdx) instead. Deactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param beta_app_service_deactivate_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_deactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_deactivate_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/DeactivateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/DeactivateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_deactivate_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceDeactivateApplicationResponse", + None, + ) - @validate_call - def delete_application( self, beta_app_service_delete_application_request: BetaAppServiceDeleteApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceDeleteApplicationResponse: + async def delete_application( + self, + beta_app_service_delete_application_request: BetaAppServiceDeleteApplicationRequest, + ) -> BetaAppServiceDeleteApplicationResponse: """Delete Application - Deprecated: use [application service v2 DeleteApplication](apis/resources/application_service_v2/application-service-delete-application.api.mdx) instead. Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete + :param beta_app_service_delete_application_request: (required) + + :return: BetaAppServiceDeleteApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_delete_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_delete_application_request'" + ) - :param beta_app_service_delete_application_request: (required) - :type beta_app_service_delete_application_request: BetaAppServiceDeleteApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_application_serialize( - beta_app_service_delete_application_request=beta_app_service_delete_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceDeleteApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.delete_application_with_http_info( + beta_app_service_delete_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _delete_application_serialize( - self, - beta_app_service_delete_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_delete_application_request is not None: - _body_params = beta_app_service_delete_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def delete_application_with_http_info( + self, + beta_app_service_delete_application_request: BetaAppServiceDeleteApplicationRequest, + ) -> "ApiResult[BetaAppServiceDeleteApplicationResponse]": + """Delete Application (with HTTP info) + Deprecated: use [application service v2 DeleteApplication](apis/resources/application_service_v2/application-service-delete-application.api.mdx) instead. Deletes the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.delete + :param beta_app_service_delete_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_delete_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_delete_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/DeleteApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/DeleteApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_delete_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceDeleteApplicationResponse", + None, + ) - @validate_call - def delete_application_key( self, beta_app_service_delete_application_key_request: BetaAppServiceDeleteApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceDeleteApplicationKeyResponse: + async def delete_application_key( + self, + beta_app_service_delete_application_key_request: BetaAppServiceDeleteApplicationKeyRequest, + ) -> BetaAppServiceDeleteApplicationKeyResponse: """Delete Application Key - Deprecated: use [application service v2 DeleteApplicationKey](apis/resources/application_service_v2/application-service-delete-application-key.api.mdx) instead. Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + :param beta_app_service_delete_application_key_request: (required) + + :return: BetaAppServiceDeleteApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_delete_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_delete_application_key_request'" + ) - :param beta_app_service_delete_application_key_request: (required) - :type beta_app_service_delete_application_key_request: BetaAppServiceDeleteApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_application_key_serialize( - beta_app_service_delete_application_key_request=beta_app_service_delete_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceDeleteApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.delete_application_key_with_http_info( + beta_app_service_delete_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _delete_application_key_serialize( - self, - beta_app_service_delete_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_delete_application_key_request is not None: - _body_params = beta_app_service_delete_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def delete_application_key_with_http_info( + self, + beta_app_service_delete_application_key_request: BetaAppServiceDeleteApplicationKeyRequest, + ) -> "ApiResult[BetaAppServiceDeleteApplicationKeyResponse]": + """Delete Application Key (with HTTP info) + Deprecated: use [application service v2 DeleteApplicationKey](apis/resources/application_service_v2/application-service-delete-application-key.api.mdx) instead. Deletes an application key matching the provided ID. Organization ID is not mandatory, but helps with filtering/performance. The deletion time is returned in response message. Required permissions: - `project.app.write` + :param beta_app_service_delete_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_delete_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_delete_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/DeleteApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/DeleteApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_delete_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceDeleteApplicationKeyResponse", + None, + ) - @validate_call - def get_application( self, beta_app_service_get_application_request: BetaAppServiceGetApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceGetApplicationResponse: + async def get_application( + self, + beta_app_service_get_application_request: BetaAppServiceGetApplicationRequest, + ) -> BetaAppServiceGetApplicationResponse: """Get Application - Deprecated: use [application service v2 GetApplication](apis/resources/application_service_v2/application-service-get-application.api.mdx) instead. Retrieves the application matching the provided ID. Required permissions: - project.app.read + :param beta_app_service_get_application_request: (required) + + :return: BetaAppServiceGetApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_get_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_get_application_request'" + ) - :param beta_app_service_get_application_request: (required) - :type beta_app_service_get_application_request: BetaAppServiceGetApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_serialize( - beta_app_service_get_application_request=beta_app_service_get_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceGetApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_application_with_http_info( + beta_app_service_get_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_application_serialize( - self, - beta_app_service_get_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_get_application_request is not None: - _body_params = beta_app_service_get_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_application_with_http_info( + self, + beta_app_service_get_application_request: BetaAppServiceGetApplicationRequest, + ) -> "ApiResult[BetaAppServiceGetApplicationResponse]": + """Get Application (with HTTP info) + Deprecated: use [application service v2 GetApplication](apis/resources/application_service_v2/application-service-get-application.api.mdx) instead. Retrieves the application matching the provided ID. Required permissions: - project.app.read + :param beta_app_service_get_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_get_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_get_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/GetApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/GetApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_get_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceGetApplicationResponse", + None, + ) - @validate_call - def get_application_key( self, beta_app_service_get_application_key_request: BetaAppServiceGetApplicationKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceGetApplicationKeyResponse: + async def get_application_key( + self, + beta_app_service_get_application_key_request: BetaAppServiceGetApplicationKeyRequest, + ) -> BetaAppServiceGetApplicationKeyResponse: """Get Application Key - Deprecated: use [application service v2 GetApplicationKey](apis/resources/application_service_v2/application-service-get-application-key.api.mdx) instead. Retrieves the application key matching the provided ID. Specifying a project, organization and app ID is optional but help with filtering/performance. Required permissions: - project.app.read + :param beta_app_service_get_application_key_request: (required) + + :return: BetaAppServiceGetApplicationKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_get_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_get_application_key_request'" + ) - :param beta_app_service_get_application_key_request: (required) - :type beta_app_service_get_application_key_request: BetaAppServiceGetApplicationKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_application_key_serialize( - beta_app_service_get_application_key_request=beta_app_service_get_application_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceGetApplicationKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_application_key_with_http_info( + beta_app_service_get_application_key_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_application_key_serialize( - self, - beta_app_service_get_application_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_get_application_key_request is not None: - _body_params = beta_app_service_get_application_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_application_key_with_http_info( + self, + beta_app_service_get_application_key_request: BetaAppServiceGetApplicationKeyRequest, + ) -> "ApiResult[BetaAppServiceGetApplicationKeyResponse]": + """Get Application Key (with HTTP info) + Deprecated: use [application service v2 GetApplicationKey](apis/resources/application_service_v2/application-service-get-application-key.api.mdx) instead. Retrieves the application key matching the provided ID. Specifying a project, organization and app ID is optional but help with filtering/performance. Required permissions: - project.app.read + :param beta_app_service_get_application_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_get_application_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_get_application_key_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/GetApplicationKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/GetApplicationKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_get_application_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceGetApplicationKeyResponse", + None, + ) - @validate_call - def list_application_keys( self, beta_app_service_list_application_keys_request: Optional[BetaAppServiceListApplicationKeysRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceListApplicationKeysResponse: - if beta_app_service_list_application_keys_request is None: - beta_app_service_list_application_keys_request = {} + async def list_application_keys( + self, + beta_app_service_list_application_keys_request: BetaAppServiceListApplicationKeysRequest, + ) -> BetaAppServiceListApplicationKeysResponse: """List Application Keys - Deprecated: use [application service v2 ListApplicationKeys](apis/resources/application_service_v2/application-service-list-application-keys.api.mdx) instead. Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by app, project or organization ID. Required permissions: - project.app.read + :param beta_app_service_list_application_keys_request: (required) - :param beta_app_service_list_application_keys_request: (required) - :type beta_app_service_list_application_keys_request: BetaAppServiceListApplicationKeysRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_application_keys_serialize( - beta_app_service_list_application_keys_request=beta_app_service_list_application_keys_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaAppServiceListApplicationKeysResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_list_application_keys_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_list_application_keys_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceListApplicationKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.list_application_keys_with_http_info( + beta_app_service_list_application_keys_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _list_application_keys_serialize( - self, - beta_app_service_list_application_keys_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_list_application_keys_request is not None: - _body_params = beta_app_service_list_application_keys_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/ListApplicationKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def list_application_keys_with_http_info( + self, + beta_app_service_list_application_keys_request: BetaAppServiceListApplicationKeysRequest, + ) -> "ApiResult[BetaAppServiceListApplicationKeysResponse]": + """List Application Keys (with HTTP info) + Deprecated: use [application service v2 ListApplicationKeys](apis/resources/application_service_v2/application-service-list-application-keys.api.mdx) instead. Returns a list of application keys matching the input parameters. The result can be sorted by id, aggregate, creation date, expiration date, resource owner or type. It can also be filtered by app, project or organization ID. Required permissions: - project.app.read + :param beta_app_service_list_application_keys_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_list_application_keys_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_list_application_keys_request'" + ) + path = "/zitadel.app.v2beta.AppService/ListApplicationKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_list_application_keys_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceListApplicationKeysResponse", + None, + ) - @validate_call - def list_applications( self, beta_app_service_list_applications_request: BetaAppServiceListApplicationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceListApplicationsResponse: + async def list_applications( + self, + beta_app_service_list_applications_request: BetaAppServiceListApplicationsRequest, + ) -> BetaAppServiceListApplicationsResponse: """List Applications - Deprecated: use [application service v2 ListApplications](apis/resources/application_service_v2/application-service-list-applications.api.mdx) instead. Returns a list of applications matching the input parameters that belong to the provided project. The result can be sorted by app id, name, creation date, change date or state. It can also be filtered by app state, app type and app name. Required permissions: - project.app.read + :param beta_app_service_list_applications_request: (required) + + :return: BetaAppServiceListApplicationsResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_list_applications_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_list_applications_request'" + ) - :param beta_app_service_list_applications_request: (required) - :type beta_app_service_list_applications_request: BetaAppServiceListApplicationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_applications_serialize( - beta_app_service_list_applications_request=beta_app_service_list_applications_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceListApplicationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.list_applications_with_http_info( + beta_app_service_list_applications_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _list_applications_serialize( - self, - beta_app_service_list_applications_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_list_applications_request is not None: - _body_params = beta_app_service_list_applications_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def list_applications_with_http_info( + self, + beta_app_service_list_applications_request: BetaAppServiceListApplicationsRequest, + ) -> "ApiResult[BetaAppServiceListApplicationsResponse]": + """List Applications (with HTTP info) + Deprecated: use [application service v2 ListApplications](apis/resources/application_service_v2/application-service-list-applications.api.mdx) instead. Returns a list of applications matching the input parameters that belong to the provided project. The result can be sorted by app id, name, creation date, change date or state. It can also be filtered by app state, app type and app name. Required permissions: - project.app.read + :param beta_app_service_list_applications_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_list_applications_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_list_applications_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/ListApplications', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/ListApplications" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_list_applications_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceListApplicationsResponse", + None, + ) - @validate_call - def reactivate_application( self, beta_app_service_reactivate_application_request: BetaAppServiceReactivateApplicationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceReactivateApplicationResponse: + async def reactivate_application( + self, + beta_app_service_reactivate_application_request: BetaAppServiceReactivateApplicationRequest, + ) -> BetaAppServiceReactivateApplicationResponse: """Reactivate Application - Deprecated: use [application service v2 ReactivateApplication](apis/resources/application_service_v2/application-service-reactivate-application.api.mdx) instead. Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param beta_app_service_reactivate_application_request: (required) + + :return: BetaAppServiceReactivateApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_reactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_reactivate_application_request'" + ) - :param beta_app_service_reactivate_application_request: (required) - :type beta_app_service_reactivate_application_request: BetaAppServiceReactivateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reactivate_application_serialize( - beta_app_service_reactivate_application_request=beta_app_service_reactivate_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceReactivateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.reactivate_application_with_http_info( + beta_app_service_reactivate_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _reactivate_application_serialize( - self, - beta_app_service_reactivate_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_reactivate_application_request is not None: - _body_params = beta_app_service_reactivate_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def reactivate_application_with_http_info( + self, + beta_app_service_reactivate_application_request: BetaAppServiceReactivateApplicationRequest, + ) -> "ApiResult[BetaAppServiceReactivateApplicationResponse]": + """Reactivate Application (with HTTP info) + Deprecated: use [application service v2 ReactivateApplication](apis/resources/application_service_v2/application-service-reactivate-application.api.mdx) instead. Reactivates the application belonging to the input project and matching the provided application ID. Required permissions: - project.app.write + :param beta_app_service_reactivate_application_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_reactivate_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_reactivate_application_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/ReactivateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.app.v2beta.AppService/ReactivateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_reactivate_application_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceReactivateApplicationResponse", + None, + ) - @validate_call - def regenerate_client_secret( self, beta_app_service_regenerate_client_secret_request: Optional[BetaAppServiceRegenerateClientSecretRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceRegenerateClientSecretResponse: - if beta_app_service_regenerate_client_secret_request is None: - beta_app_service_regenerate_client_secret_request = {} + async def regenerate_client_secret( + self, + beta_app_service_regenerate_client_secret_request: BetaAppServiceRegenerateClientSecretRequest, + ) -> BetaAppServiceRegenerateClientSecretResponse: """Regenerate Client Secret - Deprecated: use [application service v2 GenerateClientSecret](apis/resources/application_service_v2/application-service-generate-client-secret.api.mdx) instead. Regenerates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write + :param beta_app_service_regenerate_client_secret_request: (required) - :param beta_app_service_regenerate_client_secret_request: (required) - :type beta_app_service_regenerate_client_secret_request: BetaAppServiceRegenerateClientSecretRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._regenerate_client_secret_serialize( - beta_app_service_regenerate_client_secret_request=beta_app_service_regenerate_client_secret_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaAppServiceRegenerateClientSecretResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_regenerate_client_secret_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_regenerate_client_secret_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceRegenerateClientSecretResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.regenerate_client_secret_with_http_info( + beta_app_service_regenerate_client_secret_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _regenerate_client_secret_serialize( - self, - beta_app_service_regenerate_client_secret_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_regenerate_client_secret_request is not None: - _body_params = beta_app_service_regenerate_client_secret_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/RegenerateClientSecret', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def regenerate_client_secret_with_http_info( + self, + beta_app_service_regenerate_client_secret_request: BetaAppServiceRegenerateClientSecretRequest, + ) -> "ApiResult[BetaAppServiceRegenerateClientSecretResponse]": + """Regenerate Client Secret (with HTTP info) + Deprecated: use [application service v2 GenerateClientSecret](apis/resources/application_service_v2/application-service-generate-client-secret.api.mdx) instead. Regenerates the client secret of an API or OIDC application that belongs to the input project. Required permissions: - project.app.write + :param beta_app_service_regenerate_client_secret_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_regenerate_client_secret_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_regenerate_client_secret_request'" + ) + path = "/zitadel.app.v2beta.AppService/RegenerateClientSecret" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_regenerate_client_secret_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceRegenerateClientSecretResponse", + None, + ) - @validate_call - def update_application( self, beta_app_service_update_application_request: Optional[BetaAppServiceUpdateApplicationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAppServiceUpdateApplicationResponse: - if beta_app_service_update_application_request is None: - beta_app_service_update_application_request = {} + async def update_application( + self, + beta_app_service_update_application_request: BetaAppServiceUpdateApplicationRequest, + ) -> BetaAppServiceUpdateApplicationResponse: """Update Application - Deprecated: use [application service v2 UpdateApplication](apis/resources/application_service_v2/zitadel-app-v-2-application-service-update-application.api.mdx) instead. Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write + :param beta_app_service_update_application_request: (required) - :param beta_app_service_update_application_request: (required) - :type beta_app_service_update_application_request: BetaAppServiceUpdateApplicationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_application_serialize( - beta_app_service_update_application_request=beta_app_service_update_application_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaAppServiceUpdateApplicationResponse + :raises ApiException: if fails to make API call + """ + if beta_app_service_update_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_update_application_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAppServiceUpdateApplicationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.update_application_with_http_info( + beta_app_service_update_application_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _update_application_serialize( - self, - beta_app_service_update_application_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_app_service_update_application_request is not None: - _body_params = beta_app_service_update_application_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.app.v2beta.AppService/UpdateApplication', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def update_application_with_http_info( + self, + beta_app_service_update_application_request: BetaAppServiceUpdateApplicationRequest, + ) -> "ApiResult[BetaAppServiceUpdateApplicationResponse]": + """Update Application (with HTTP info) + Deprecated: use [application service v2 UpdateApplication](apis/resources/application_service_v2/zitadel-app-v-2-application-service-update-application.api.mdx) instead. Changes the configuration of an OIDC, API or SAML type application, as well as the application name, based on the input provided. Required permissions: - project.app.write + :param beta_app_service_update_application_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_app_service_update_application_request is None: + raise ValueError( + "Missing the required parameter 'beta_app_service_update_application_request'" + ) + path = "/zitadel.app.v2beta.AppService/UpdateApplication" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_app_service_update_application_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAppServiceUpdateApplicationResponse", + None, + ) diff --git a/zitadel_client/api/beta_authorization_service_api.py b/zitadel_client/api/beta_authorization_service_api.py index fd243edc..fc87d376 100644 --- a/zitadel_client/api/beta_authorization_service_api.py +++ b/zitadel_client/api/beta_authorization_service_api.py @@ -1,815 +1,466 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_authorization_service_activate_authorization_request import BetaAuthorizationServiceActivateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_activate_authorization_response import BetaAuthorizationServiceActivateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_create_authorization_request import BetaAuthorizationServiceCreateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_create_authorization_response import BetaAuthorizationServiceCreateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_deactivate_authorization_request import BetaAuthorizationServiceDeactivateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_deactivate_authorization_response import BetaAuthorizationServiceDeactivateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_delete_authorization_request import BetaAuthorizationServiceDeleteAuthorizationRequest -from zitadel_client.models.beta_authorization_service_delete_authorization_response import BetaAuthorizationServiceDeleteAuthorizationResponse -from zitadel_client.models.beta_authorization_service_list_authorizations_request import BetaAuthorizationServiceListAuthorizationsRequest -from zitadel_client.models.beta_authorization_service_list_authorizations_response import BetaAuthorizationServiceListAuthorizationsResponse -from zitadel_client.models.beta_authorization_service_update_authorization_request import BetaAuthorizationServiceUpdateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_update_authorization_response import BetaAuthorizationServiceUpdateAuthorizationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaAuthorizationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_authorization_service_activate_authorization_request import ( + BetaAuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_activate_authorization_response import ( + BetaAuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_create_authorization_request import ( + BetaAuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_create_authorization_response import ( + BetaAuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_request import ( + BetaAuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_response import ( + BetaAuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_request import ( + BetaAuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_response import ( + BetaAuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_request import ( + BetaAuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_response import ( + BetaAuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.beta_authorization_service_update_authorization_request import ( + BetaAuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_update_authorization_response import ( + BetaAuthorizationServiceUpdateAuthorizationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaAuthorizationServiceApi(BaseApi): + """BetaAuthorizationServiceApi provides methods for the BetaAuthorizationService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def activate_authorization( self, beta_authorization_service_activate_authorization_request: BetaAuthorizationServiceActivateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceActivateAuthorizationResponse: + async def activate_authorization( + self, + beta_authorization_service_activate_authorization_request: BetaAuthorizationServiceActivateAuthorizationRequest, + ) -> BetaAuthorizationServiceActivateAuthorizationResponse: """Activate Authorization - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_activate_authorization_request: (required) + + :return: BetaAuthorizationServiceActivateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_activate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_activate_authorization_request'" + ) - :param beta_authorization_service_activate_authorization_request: (required) - :type beta_authorization_service_activate_authorization_request: BetaAuthorizationServiceActivateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_authorization_serialize( - beta_authorization_service_activate_authorization_request=beta_authorization_service_activate_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_authorization_with_http_info( + beta_authorization_service_activate_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceActivateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_authorization_serialize( + async def activate_authorization_with_http_info( self, - beta_authorization_service_activate_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_activate_authorization_request is not None: - _body_params = beta_authorization_service_activate_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_activate_authorization_request: BetaAuthorizationServiceActivateAuthorizationRequest, + ) -> "ApiResult[BetaAuthorizationServiceActivateAuthorizationResponse]": + """Activate Authorization (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ActivateAuthorization activates an existing but inactive authorization. In case the authorization is already active, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was activated by the request. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_activate_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_activate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_activate_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/ActivateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = ( + "/zitadel.authorization.v2beta.AuthorizationService/ActivateAuthorization" + ) + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_activate_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceActivateAuthorizationResponse", + None, ) - - - - @validate_call - def create_authorization( self, beta_authorization_service_create_authorization_request: BetaAuthorizationServiceCreateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceCreateAuthorizationResponse: + async def create_authorization( + self, + beta_authorization_service_create_authorization_request: BetaAuthorizationServiceCreateAuthorizationRequest, + ) -> BetaAuthorizationServiceCreateAuthorizationResponse: """Create Authorization - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_create_authorization_request: (required) + + :return: BetaAuthorizationServiceCreateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_create_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_create_authorization_request'" + ) - :param beta_authorization_service_create_authorization_request: (required) - :type beta_authorization_service_create_authorization_request: BetaAuthorizationServiceCreateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_authorization_serialize( - beta_authorization_service_create_authorization_request=beta_authorization_service_create_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_authorization_with_http_info( + beta_authorization_service_create_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceCreateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_authorization_serialize( + async def create_authorization_with_http_info( self, - beta_authorization_service_create_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_create_authorization_request is not None: - _body_params = beta_authorization_service_create_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_create_authorization_request: BetaAuthorizationServiceCreateAuthorizationRequest, + ) -> "ApiResult[BetaAuthorizationServiceCreateAuthorizationResponse]": + """Create Authorization (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. CreateAuthorization creates a new authorization for a user in an owned or granted project. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_create_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_create_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_create_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/CreateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2beta.AuthorizationService/CreateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_create_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceCreateAuthorizationResponse", + None, ) - - - - @validate_call - def deactivate_authorization( self, beta_authorization_service_deactivate_authorization_request: BetaAuthorizationServiceDeactivateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceDeactivateAuthorizationResponse: + async def deactivate_authorization( + self, + beta_authorization_service_deactivate_authorization_request: BetaAuthorizationServiceDeactivateAuthorizationRequest, + ) -> BetaAuthorizationServiceDeactivateAuthorizationResponse: """Deactivate Authorization - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_deactivate_authorization_request: (required) + + :return: BetaAuthorizationServiceDeactivateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_deactivate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_deactivate_authorization_request'" + ) - :param beta_authorization_service_deactivate_authorization_request: (required) - :type beta_authorization_service_deactivate_authorization_request: BetaAuthorizationServiceDeactivateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_authorization_serialize( - beta_authorization_service_deactivate_authorization_request=beta_authorization_service_deactivate_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_authorization_with_http_info( + beta_authorization_service_deactivate_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceDeactivateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_authorization_serialize( + async def deactivate_authorization_with_http_info( self, - beta_authorization_service_deactivate_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_deactivate_authorization_request is not None: - _body_params = beta_authorization_service_deactivate_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_deactivate_authorization_request: BetaAuthorizationServiceDeactivateAuthorizationRequest, + ) -> "ApiResult[BetaAuthorizationServiceDeactivateAuthorizationResponse]": + """Deactivate Authorization (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeactivateAuthorization deactivates an existing and active authorization. In case the authorization is already inactive, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the authorization was deactivated by the request. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_deactivate_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_deactivate_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_deactivate_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/DeactivateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = ( + "/zitadel.authorization.v2beta.AuthorizationService/DeactivateAuthorization" + ) + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_deactivate_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceDeactivateAuthorizationResponse", + None, ) - - - - @validate_call - def delete_authorization( self, beta_authorization_service_delete_authorization_request: BetaAuthorizationServiceDeleteAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceDeleteAuthorizationResponse: + async def delete_authorization( + self, + beta_authorization_service_delete_authorization_request: BetaAuthorizationServiceDeleteAuthorizationRequest, + ) -> BetaAuthorizationServiceDeleteAuthorizationResponse: """Delete Authorization - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + :param beta_authorization_service_delete_authorization_request: (required) + + :return: BetaAuthorizationServiceDeleteAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_delete_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_delete_authorization_request'" + ) - :param beta_authorization_service_delete_authorization_request: (required) - :type beta_authorization_service_delete_authorization_request: BetaAuthorizationServiceDeleteAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_authorization_serialize( - beta_authorization_service_delete_authorization_request=beta_authorization_service_delete_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_authorization_with_http_info( + beta_authorization_service_delete_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceDeleteAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_authorization_serialize( + async def delete_authorization_with_http_info( self, - beta_authorization_service_delete_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_delete_authorization_request is not None: - _body_params = beta_authorization_service_delete_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_delete_authorization_request: BetaAuthorizationServiceDeleteAuthorizationRequest, + ) -> "ApiResult[BetaAuthorizationServiceDeleteAuthorizationResponse]": + """Delete Authorization (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. DeleteAuthorization deletes the authorization. In case the authorization is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the authorization was deleted by the request. Required permissions: - \"user.grant.delete\" + :param beta_authorization_service_delete_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_delete_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_delete_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/DeleteAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2beta.AuthorizationService/DeleteAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_delete_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceDeleteAuthorizationResponse", + None, ) - - - - @validate_call - def list_authorizations( self, beta_authorization_service_list_authorizations_request: BetaAuthorizationServiceListAuthorizationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceListAuthorizationsResponse: + async def list_authorizations( + self, + beta_authorization_service_list_authorizations_request: BetaAuthorizationServiceListAuthorizationsRequest, + ) -> BetaAuthorizationServiceListAuthorizationsResponse: """List Authorizations - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + :param beta_authorization_service_list_authorizations_request: (required) + + :return: BetaAuthorizationServiceListAuthorizationsResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_list_authorizations_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_list_authorizations_request'" + ) - :param beta_authorization_service_list_authorizations_request: (required) - :type beta_authorization_service_list_authorizations_request: BetaAuthorizationServiceListAuthorizationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_authorizations_serialize( - beta_authorization_service_list_authorizations_request=beta_authorization_service_list_authorizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_authorizations_with_http_info( + beta_authorization_service_list_authorizations_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceListAuthorizationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_authorizations_serialize( + async def list_authorizations_with_http_info( self, - beta_authorization_service_list_authorizations_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_list_authorizations_request is not None: - _body_params = beta_authorization_service_list_authorizations_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_list_authorizations_request: BetaAuthorizationServiceListAuthorizationsRequest, + ) -> "ApiResult[BetaAuthorizationServiceListAuthorizationsResponse]": + """List Authorizations (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. ListAuthorizations returns all authorizations matching the request and necessary permissions. Required permissions: - \"user.grant.read\" - no permissions required for listing own authorizations + :param beta_authorization_service_list_authorizations_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_list_authorizations_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_list_authorizations_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/ListAuthorizations', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2beta.AuthorizationService/ListAuthorizations" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_list_authorizations_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceListAuthorizationsResponse", + None, ) - - - - @validate_call - def update_authorization( self, beta_authorization_service_update_authorization_request: BetaAuthorizationServiceUpdateAuthorizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaAuthorizationServiceUpdateAuthorizationResponse: + async def update_authorization( + self, + beta_authorization_service_update_authorization_request: BetaAuthorizationServiceUpdateAuthorizationRequest, + ) -> BetaAuthorizationServiceUpdateAuthorizationResponse: """Update Authorization - Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_update_authorization_request: (required) + + :return: BetaAuthorizationServiceUpdateAuthorizationResponse + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_update_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_update_authorization_request'" + ) - :param beta_authorization_service_update_authorization_request: (required) - :type beta_authorization_service_update_authorization_request: BetaAuthorizationServiceUpdateAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_authorization_serialize( - beta_authorization_service_update_authorization_request=beta_authorization_service_update_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_authorization_with_http_info( + beta_authorization_service_update_authorization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaAuthorizationServiceUpdateAuthorizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_authorization_serialize( + async def update_authorization_with_http_info( self, - beta_authorization_service_update_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_authorization_service_update_authorization_request is not None: - _body_params = beta_authorization_service_update_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_authorization_service_update_authorization_request: BetaAuthorizationServiceUpdateAuthorizationRequest, + ) -> "ApiResult[BetaAuthorizationServiceUpdateAuthorizationResponse]": + """Update Authorization (with HTTP info) + Deprecated: please move to the corresponding endpoint under authorization service v2. This endpoint will be removed with the next major version of ZITADEL. UpdateAuthorization updates the authorization. Note that any role keys previously granted to the user and not present in the request will be revoked. Required permissions: - \"user.grant.write\" + :param beta_authorization_service_update_authorization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_authorization_service_update_authorization_request is None: + raise ValueError( + "Missing the required parameter 'beta_authorization_service_update_authorization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.authorization.v2beta.AuthorizationService/UpdateAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.authorization.v2beta.AuthorizationService/UpdateAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_authorization_service_update_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaAuthorizationServiceUpdateAuthorizationResponse", + None, ) - - diff --git a/zitadel_client/api/beta_feature_service_api.py b/zitadel_client/api/beta_feature_service_api.py index 894a77dd..630c4a2c 100644 --- a/zitadel_client/api/beta_feature_service_api.py +++ b/zitadel_client/api/beta_feature_service_api.py @@ -1,1587 +1,843 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.beta_feature_service_get_instance_features_request import BetaFeatureServiceGetInstanceFeaturesRequest -from zitadel_client.models.beta_feature_service_get_instance_features_response import BetaFeatureServiceGetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_get_organization_features_request import BetaFeatureServiceGetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_get_organization_features_response import BetaFeatureServiceGetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_get_system_features_response import BetaFeatureServiceGetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_get_user_features_request import BetaFeatureServiceGetUserFeaturesRequest -from zitadel_client.models.beta_feature_service_get_user_features_response import BetaFeatureServiceGetUserFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_instance_features_response import BetaFeatureServiceResetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_organization_features_request import BetaFeatureServiceResetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_reset_organization_features_response import BetaFeatureServiceResetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_system_features_response import BetaFeatureServiceResetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_user_features_request import BetaFeatureServiceResetUserFeaturesRequest -from zitadel_client.models.beta_feature_service_reset_user_features_response import BetaFeatureServiceResetUserFeaturesResponse -from zitadel_client.models.beta_feature_service_set_instance_features_request import BetaFeatureServiceSetInstanceFeaturesRequest -from zitadel_client.models.beta_feature_service_set_instance_features_response import BetaFeatureServiceSetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_set_organization_features_request import BetaFeatureServiceSetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_set_organization_features_response import BetaFeatureServiceSetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_set_system_features_request import BetaFeatureServiceSetSystemFeaturesRequest -from zitadel_client.models.beta_feature_service_set_system_features_response import BetaFeatureServiceSetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_set_user_feature_request import BetaFeatureServiceSetUserFeatureRequest -from zitadel_client.models.beta_feature_service_set_user_features_response import BetaFeatureServiceSetUserFeaturesResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaFeatureServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def get_instance_features( self, beta_feature_service_get_instance_features_request: BetaFeatureServiceGetInstanceFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceGetInstanceFeaturesResponse: - """GetInstanceFeatures - - - :param beta_feature_service_get_instance_features_request: (required) - :type beta_feature_service_get_instance_features_request: BetaFeatureServiceGetInstanceFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_instance_features_serialize( - beta_feature_service_get_instance_features_request=beta_feature_service_get_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceGetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_feature_service_get_instance_features_request import ( + BetaFeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_instance_features_response import ( + BetaFeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_organization_features_request import ( + BetaFeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_organization_features_response import ( + BetaFeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_system_features_response import ( + BetaFeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_user_features_request import ( + BetaFeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_user_features_response import ( + BetaFeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_instance_features_response import ( + BetaFeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_request import ( + BetaFeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_response import ( + BetaFeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_system_features_response import ( + BetaFeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_user_features_request import ( + BetaFeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_user_features_response import ( + BetaFeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_instance_features_request import ( + BetaFeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_instance_features_response import ( + BetaFeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_organization_features_request import ( + BetaFeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_organization_features_response import ( + BetaFeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_system_features_request import ( + BetaFeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_system_features_response import ( + BetaFeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_user_feature_request import ( + BetaFeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.beta_feature_service_set_user_features_response import ( + BetaFeatureServiceSetUserFeaturesResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaFeatureServiceApi(BaseApi): + """BetaFeatureServiceApi provides methods for the BetaFeatureService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - def _get_instance_features_serialize( + async def get_instance_features( self, - beta_feature_service_get_instance_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_get_instance_features_request is not None: - _body_params = beta_feature_service_get_instance_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_feature_service_get_instance_features_request: BetaFeatureServiceGetInstanceFeaturesRequest, + ) -> BetaFeatureServiceGetInstanceFeaturesResponse: + """GetInstanceFeatures + :param beta_feature_service_get_instance_features_request: (required) + + :return: BetaFeatureServiceGetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_instance_features_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/GetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_instance_features_with_http_info( + beta_feature_service_get_instance_features_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + async def get_instance_features_with_http_info( + self, + beta_feature_service_get_instance_features_request: BetaFeatureServiceGetInstanceFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceGetInstanceFeaturesResponse]": + """GetInstanceFeatures (with HTTP info) + :param beta_feature_service_get_instance_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_instance_features_request'" + ) + path = "/zitadel.feature.v2beta.FeatureService/GetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_get_instance_features_request - @validate_call - def get_organization_features( self, beta_feature_service_get_organization_features_request: BetaFeatureServiceGetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceGetOrganizationFeaturesResponse: - """GetOrganizationFeatures - - - :param beta_feature_service_get_organization_features_request: (required) - :type beta_feature_service_get_organization_features_request: BetaFeatureServiceGetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_organization_features_serialize( - beta_feature_service_get_organization_features_request=beta_feature_service_get_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceGetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceGetInstanceFeaturesResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_organization_features_serialize( + async def get_organization_features( self, - beta_feature_service_get_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_get_organization_features_request is not None: - _body_params = beta_feature_service_get_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_feature_service_get_organization_features_request: BetaFeatureServiceGetOrganizationFeaturesRequest, + ) -> BetaFeatureServiceGetOrganizationFeaturesResponse: + """GetOrganizationFeatures + :param beta_feature_service_get_organization_features_request: (required) + + :return: BetaFeatureServiceGetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_organization_features_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/GetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_organization_features_with_http_info( + beta_feature_service_get_organization_features_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + async def get_organization_features_with_http_info( + self, + beta_feature_service_get_organization_features_request: BetaFeatureServiceGetOrganizationFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceGetOrganizationFeaturesResponse]": + """GetOrganizationFeatures (with HTTP info) + :param beta_feature_service_get_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_organization_features_request'" + ) + path = "/zitadel.feature.v2beta.FeatureService/GetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_get_organization_features_request - @validate_call - def get_system_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceGetSystemFeaturesResponse: - if body is None: - body = {} - """GetSystemFeatures - - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_system_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceGetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceGetOrganizationFeaturesResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_system_features_serialize( + async def get_system_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> BetaFeatureServiceGetSystemFeaturesResponse: + """GetSystemFeatures + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: BetaFeatureServiceGetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_system_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/GetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data - - @validate_call - def get_user_features( self, beta_feature_service_get_user_features_request: BetaFeatureServiceGetUserFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceGetUserFeaturesResponse: + async def get_system_features_with_http_info( + self, + body: object, + ) -> "ApiResult[BetaFeatureServiceGetSystemFeaturesResponse]": + """GetSystemFeatures (with HTTP info) + :param body: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2beta.FeatureService/GetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceGetSystemFeaturesResponse", + None, + ) + + async def get_user_features( + self, + beta_feature_service_get_user_features_request: BetaFeatureServiceGetUserFeaturesRequest, + ) -> BetaFeatureServiceGetUserFeaturesResponse: """GetUserFeatures + :param beta_feature_service_get_user_features_request: (required) + + :return: BetaFeatureServiceGetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_user_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_user_features_request'" + ) - - :param beta_feature_service_get_user_features_request: (required) - :type beta_feature_service_get_user_features_request: BetaFeatureServiceGetUserFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_features_serialize( - beta_feature_service_get_user_features_request=beta_feature_service_get_user_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceGetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_user_features_with_http_info( + beta_feature_service_get_user_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_user_features_serialize( - self, - beta_feature_service_get_user_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_get_user_features_request is not None: - _body_params = beta_feature_service_get_user_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_user_features_with_http_info( + self, + beta_feature_service_get_user_features_request: BetaFeatureServiceGetUserFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceGetUserFeaturesResponse]": + """GetUserFeatures (with HTTP info) + :param beta_feature_service_get_user_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_get_user_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_get_user_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/GetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def reset_instance_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceResetInstanceFeaturesResponse: - if body is None: - body = {} - """ResetInstanceFeatures + path = "/zitadel.feature.v2beta.FeatureService/GetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_get_user_features_request - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_instance_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceGetUserFeaturesResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceResetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _reset_instance_features_serialize( + async def reset_instance_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> BetaFeatureServiceResetInstanceFeaturesResponse: + """ResetInstanceFeatures + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: BetaFeatureServiceResetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.reset_instance_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/ResetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - + return result.data - @validate_call - def reset_organization_features( self, beta_feature_service_reset_organization_features_request: BetaFeatureServiceResetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceResetOrganizationFeaturesResponse: + async def reset_instance_features_with_http_info( + self, + body: object, + ) -> "ApiResult[BetaFeatureServiceResetInstanceFeaturesResponse]": + """ResetInstanceFeatures (with HTTP info) + :param body: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2beta.FeatureService/ResetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceResetInstanceFeaturesResponse", + None, + ) + + async def reset_organization_features( + self, + beta_feature_service_reset_organization_features_request: BetaFeatureServiceResetOrganizationFeaturesRequest, + ) -> BetaFeatureServiceResetOrganizationFeaturesResponse: """ResetOrganizationFeatures + :param beta_feature_service_reset_organization_features_request: (required) + + :return: BetaFeatureServiceResetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_reset_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_reset_organization_features_request'" + ) - - :param beta_feature_service_reset_organization_features_request: (required) - :type beta_feature_service_reset_organization_features_request: BetaFeatureServiceResetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_organization_features_serialize( - beta_feature_service_reset_organization_features_request=beta_feature_service_reset_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceResetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.reset_organization_features_with_http_info( + beta_feature_service_reset_organization_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _reset_organization_features_serialize( - self, - beta_feature_service_reset_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_reset_organization_features_request is not None: - _body_params = beta_feature_service_reset_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def reset_organization_features_with_http_info( + self, + beta_feature_service_reset_organization_features_request: BetaFeatureServiceResetOrganizationFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceResetOrganizationFeaturesResponse]": + """ResetOrganizationFeatures (with HTTP info) + :param beta_feature_service_reset_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_reset_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_reset_organization_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/ResetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2beta.FeatureService/ResetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_reset_organization_features_request - - @validate_call - def reset_system_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceResetSystemFeaturesResponse: - if body is None: - body = {} - """ResetSystemFeatures - - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_system_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceResetOrganizationFeaturesResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceResetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _reset_system_features_serialize( + async def reset_system_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> BetaFeatureServiceResetSystemFeaturesResponse: + """ResetSystemFeatures + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: BetaFeatureServiceResetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.reset_system_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/ResetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - + return result.data - @validate_call - def reset_user_features( self, beta_feature_service_reset_user_features_request: BetaFeatureServiceResetUserFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceResetUserFeaturesResponse: + async def reset_system_features_with_http_info( + self, + body: object, + ) -> "ApiResult[BetaFeatureServiceResetSystemFeaturesResponse]": + """ResetSystemFeatures (with HTTP info) + :param body: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2beta.FeatureService/ResetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceResetSystemFeaturesResponse", + None, + ) + + async def reset_user_features( + self, + beta_feature_service_reset_user_features_request: BetaFeatureServiceResetUserFeaturesRequest, + ) -> BetaFeatureServiceResetUserFeaturesResponse: """ResetUserFeatures + :param beta_feature_service_reset_user_features_request: (required) + + :return: BetaFeatureServiceResetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_reset_user_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_reset_user_features_request'" + ) - - :param beta_feature_service_reset_user_features_request: (required) - :type beta_feature_service_reset_user_features_request: BetaFeatureServiceResetUserFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_user_features_serialize( - beta_feature_service_reset_user_features_request=beta_feature_service_reset_user_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.reset_user_features_with_http_info( + beta_feature_service_reset_user_features_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceResetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _reset_user_features_serialize( + async def reset_user_features_with_http_info( self, - beta_feature_service_reset_user_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_reset_user_features_request is not None: - _body_params = beta_feature_service_reset_user_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_feature_service_reset_user_features_request: BetaFeatureServiceResetUserFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceResetUserFeaturesResponse]": + """ResetUserFeatures (with HTTP info) + :param beta_feature_service_reset_user_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_reset_user_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_reset_user_features_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/ResetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.feature.v2beta.FeatureService/ResetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_reset_user_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceResetUserFeaturesResponse", + None, + ) - @validate_call - def set_instance_features( self, beta_feature_service_set_instance_features_request: BetaFeatureServiceSetInstanceFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceSetInstanceFeaturesResponse: + async def set_instance_features( + self, + beta_feature_service_set_instance_features_request: BetaFeatureServiceSetInstanceFeaturesRequest, + ) -> BetaFeatureServiceSetInstanceFeaturesResponse: """SetInstanceFeatures + :param beta_feature_service_set_instance_features_request: (required) + + :return: BetaFeatureServiceSetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_instance_features_request'" + ) - - :param beta_feature_service_set_instance_features_request: (required) - :type beta_feature_service_set_instance_features_request: BetaFeatureServiceSetInstanceFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_instance_features_serialize( - beta_feature_service_set_instance_features_request=beta_feature_service_set_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceSetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_instance_features_with_http_info( + beta_feature_service_set_instance_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_instance_features_serialize( - self, - beta_feature_service_set_instance_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_set_instance_features_request is not None: - _body_params = beta_feature_service_set_instance_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_instance_features_with_http_info( + self, + beta_feature_service_set_instance_features_request: BetaFeatureServiceSetInstanceFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceSetInstanceFeaturesResponse]": + """SetInstanceFeatures (with HTTP info) + :param beta_feature_service_set_instance_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_instance_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/SetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2beta.FeatureService/SetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_set_instance_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceSetInstanceFeaturesResponse", + None, + ) - @validate_call - def set_organization_features( self, beta_feature_service_set_organization_features_request: BetaFeatureServiceSetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceSetOrganizationFeaturesResponse: + async def set_organization_features( + self, + beta_feature_service_set_organization_features_request: BetaFeatureServiceSetOrganizationFeaturesRequest, + ) -> BetaFeatureServiceSetOrganizationFeaturesResponse: """SetOrganizationFeatures + :param beta_feature_service_set_organization_features_request: (required) + + :return: BetaFeatureServiceSetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_organization_features_request'" + ) - - :param beta_feature_service_set_organization_features_request: (required) - :type beta_feature_service_set_organization_features_request: BetaFeatureServiceSetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_organization_features_serialize( - beta_feature_service_set_organization_features_request=beta_feature_service_set_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceSetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_organization_features_with_http_info( + beta_feature_service_set_organization_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_organization_features_serialize( - self, - beta_feature_service_set_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_set_organization_features_request is not None: - _body_params = beta_feature_service_set_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_organization_features_with_http_info( + self, + beta_feature_service_set_organization_features_request: BetaFeatureServiceSetOrganizationFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceSetOrganizationFeaturesResponse]": + """SetOrganizationFeatures (with HTTP info) + :param beta_feature_service_set_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_organization_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/SetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2beta.FeatureService/SetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_set_organization_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceSetOrganizationFeaturesResponse", + None, + ) - @validate_call - def set_system_features( self, beta_feature_service_set_system_features_request: BetaFeatureServiceSetSystemFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceSetSystemFeaturesResponse: + async def set_system_features( + self, + beta_feature_service_set_system_features_request: BetaFeatureServiceSetSystemFeaturesRequest, + ) -> BetaFeatureServiceSetSystemFeaturesResponse: """SetSystemFeatures + :param beta_feature_service_set_system_features_request: (required) + + :return: BetaFeatureServiceSetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_system_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_system_features_request'" + ) - - :param beta_feature_service_set_system_features_request: (required) - :type beta_feature_service_set_system_features_request: BetaFeatureServiceSetSystemFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_system_features_serialize( - beta_feature_service_set_system_features_request=beta_feature_service_set_system_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceSetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_system_features_with_http_info( + beta_feature_service_set_system_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_system_features_serialize( - self, - beta_feature_service_set_system_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_set_system_features_request is not None: - _body_params = beta_feature_service_set_system_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_system_features_with_http_info( + self, + beta_feature_service_set_system_features_request: BetaFeatureServiceSetSystemFeaturesRequest, + ) -> "ApiResult[BetaFeatureServiceSetSystemFeaturesResponse]": + """SetSystemFeatures (with HTTP info) + :param beta_feature_service_set_system_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_system_features_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_system_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/SetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2beta.FeatureService/SetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_set_system_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceSetSystemFeaturesResponse", + None, + ) - @validate_call - def set_user_features( self, beta_feature_service_set_user_feature_request: BetaFeatureServiceSetUserFeatureRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaFeatureServiceSetUserFeaturesResponse: + async def set_user_features( + self, + beta_feature_service_set_user_feature_request: BetaFeatureServiceSetUserFeatureRequest, + ) -> BetaFeatureServiceSetUserFeaturesResponse: """SetUserFeatures + :param beta_feature_service_set_user_feature_request: (required) + + :return: BetaFeatureServiceSetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_user_feature_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_user_feature_request'" + ) - - :param beta_feature_service_set_user_feature_request: (required) - :type beta_feature_service_set_user_feature_request: BetaFeatureServiceSetUserFeatureRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_user_features_serialize( - beta_feature_service_set_user_feature_request=beta_feature_service_set_user_feature_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_user_features_with_http_info( + beta_feature_service_set_user_feature_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaFeatureServiceSetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_user_features_serialize( + async def set_user_features_with_http_info( self, - beta_feature_service_set_user_feature_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_feature_service_set_user_feature_request is not None: - _body_params = beta_feature_service_set_user_feature_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_feature_service_set_user_feature_request: BetaFeatureServiceSetUserFeatureRequest, + ) -> "ApiResult[BetaFeatureServiceSetUserFeaturesResponse]": + """SetUserFeatures (with HTTP info) + :param beta_feature_service_set_user_feature_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_feature_service_set_user_feature_request is None: + raise ValueError( + "Missing the required parameter 'beta_feature_service_set_user_feature_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2beta.FeatureService/SetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.feature.v2beta.FeatureService/SetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_feature_service_set_user_feature_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaFeatureServiceSetUserFeaturesResponse", + None, ) - - diff --git a/zitadel_client/api/beta_instance_service_api.py b/zitadel_client/api/beta_instance_service_api.py index 48d72991..57781b97 100644 --- a/zitadel_client/api/beta_instance_service_api.py +++ b/zitadel_client/api/beta_instance_service_api.py @@ -1,1335 +1,750 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_instance_service_add_custom_domain_request import BetaInstanceServiceAddCustomDomainRequest -from zitadel_client.models.beta_instance_service_add_custom_domain_response import BetaInstanceServiceAddCustomDomainResponse -from zitadel_client.models.beta_instance_service_add_trusted_domain_request import BetaInstanceServiceAddTrustedDomainRequest -from zitadel_client.models.beta_instance_service_add_trusted_domain_response import BetaInstanceServiceAddTrustedDomainResponse -from zitadel_client.models.beta_instance_service_delete_instance_request import BetaInstanceServiceDeleteInstanceRequest -from zitadel_client.models.beta_instance_service_delete_instance_response import BetaInstanceServiceDeleteInstanceResponse -from zitadel_client.models.beta_instance_service_get_instance_request import BetaInstanceServiceGetInstanceRequest -from zitadel_client.models.beta_instance_service_get_instance_response import BetaInstanceServiceGetInstanceResponse -from zitadel_client.models.beta_instance_service_list_custom_domains_request import BetaInstanceServiceListCustomDomainsRequest -from zitadel_client.models.beta_instance_service_list_custom_domains_response import BetaInstanceServiceListCustomDomainsResponse -from zitadel_client.models.beta_instance_service_list_instances_request import BetaInstanceServiceListInstancesRequest -from zitadel_client.models.beta_instance_service_list_instances_response import BetaInstanceServiceListInstancesResponse -from zitadel_client.models.beta_instance_service_list_trusted_domains_request import BetaInstanceServiceListTrustedDomainsRequest -from zitadel_client.models.beta_instance_service_list_trusted_domains_response import BetaInstanceServiceListTrustedDomainsResponse -from zitadel_client.models.beta_instance_service_remove_custom_domain_request import BetaInstanceServiceRemoveCustomDomainRequest -from zitadel_client.models.beta_instance_service_remove_custom_domain_response import BetaInstanceServiceRemoveCustomDomainResponse -from zitadel_client.models.beta_instance_service_remove_trusted_domain_request import BetaInstanceServiceRemoveTrustedDomainRequest -from zitadel_client.models.beta_instance_service_remove_trusted_domain_response import BetaInstanceServiceRemoveTrustedDomainResponse -from zitadel_client.models.beta_instance_service_update_instance_request import BetaInstanceServiceUpdateInstanceRequest -from zitadel_client.models.beta_instance_service_update_instance_response import BetaInstanceServiceUpdateInstanceResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaInstanceServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def add_custom_domain( self, beta_instance_service_add_custom_domain_request: BetaInstanceServiceAddCustomDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceAddCustomDomainResponse: - """Add Custom Domain +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_instance_service_add_custom_domain_request import ( + BetaInstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_custom_domain_response import ( + BetaInstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_request import ( + BetaInstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_response import ( + BetaInstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_delete_instance_request import ( + BetaInstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.beta_instance_service_delete_instance_response import ( + BetaInstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.beta_instance_service_get_instance_request import ( + BetaInstanceServiceGetInstanceRequest, +) +from zitadel_client.models.beta_instance_service_get_instance_response import ( + BetaInstanceServiceGetInstanceResponse, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_request import ( + BetaInstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_response import ( + BetaInstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.beta_instance_service_list_instances_request import ( + BetaInstanceServiceListInstancesRequest, +) +from zitadel_client.models.beta_instance_service_list_instances_response import ( + BetaInstanceServiceListInstancesResponse, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_request import ( + BetaInstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_response import ( + BetaInstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_request import ( + BetaInstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_response import ( + BetaInstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_request import ( + BetaInstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_response import ( + BetaInstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_update_instance_request import ( + BetaInstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.beta_instance_service_update_instance_response import ( + BetaInstanceServiceUpdateInstanceResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaInstanceServiceApi(BaseApi): + """BetaInstanceServiceApi provides methods for the BetaInstanceService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def add_custom_domain( + self, + beta_instance_service_add_custom_domain_request: BetaInstanceServiceAddCustomDomainRequest, + ) -> BetaInstanceServiceAddCustomDomainResponse: + """Add Custom Domain Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a custom domain to the instance in context. The instance_id in the input message will be used in the future Required permissions: - `system.domain.write` + :param beta_instance_service_add_custom_domain_request: (required) + + :return: BetaInstanceServiceAddCustomDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_add_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_add_custom_domain_request'" + ) - :param beta_instance_service_add_custom_domain_request: (required) - :type beta_instance_service_add_custom_domain_request: BetaInstanceServiceAddCustomDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_custom_domain_serialize( - beta_instance_service_add_custom_domain_request=beta_instance_service_add_custom_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_custom_domain_with_http_info( + beta_instance_service_add_custom_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceAddCustomDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_custom_domain_serialize( + async def add_custom_domain_with_http_info( self, - beta_instance_service_add_custom_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_add_custom_domain_request is not None: - _body_params = beta_instance_service_add_custom_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_add_custom_domain_request: BetaInstanceServiceAddCustomDomainRequest, + ) -> "ApiResult[BetaInstanceServiceAddCustomDomainResponse]": + """Add Custom Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a custom domain to the instance in context. The instance_id in the input message will be used in the future Required permissions: - `system.domain.write` + :param beta_instance_service_add_custom_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_add_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_add_custom_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/AddCustomDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/AddCustomDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_add_custom_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceAddCustomDomainResponse", + None, ) - - - - @validate_call - def add_trusted_domain( self, beta_instance_service_add_trusted_domain_request: BetaInstanceServiceAddTrustedDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceAddTrustedDomainResponse: + async def add_trusted_domain( + self, + beta_instance_service_add_trusted_domain_request: BetaInstanceServiceAddTrustedDomainRequest, + ) -> BetaInstanceServiceAddTrustedDomainResponse: """Add Trusted Domain - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a trusted domain to the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_add_trusted_domain_request: (required) + + :return: BetaInstanceServiceAddTrustedDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_add_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_add_trusted_domain_request'" + ) - :param beta_instance_service_add_trusted_domain_request: (required) - :type beta_instance_service_add_trusted_domain_request: BetaInstanceServiceAddTrustedDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_trusted_domain_serialize( - beta_instance_service_add_trusted_domain_request=beta_instance_service_add_trusted_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_trusted_domain_with_http_info( + beta_instance_service_add_trusted_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceAddTrustedDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_trusted_domain_serialize( + async def add_trusted_domain_with_http_info( self, - beta_instance_service_add_trusted_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_add_trusted_domain_request is not None: - _body_params = beta_instance_service_add_trusted_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_add_trusted_domain_request: BetaInstanceServiceAddTrustedDomainRequest, + ) -> "ApiResult[BetaInstanceServiceAddTrustedDomainResponse]": + """Add Trusted Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Adds a trusted domain to the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_add_trusted_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_add_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_add_trusted_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/AddTrustedDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/AddTrustedDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_add_trusted_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceAddTrustedDomainResponse", + None, ) - - - - @validate_call - def delete_instance( self, beta_instance_service_delete_instance_request: BetaInstanceServiceDeleteInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceDeleteInstanceResponse: + async def delete_instance( + self, + beta_instance_service_delete_instance_request: BetaInstanceServiceDeleteInstanceRequest, + ) -> BetaInstanceServiceDeleteInstanceResponse: """Delete Instance - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes an instance with the given ID. Required permissions: - `system.instance.delete` + :param beta_instance_service_delete_instance_request: (required) + + :return: BetaInstanceServiceDeleteInstanceResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_delete_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_delete_instance_request'" + ) - :param beta_instance_service_delete_instance_request: (required) - :type beta_instance_service_delete_instance_request: BetaInstanceServiceDeleteInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_instance_serialize( - beta_instance_service_delete_instance_request=beta_instance_service_delete_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_instance_with_http_info( + beta_instance_service_delete_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceDeleteInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_instance_serialize( + async def delete_instance_with_http_info( self, - beta_instance_service_delete_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_delete_instance_request is not None: - _body_params = beta_instance_service_delete_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_delete_instance_request: BetaInstanceServiceDeleteInstanceRequest, + ) -> "ApiResult[BetaInstanceServiceDeleteInstanceResponse]": + """Delete Instance (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes an instance with the given ID. Required permissions: - `system.instance.delete` + :param beta_instance_service_delete_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_delete_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_delete_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/DeleteInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/DeleteInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_delete_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceDeleteInstanceResponse", + None, ) - - - - @validate_call - def get_instance( self, beta_instance_service_get_instance_request: BetaInstanceServiceGetInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceGetInstanceResponse: + async def get_instance( + self, + beta_instance_service_get_instance_request: BetaInstanceServiceGetInstanceRequest, + ) -> BetaInstanceServiceGetInstanceResponse: """Get Instance - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the instance in the current context. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_get_instance_request: (required) + + :return: BetaInstanceServiceGetInstanceResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_get_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_get_instance_request'" + ) - :param beta_instance_service_get_instance_request: (required) - :type beta_instance_service_get_instance_request: BetaInstanceServiceGetInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_instance_serialize( - beta_instance_service_get_instance_request=beta_instance_service_get_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_instance_with_http_info( + beta_instance_service_get_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceGetInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_instance_serialize( + async def get_instance_with_http_info( self, - beta_instance_service_get_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_get_instance_request is not None: - _body_params = beta_instance_service_get_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_get_instance_request: BetaInstanceServiceGetInstanceRequest, + ) -> "ApiResult[BetaInstanceServiceGetInstanceResponse]": + """Get Instance (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the instance in the current context. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_get_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_get_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_get_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/GetInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/GetInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_get_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceGetInstanceResponse", + None, ) - - - - @validate_call - def list_custom_domains( self, beta_instance_service_list_custom_domains_request: BetaInstanceServiceListCustomDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceListCustomDomainsResponse: + async def list_custom_domains( + self, + beta_instance_service_list_custom_domains_request: BetaInstanceServiceListCustomDomainsRequest, + ) -> BetaInstanceServiceListCustomDomainsResponse: """List Custom Domains - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists custom domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_list_custom_domains_request: (required) + + :return: BetaInstanceServiceListCustomDomainsResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_custom_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_custom_domains_request'" + ) - :param beta_instance_service_list_custom_domains_request: (required) - :type beta_instance_service_list_custom_domains_request: BetaInstanceServiceListCustomDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_custom_domains_serialize( - beta_instance_service_list_custom_domains_request=beta_instance_service_list_custom_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_custom_domains_with_http_info( + beta_instance_service_list_custom_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceListCustomDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_custom_domains_serialize( + async def list_custom_domains_with_http_info( self, - beta_instance_service_list_custom_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_list_custom_domains_request is not None: - _body_params = beta_instance_service_list_custom_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_list_custom_domains_request: BetaInstanceServiceListCustomDomainsRequest, + ) -> "ApiResult[BetaInstanceServiceListCustomDomainsResponse]": + """List Custom Domains (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists custom domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_list_custom_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_custom_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_custom_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/ListCustomDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/ListCustomDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_list_custom_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceListCustomDomainsResponse", + None, ) - - - - @validate_call - def list_instances( self, beta_instance_service_list_instances_request: BetaInstanceServiceListInstancesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceListInstancesResponse: + async def list_instances( + self, + beta_instance_service_list_instances_request: BetaInstanceServiceListInstancesRequest, + ) -> BetaInstanceServiceListInstancesResponse: """List Instances - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. Required permissions: - `system.instance.read` + :param beta_instance_service_list_instances_request: (required) + + :return: BetaInstanceServiceListInstancesResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_instances_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_instances_request'" + ) - :param beta_instance_service_list_instances_request: (required) - :type beta_instance_service_list_instances_request: BetaInstanceServiceListInstancesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_instances_serialize( - beta_instance_service_list_instances_request=beta_instance_service_list_instances_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_instances_with_http_info( + beta_instance_service_list_instances_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceListInstancesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_instances_serialize( + async def list_instances_with_http_info( self, - beta_instance_service_list_instances_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_list_instances_request is not None: - _body_params = beta_instance_service_list_instances_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_list_instances_request: BetaInstanceServiceListInstancesRequest, + ) -> "ApiResult[BetaInstanceServiceListInstancesResponse]": + """List Instances (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. Required permissions: - `system.instance.read` + :param beta_instance_service_list_instances_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_instances_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_instances_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/ListInstances', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/ListInstances" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_list_instances_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceListInstancesResponse", + None, ) - - - - @validate_call - def list_trusted_domains( self, beta_instance_service_list_trusted_domains_request: BetaInstanceServiceListTrustedDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceListTrustedDomainsResponse: + async def list_trusted_domains( + self, + beta_instance_service_list_trusted_domains_request: BetaInstanceServiceListTrustedDomainsRequest, + ) -> BetaInstanceServiceListTrustedDomainsResponse: """List Trusted Domains - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists trusted domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_list_trusted_domains_request: (required) + + :return: BetaInstanceServiceListTrustedDomainsResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_trusted_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_trusted_domains_request'" + ) - :param beta_instance_service_list_trusted_domains_request: (required) - :type beta_instance_service_list_trusted_domains_request: BetaInstanceServiceListTrustedDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_trusted_domains_serialize( - beta_instance_service_list_trusted_domains_request=beta_instance_service_list_trusted_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_trusted_domains_with_http_info( + beta_instance_service_list_trusted_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceListTrustedDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_trusted_domains_serialize( + async def list_trusted_domains_with_http_info( self, - beta_instance_service_list_trusted_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_list_trusted_domains_request is not None: - _body_params = beta_instance_service_list_trusted_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_list_trusted_domains_request: BetaInstanceServiceListTrustedDomainsRequest, + ) -> "ApiResult[BetaInstanceServiceListTrustedDomainsResponse]": + """List Trusted Domains (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Lists trusted domains of the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.read` + :param beta_instance_service_list_trusted_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_list_trusted_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_list_trusted_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/ListTrustedDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/ListTrustedDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_list_trusted_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceListTrustedDomainsResponse", + None, ) - - - - @validate_call - def remove_custom_domain( self, beta_instance_service_remove_custom_domain_request: BetaInstanceServiceRemoveCustomDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceRemoveCustomDomainResponse: + async def remove_custom_domain( + self, + beta_instance_service_remove_custom_domain_request: BetaInstanceServiceRemoveCustomDomainRequest, + ) -> BetaInstanceServiceRemoveCustomDomainResponse: """Remove Custom Domain - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a custom domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `system.domain.write` + :param beta_instance_service_remove_custom_domain_request: (required) + + :return: BetaInstanceServiceRemoveCustomDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_remove_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_remove_custom_domain_request'" + ) - :param beta_instance_service_remove_custom_domain_request: (required) - :type beta_instance_service_remove_custom_domain_request: BetaInstanceServiceRemoveCustomDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_custom_domain_serialize( - beta_instance_service_remove_custom_domain_request=beta_instance_service_remove_custom_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_custom_domain_with_http_info( + beta_instance_service_remove_custom_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceRemoveCustomDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_custom_domain_serialize( + async def remove_custom_domain_with_http_info( self, - beta_instance_service_remove_custom_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_remove_custom_domain_request is not None: - _body_params = beta_instance_service_remove_custom_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_remove_custom_domain_request: BetaInstanceServiceRemoveCustomDomainRequest, + ) -> "ApiResult[BetaInstanceServiceRemoveCustomDomainResponse]": + """Remove Custom Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a custom domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `system.domain.write` + :param beta_instance_service_remove_custom_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_remove_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_remove_custom_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/RemoveCustomDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/RemoveCustomDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_remove_custom_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceRemoveCustomDomainResponse", + None, ) - - - - @validate_call - def remove_trusted_domain( self, beta_instance_service_remove_trusted_domain_request: BetaInstanceServiceRemoveTrustedDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceRemoveTrustedDomainResponse: + async def remove_trusted_domain( + self, + beta_instance_service_remove_trusted_domain_request: BetaInstanceServiceRemoveTrustedDomainRequest, + ) -> BetaInstanceServiceRemoveTrustedDomainResponse: """Remove Trusted Domain - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a trusted domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_remove_trusted_domain_request: (required) + + :return: BetaInstanceServiceRemoveTrustedDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_remove_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_remove_trusted_domain_request'" + ) - :param beta_instance_service_remove_trusted_domain_request: (required) - :type beta_instance_service_remove_trusted_domain_request: BetaInstanceServiceRemoveTrustedDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_trusted_domain_serialize( - beta_instance_service_remove_trusted_domain_request=beta_instance_service_remove_trusted_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_trusted_domain_with_http_info( + beta_instance_service_remove_trusted_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceRemoveTrustedDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_trusted_domain_serialize( + async def remove_trusted_domain_with_http_info( self, - beta_instance_service_remove_trusted_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_remove_trusted_domain_request is not None: - _body_params = beta_instance_service_remove_trusted_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_remove_trusted_domain_request: BetaInstanceServiceRemoveTrustedDomainRequest, + ) -> "ApiResult[BetaInstanceServiceRemoveTrustedDomainResponse]": + """Remove Trusted Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Removes a trusted domain from the instance. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_remove_trusted_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_remove_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_remove_trusted_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/RemoveTrustedDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/RemoveTrustedDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_remove_trusted_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceRemoveTrustedDomainResponse", + None, ) - - - - @validate_call - def update_instance( self, beta_instance_service_update_instance_request: BetaInstanceServiceUpdateInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInstanceServiceUpdateInstanceResponse: + async def update_instance( + self, + beta_instance_service_update_instance_request: BetaInstanceServiceUpdateInstanceRequest, + ) -> BetaInstanceServiceUpdateInstanceResponse: """Update Instance - Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Updates instance in context with the given name. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_update_instance_request: (required) + + :return: BetaInstanceServiceUpdateInstanceResponse + :raises ApiException: if fails to make API call + """ + if beta_instance_service_update_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_update_instance_request'" + ) - :param beta_instance_service_update_instance_request: (required) - :type beta_instance_service_update_instance_request: BetaInstanceServiceUpdateInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_instance_serialize( - beta_instance_service_update_instance_request=beta_instance_service_update_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_instance_with_http_info( + beta_instance_service_update_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInstanceServiceUpdateInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_instance_serialize( + async def update_instance_with_http_info( self, - beta_instance_service_update_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_instance_service_update_instance_request is not None: - _body_params = beta_instance_service_update_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_instance_service_update_instance_request: BetaInstanceServiceUpdateInstanceRequest, + ) -> "ApiResult[BetaInstanceServiceUpdateInstanceResponse]": + """Update Instance (with HTTP info) + Deprecated: please move to the corresponding endpoint under instance service v2. This endpoint will be removed with the next major version of ZITADEL. Updates instance in context with the given name. The instance_id in the input message will be used in the future. Required permissions: - `iam.write` + :param beta_instance_service_update_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_instance_service_update_instance_request is None: + raise ValueError( + "Missing the required parameter 'beta_instance_service_update_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2beta.InstanceService/UpdateInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2beta.InstanceService/UpdateInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_instance_service_update_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInstanceServiceUpdateInstanceResponse", + None, ) - - diff --git a/zitadel_client/api/beta_internal_permission_service_api.py b/zitadel_client/api/beta_internal_permission_service_api.py index 5d1d314d..98499c71 100644 --- a/zitadel_client/api/beta_internal_permission_service_api.py +++ b/zitadel_client/api/beta_internal_permission_service_api.py @@ -1,555 +1,318 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_internal_permission_service_create_administrator_request import BetaInternalPermissionServiceCreateAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_create_administrator_response import BetaInternalPermissionServiceCreateAdministratorResponse -from zitadel_client.models.beta_internal_permission_service_delete_administrator_request import BetaInternalPermissionServiceDeleteAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_delete_administrator_response import BetaInternalPermissionServiceDeleteAdministratorResponse -from zitadel_client.models.beta_internal_permission_service_list_administrators_request import BetaInternalPermissionServiceListAdministratorsRequest -from zitadel_client.models.beta_internal_permission_service_list_administrators_response import BetaInternalPermissionServiceListAdministratorsResponse -from zitadel_client.models.beta_internal_permission_service_update_administrator_request import BetaInternalPermissionServiceUpdateAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_update_administrator_response import BetaInternalPermissionServiceUpdateAdministratorResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaInternalPermissionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_internal_permission_service_create_administrator_request import ( + BetaInternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_create_administrator_response import ( + BetaInternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_request import ( + BetaInternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_response import ( + BetaInternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_request import ( + BetaInternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_response import ( + BetaInternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_request import ( + BetaInternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_response import ( + BetaInternalPermissionServiceUpdateAdministratorResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaInternalPermissionServiceApi(BaseApi): + """BetaInternalPermissionServiceApi provides methods for the BetaInternalPermissionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_administrator( self, beta_internal_permission_service_create_administrator_request: BetaInternalPermissionServiceCreateAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInternalPermissionServiceCreateAdministratorResponse: + async def create_administrator( + self, + beta_internal_permission_service_create_administrator_request: BetaInternalPermissionServiceCreateAdministratorRequest, + ) -> BetaInternalPermissionServiceCreateAdministratorResponse: """CreateAdministrator grants a administrator role to a user for a specific resource. - Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param beta_internal_permission_service_create_administrator_request: (required) + + :return: BetaInternalPermissionServiceCreateAdministratorResponse + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_create_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_create_administrator_request'" + ) - :param beta_internal_permission_service_create_administrator_request: (required) - :type beta_internal_permission_service_create_administrator_request: BetaInternalPermissionServiceCreateAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_administrator_serialize( - beta_internal_permission_service_create_administrator_request=beta_internal_permission_service_create_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_administrator_with_http_info( + beta_internal_permission_service_create_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInternalPermissionServiceCreateAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_administrator_serialize( + async def create_administrator_with_http_info( self, - beta_internal_permission_service_create_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_internal_permission_service_create_administrator_request is not None: - _body_params = beta_internal_permission_service_create_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_internal_permission_service_create_administrator_request: BetaInternalPermissionServiceCreateAdministratorRequest, + ) -> "ApiResult[BetaInternalPermissionServiceCreateAdministratorResponse]": + """CreateAdministrator grants a administrator role to a user for a specific resource. (with HTTP info) + Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param beta_internal_permission_service_create_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_create_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_create_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2beta.InternalPermissionService/CreateAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2beta.InternalPermissionService/CreateAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_internal_permission_service_create_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInternalPermissionServiceCreateAdministratorResponse", + None, ) - - - - @validate_call - def delete_administrator( self, beta_internal_permission_service_delete_administrator_request: BetaInternalPermissionServiceDeleteAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInternalPermissionServiceDeleteAdministratorResponse: + async def delete_administrator( + self, + beta_internal_permission_service_delete_administrator_request: BetaInternalPermissionServiceDeleteAdministratorRequest, + ) -> BetaInternalPermissionServiceDeleteAdministratorResponse: """DeleteAdministrator revokes a administrator role from a user. - Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + :param beta_internal_permission_service_delete_administrator_request: (required) + + :return: BetaInternalPermissionServiceDeleteAdministratorResponse + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_delete_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_delete_administrator_request'" + ) - :param beta_internal_permission_service_delete_administrator_request: (required) - :type beta_internal_permission_service_delete_administrator_request: BetaInternalPermissionServiceDeleteAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_administrator_serialize( - beta_internal_permission_service_delete_administrator_request=beta_internal_permission_service_delete_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_administrator_with_http_info( + beta_internal_permission_service_delete_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInternalPermissionServiceDeleteAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_administrator_serialize( + async def delete_administrator_with_http_info( self, - beta_internal_permission_service_delete_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_internal_permission_service_delete_administrator_request is not None: - _body_params = beta_internal_permission_service_delete_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_internal_permission_service_delete_administrator_request: BetaInternalPermissionServiceDeleteAdministratorRequest, + ) -> "ApiResult[BetaInternalPermissionServiceDeleteAdministratorResponse]": + """DeleteAdministrator revokes a administrator role from a user. (with HTTP info) + Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + :param beta_internal_permission_service_delete_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_delete_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_delete_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2beta.InternalPermissionService/DeleteAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2beta.InternalPermissionService/DeleteAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_internal_permission_service_delete_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInternalPermissionServiceDeleteAdministratorResponse", + None, ) - - - - @validate_call - def list_administrators( self, beta_internal_permission_service_list_administrators_request: BetaInternalPermissionServiceListAdministratorsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInternalPermissionServiceListAdministratorsResponse: + async def list_administrators( + self, + beta_internal_permission_service_list_administrators_request: BetaInternalPermissionServiceListAdministratorsRequest, + ) -> BetaInternalPermissionServiceListAdministratorsResponse: """ListAdministrators returns all administrators and its roles matching the request and necessary permissions. - Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + :param beta_internal_permission_service_list_administrators_request: (required) + + :return: BetaInternalPermissionServiceListAdministratorsResponse + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_list_administrators_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_list_administrators_request'" + ) - :param beta_internal_permission_service_list_administrators_request: (required) - :type beta_internal_permission_service_list_administrators_request: BetaInternalPermissionServiceListAdministratorsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_administrators_serialize( - beta_internal_permission_service_list_administrators_request=beta_internal_permission_service_list_administrators_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_administrators_with_http_info( + beta_internal_permission_service_list_administrators_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInternalPermissionServiceListAdministratorsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_administrators_serialize( + async def list_administrators_with_http_info( self, - beta_internal_permission_service_list_administrators_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_internal_permission_service_list_administrators_request is not None: - _body_params = beta_internal_permission_service_list_administrators_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_internal_permission_service_list_administrators_request: BetaInternalPermissionServiceListAdministratorsRequest, + ) -> "ApiResult[BetaInternalPermissionServiceListAdministratorsResponse]": + """ListAdministrators returns all administrators and its roles matching the request and necessary permissions. (with HTTP info) + Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + :param beta_internal_permission_service_list_administrators_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_list_administrators_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_list_administrators_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2beta.InternalPermissionService/ListAdministrators', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2beta.InternalPermissionService/ListAdministrators" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_internal_permission_service_list_administrators_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInternalPermissionServiceListAdministratorsResponse", + None, ) - - - - @validate_call - def update_administrator( self, beta_internal_permission_service_update_administrator_request: BetaInternalPermissionServiceUpdateAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaInternalPermissionServiceUpdateAdministratorResponse: + async def update_administrator( + self, + beta_internal_permission_service_update_administrator_request: BetaInternalPermissionServiceUpdateAdministratorRequest, + ) -> BetaInternalPermissionServiceUpdateAdministratorResponse: """UpdateAdministrator updates the specific administrator role. - Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param beta_internal_permission_service_update_administrator_request: (required) + + :return: BetaInternalPermissionServiceUpdateAdministratorResponse + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_update_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_update_administrator_request'" + ) - :param beta_internal_permission_service_update_administrator_request: (required) - :type beta_internal_permission_service_update_administrator_request: BetaInternalPermissionServiceUpdateAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_administrator_serialize( - beta_internal_permission_service_update_administrator_request=beta_internal_permission_service_update_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_administrator_with_http_info( + beta_internal_permission_service_update_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaInternalPermissionServiceUpdateAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_administrator_serialize( + async def update_administrator_with_http_info( self, - beta_internal_permission_service_update_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_internal_permission_service_update_administrator_request is not None: - _body_params = beta_internal_permission_service_update_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_internal_permission_service_update_administrator_request: BetaInternalPermissionServiceUpdateAdministratorRequest, + ) -> "ApiResult[BetaInternalPermissionServiceUpdateAdministratorResponse]": + """UpdateAdministrator updates the specific administrator role. (with HTTP info) + Deprecated: please move to the corresponding endpoint under internal permission service v2. This endpoint will be removed with the next major version of ZITADEL. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param beta_internal_permission_service_update_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_internal_permission_service_update_administrator_request is None: + raise ValueError( + "Missing the required parameter 'beta_internal_permission_service_update_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2beta.InternalPermissionService/UpdateAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2beta.InternalPermissionService/UpdateAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_internal_permission_service_update_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaInternalPermissionServiceUpdateAdministratorResponse", + None, ) - - diff --git a/zitadel_client/api/beta_oidc_service_api.py b/zitadel_client/api/beta_oidc_service_api.py index 813f541a..7e1431ec 100644 --- a/zitadel_client/api/beta_oidc_service_api.py +++ b/zitadel_client/api/beta_oidc_service_api.py @@ -1,297 +1,174 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_oidc_service_create_callback_request import BetaOIDCServiceCreateCallbackRequest -from zitadel_client.models.beta_oidc_service_create_callback_response import BetaOIDCServiceCreateCallbackResponse -from zitadel_client.models.beta_oidc_service_get_auth_request_request import BetaOIDCServiceGetAuthRequestRequest -from zitadel_client.models.beta_oidc_service_get_auth_request_response import BetaOIDCServiceGetAuthRequestResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaOIDCServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_oidc_service_create_callback_request import ( + BetaOIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.beta_oidc_service_create_callback_response import ( + BetaOIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_request import ( + BetaOIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_response import ( + BetaOIDCServiceGetAuthRequestResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaOIDCServiceApi(BaseApi): + """BetaOIDCServiceApi provides methods for the BetaOIDCService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_callback( self, beta_oidc_service_create_callback_request: Optional[BetaOIDCServiceCreateCallbackRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOIDCServiceCreateCallbackResponse: - if beta_oidc_service_create_callback_request is None: - beta_oidc_service_create_callback_request = {} + async def create_callback( + self, + beta_oidc_service_create_callback_request: BetaOIDCServiceCreateCallbackRequest, + ) -> BetaOIDCServiceCreateCallbackResponse: """Create Callback - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. + :param beta_oidc_service_create_callback_request: (required) - :param beta_oidc_service_create_callback_request: (required) - :type beta_oidc_service_create_callback_request: BetaOIDCServiceCreateCallbackRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + :return: BetaOIDCServiceCreateCallbackResponse + :raises ApiException: if fails to make API call + """ + if beta_oidc_service_create_callback_request is None: + raise ValueError( + "Missing the required parameter 'beta_oidc_service_create_callback_request'" + ) - _param = self._create_callback_serialize( - beta_oidc_service_create_callback_request=beta_oidc_service_create_callback_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_callback_with_http_info( + beta_oidc_service_create_callback_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOIDCServiceCreateCallbackResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_callback_serialize( + async def create_callback_with_http_info( self, - beta_oidc_service_create_callback_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_oidc_service_create_callback_request is not None: - _body_params = beta_oidc_service_create_callback_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + beta_oidc_service_create_callback_request: BetaOIDCServiceCreateCallbackRequest, + ) -> "ApiResult[BetaOIDCServiceCreateCallbackResponse]": + """Create Callback (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. + :param beta_oidc_service_create_callback_request: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_oidc_service_create_callback_request is None: + raise ValueError( + "Missing the required parameter 'beta_oidc_service_create_callback_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2beta.OIDCService/CreateCallback', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.oidc.v2beta.OIDCService/CreateCallback" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_oidc_service_create_callback_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOIDCServiceCreateCallbackResponse", + None, ) - - - - @validate_call - def get_auth_request( self, beta_oidc_service_get_auth_request_request: BetaOIDCServiceGetAuthRequestRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOIDCServiceGetAuthRequestResponse: + async def get_auth_request( + self, + beta_oidc_service_get_auth_request_request: BetaOIDCServiceGetAuthRequestRequest, + ) -> BetaOIDCServiceGetAuthRequestResponse: """Get AuthRequest - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. + :param beta_oidc_service_get_auth_request_request: (required) + + :return: BetaOIDCServiceGetAuthRequestResponse + :raises ApiException: if fails to make API call + """ + if beta_oidc_service_get_auth_request_request is None: + raise ValueError( + "Missing the required parameter 'beta_oidc_service_get_auth_request_request'" + ) - :param beta_oidc_service_get_auth_request_request: (required) - :type beta_oidc_service_get_auth_request_request: BetaOIDCServiceGetAuthRequestRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_auth_request_serialize( - beta_oidc_service_get_auth_request_request=beta_oidc_service_get_auth_request_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOIDCServiceGetAuthRequestResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_auth_request_with_http_info( + beta_oidc_service_get_auth_request_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_auth_request_serialize( - self, - beta_oidc_service_get_auth_request_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_oidc_service_get_auth_request_request is not None: - _body_params = beta_oidc_service_get_auth_request_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_auth_request_with_http_info( + self, + beta_oidc_service_get_auth_request_request: BetaOIDCServiceGetAuthRequestRequest, + ) -> "ApiResult[BetaOIDCServiceGetAuthRequestResponse]": + """Get AuthRequest (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. + :param beta_oidc_service_get_auth_request_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_oidc_service_get_auth_request_request is None: + raise ValueError( + "Missing the required parameter 'beta_oidc_service_get_auth_request_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2beta.OIDCService/GetAuthRequest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.oidc.v2beta.OIDCService/GetAuthRequest" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_oidc_service_get_auth_request_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOIDCServiceGetAuthRequestResponse", + None, ) - - diff --git a/zitadel_client/api/beta_organization_service_api.py b/zitadel_client/api/beta_organization_service_api.py index cef42b73..c4d76ed6 100644 --- a/zitadel_client/api/beta_organization_service_api.py +++ b/zitadel_client/api/beta_organization_service_api.py @@ -1,1855 +1,1046 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_organization_service_activate_organization_request import BetaOrganizationServiceActivateOrganizationRequest -from zitadel_client.models.beta_organization_service_activate_organization_response import BetaOrganizationServiceActivateOrganizationResponse -from zitadel_client.models.beta_organization_service_add_organization_domain_request import BetaOrganizationServiceAddOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_add_organization_domain_response import BetaOrganizationServiceAddOrganizationDomainResponse -from zitadel_client.models.beta_organization_service_create_organization_request import BetaOrganizationServiceCreateOrganizationRequest -from zitadel_client.models.beta_organization_service_create_organization_response import BetaOrganizationServiceCreateOrganizationResponse -from zitadel_client.models.beta_organization_service_deactivate_organization_request import BetaOrganizationServiceDeactivateOrganizationRequest -from zitadel_client.models.beta_organization_service_deactivate_organization_response import BetaOrganizationServiceDeactivateOrganizationResponse -from zitadel_client.models.beta_organization_service_delete_organization_domain_request import BetaOrganizationServiceDeleteOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_delete_organization_domain_response import BetaOrganizationServiceDeleteOrganizationDomainResponse -from zitadel_client.models.beta_organization_service_delete_organization_metadata_request import BetaOrganizationServiceDeleteOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_delete_organization_metadata_response import BetaOrganizationServiceDeleteOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_delete_organization_request import BetaOrganizationServiceDeleteOrganizationRequest -from zitadel_client.models.beta_organization_service_delete_organization_response import BetaOrganizationServiceDeleteOrganizationResponse -from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_request import BetaOrganizationServiceGenerateOrganizationDomainValidationRequest -from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_response import BetaOrganizationServiceGenerateOrganizationDomainValidationResponse -from zitadel_client.models.beta_organization_service_list_organization_domains_request import BetaOrganizationServiceListOrganizationDomainsRequest -from zitadel_client.models.beta_organization_service_list_organization_domains_response import BetaOrganizationServiceListOrganizationDomainsResponse -from zitadel_client.models.beta_organization_service_list_organization_metadata_request import BetaOrganizationServiceListOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_list_organization_metadata_response import BetaOrganizationServiceListOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_list_organizations_request import BetaOrganizationServiceListOrganizationsRequest -from zitadel_client.models.beta_organization_service_list_organizations_response import BetaOrganizationServiceListOrganizationsResponse -from zitadel_client.models.beta_organization_service_set_organization_metadata_request import BetaOrganizationServiceSetOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_set_organization_metadata_response import BetaOrganizationServiceSetOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_update_organization_request import BetaOrganizationServiceUpdateOrganizationRequest -from zitadel_client.models.beta_organization_service_update_organization_response import BetaOrganizationServiceUpdateOrganizationResponse -from zitadel_client.models.beta_organization_service_verify_organization_domain_request import BetaOrganizationServiceVerifyOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_verify_organization_domain_response import BetaOrganizationServiceVerifyOrganizationDomainResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaOrganizationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def activate_organization( self, beta_organization_service_activate_organization_request: BetaOrganizationServiceActivateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceActivateOrganizationResponse: - """Activate Organization +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_organization_service_activate_organization_request import ( + BetaOrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_activate_organization_response import ( + BetaOrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_request import ( + BetaOrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_response import ( + BetaOrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_create_organization_request import ( + BetaOrganizationServiceCreateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_create_organization_response import ( + BetaOrganizationServiceCreateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_request import ( + BetaOrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_response import ( + BetaOrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_request import ( + BetaOrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_response import ( + BetaOrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_request import ( + BetaOrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_response import ( + BetaOrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_request import ( + BetaOrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_response import ( + BetaOrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_request import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_response import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_request import ( + BetaOrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_response import ( + BetaOrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_request import ( + BetaOrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_response import ( + BetaOrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_list_organizations_request import ( + BetaOrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.beta_organization_service_list_organizations_response import ( + BetaOrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_request import ( + BetaOrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_response import ( + BetaOrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_update_organization_request import ( + BetaOrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_update_organization_response import ( + BetaOrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_request import ( + BetaOrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_response import ( + BetaOrganizationServiceVerifyOrganizationDomainResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaOrganizationServiceApi(BaseApi): + """BetaOrganizationServiceApi provides methods for the BetaOrganizationService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def activate_organization( + self, + beta_organization_service_activate_organization_request: BetaOrganizationServiceActivateOrganizationRequest, + ) -> BetaOrganizationServiceActivateOrganizationResponse: + """Activate Organization Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + :param beta_organization_service_activate_organization_request: (required) + + :return: BetaOrganizationServiceActivateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_activate_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_activate_organization_request'" + ) - :param beta_organization_service_activate_organization_request: (required) - :type beta_organization_service_activate_organization_request: BetaOrganizationServiceActivateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_organization_serialize( - beta_organization_service_activate_organization_request=beta_organization_service_activate_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_organization_with_http_info( + beta_organization_service_activate_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceActivateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_organization_serialize( + async def activate_organization_with_http_info( self, - beta_organization_service_activate_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_activate_organization_request is not None: - _body_params = beta_organization_service_activate_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_activate_organization_request: BetaOrganizationServiceActivateOrganizationRequest, + ) -> "ApiResult[BetaOrganizationServiceActivateOrganizationResponse]": + """Activate Organization (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + :param beta_organization_service_activate_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_activate_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_activate_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/ActivateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/ActivateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_activate_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceActivateOrganizationResponse", + None, ) - - - - @validate_call - def add_organization_domain( self, beta_organization_service_add_organization_domain_request: BetaOrganizationServiceAddOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceAddOrganizationDomainResponse: + async def add_organization_domain( + self, + beta_organization_service_add_organization_domain_request: BetaOrganizationServiceAddOrganizationDomainRequest, + ) -> BetaOrganizationServiceAddOrganizationDomainResponse: """Add Organization Domain - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + :param beta_organization_service_add_organization_domain_request: (required) + + :return: BetaOrganizationServiceAddOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_add_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_add_organization_domain_request'" + ) - :param beta_organization_service_add_organization_domain_request: (required) - :type beta_organization_service_add_organization_domain_request: BetaOrganizationServiceAddOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_organization_domain_serialize( - beta_organization_service_add_organization_domain_request=beta_organization_service_add_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_organization_domain_with_http_info( + beta_organization_service_add_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceAddOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_organization_domain_serialize( + async def add_organization_domain_with_http_info( self, - beta_organization_service_add_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_add_organization_domain_request is not None: - _body_params = beta_organization_service_add_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_add_organization_domain_request: BetaOrganizationServiceAddOrganizationDomainRequest, + ) -> "ApiResult[BetaOrganizationServiceAddOrganizationDomainResponse]": + """Add Organization Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + :param beta_organization_service_add_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_add_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_add_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/AddOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/AddOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_add_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceAddOrganizationDomainResponse", + None, ) - - - - @validate_call - def create_organization( self, beta_organization_service_create_organization_request: BetaOrganizationServiceCreateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceCreateOrganizationResponse: + async def create_organization( + self, + beta_organization_service_create_organization_request: BetaOrganizationServiceCreateOrganizationRequest, + ) -> BetaOrganizationServiceCreateOrganizationResponse: """Create Organization - Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` Deprecated: Use [AddOrganization](/apis/resources/org_service_v2/organization-service-add-organization.api.mdx) instead to create an organization. + :param beta_organization_service_create_organization_request: (required) + + :return: BetaOrganizationServiceCreateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_create_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_create_organization_request'" + ) - :param beta_organization_service_create_organization_request: (required) - :type beta_organization_service_create_organization_request: BetaOrganizationServiceCreateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_organization_serialize( - beta_organization_service_create_organization_request=beta_organization_service_create_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_organization_with_http_info( + beta_organization_service_create_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceCreateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_organization_serialize( + async def create_organization_with_http_info( self, - beta_organization_service_create_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_create_organization_request is not None: - _body_params = beta_organization_service_create_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_create_organization_request: BetaOrganizationServiceCreateOrganizationRequest, + ) -> "ApiResult[BetaOrganizationServiceCreateOrganizationResponse]": + """Create Organization (with HTTP info) + Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` Deprecated: Use [AddOrganization](/apis/resources/org_service_v2/organization-service-add-organization.api.mdx) instead to create an organization. + :param beta_organization_service_create_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_create_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_create_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/CreateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/CreateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_create_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceCreateOrganizationResponse", + None, ) - - - - @validate_call - def deactivate_organization( self, beta_organization_service_deactivate_organization_request: BetaOrganizationServiceDeactivateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceDeactivateOrganizationResponse: + async def deactivate_organization( + self, + beta_organization_service_deactivate_organization_request: BetaOrganizationServiceDeactivateOrganizationRequest, + ) -> BetaOrganizationServiceDeactivateOrganizationResponse: """Deactivate Organization - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + :param beta_organization_service_deactivate_organization_request: (required) + + :return: BetaOrganizationServiceDeactivateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_deactivate_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_deactivate_organization_request'" + ) - :param beta_organization_service_deactivate_organization_request: (required) - :type beta_organization_service_deactivate_organization_request: BetaOrganizationServiceDeactivateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_organization_serialize( - beta_organization_service_deactivate_organization_request=beta_organization_service_deactivate_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_organization_with_http_info( + beta_organization_service_deactivate_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceDeactivateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_organization_serialize( + async def deactivate_organization_with_http_info( self, - beta_organization_service_deactivate_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_deactivate_organization_request is not None: - _body_params = beta_organization_service_deactivate_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_deactivate_organization_request: BetaOrganizationServiceDeactivateOrganizationRequest, + ) -> "ApiResult[BetaOrganizationServiceDeactivateOrganizationResponse]": + """Deactivate Organization (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + :param beta_organization_service_deactivate_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_deactivate_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_deactivate_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/DeactivateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/DeactivateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_deactivate_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceDeactivateOrganizationResponse", + None, ) - - - - @validate_call - def delete_organization( self, beta_organization_service_delete_organization_request: BetaOrganizationServiceDeleteOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceDeleteOrganizationResponse: + async def delete_organization( + self, + beta_organization_service_delete_organization_request: BetaOrganizationServiceDeleteOrganizationRequest, + ) -> BetaOrganizationServiceDeleteOrganizationResponse: """Delete Organization - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + :param beta_organization_service_delete_organization_request: (required) + + :return: BetaOrganizationServiceDeleteOrganizationResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_request'" + ) - :param beta_organization_service_delete_organization_request: (required) - :type beta_organization_service_delete_organization_request: BetaOrganizationServiceDeleteOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_serialize( - beta_organization_service_delete_organization_request=beta_organization_service_delete_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_with_http_info( + beta_organization_service_delete_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceDeleteOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_serialize( + async def delete_organization_with_http_info( self, - beta_organization_service_delete_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_delete_organization_request is not None: - _body_params = beta_organization_service_delete_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_delete_organization_request: BetaOrganizationServiceDeleteOrganizationRequest, + ) -> "ApiResult[BetaOrganizationServiceDeleteOrganizationResponse]": + """Delete Organization (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + :param beta_organization_service_delete_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/DeleteOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/DeleteOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_delete_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceDeleteOrganizationResponse", + None, ) - - - - @validate_call - def delete_organization_domain( self, beta_organization_service_delete_organization_domain_request: BetaOrganizationServiceDeleteOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceDeleteOrganizationDomainResponse: + async def delete_organization_domain( + self, + beta_organization_service_delete_organization_domain_request: BetaOrganizationServiceDeleteOrganizationDomainRequest, + ) -> BetaOrganizationServiceDeleteOrganizationDomainResponse: """Delete Organization Domain - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + :param beta_organization_service_delete_organization_domain_request: (required) + + :return: BetaOrganizationServiceDeleteOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_domain_request'" + ) - :param beta_organization_service_delete_organization_domain_request: (required) - :type beta_organization_service_delete_organization_domain_request: BetaOrganizationServiceDeleteOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_domain_serialize( - beta_organization_service_delete_organization_domain_request=beta_organization_service_delete_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_domain_with_http_info( + beta_organization_service_delete_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceDeleteOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_domain_serialize( + async def delete_organization_domain_with_http_info( self, - beta_organization_service_delete_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_delete_organization_domain_request is not None: - _body_params = beta_organization_service_delete_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_delete_organization_domain_request: BetaOrganizationServiceDeleteOrganizationDomainRequest, + ) -> "ApiResult[BetaOrganizationServiceDeleteOrganizationDomainResponse]": + """Delete Organization Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + :param beta_organization_service_delete_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/DeleteOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/DeleteOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_delete_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceDeleteOrganizationDomainResponse", + None, ) - - - - @validate_call - def delete_organization_metadata( self, beta_organization_service_delete_organization_metadata_request: BetaOrganizationServiceDeleteOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceDeleteOrganizationMetadataResponse: + async def delete_organization_metadata( + self, + beta_organization_service_delete_organization_metadata_request: BetaOrganizationServiceDeleteOrganizationMetadataRequest, + ) -> BetaOrganizationServiceDeleteOrganizationMetadataResponse: """Delete Organization Metadata - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + :param beta_organization_service_delete_organization_metadata_request: (required) + + :return: BetaOrganizationServiceDeleteOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_metadata_request'" + ) - :param beta_organization_service_delete_organization_metadata_request: (required) - :type beta_organization_service_delete_organization_metadata_request: BetaOrganizationServiceDeleteOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_metadata_serialize( - beta_organization_service_delete_organization_metadata_request=beta_organization_service_delete_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_metadata_with_http_info( + beta_organization_service_delete_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceDeleteOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_metadata_serialize( + async def delete_organization_metadata_with_http_info( self, - beta_organization_service_delete_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_delete_organization_metadata_request is not None: - _body_params = beta_organization_service_delete_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_delete_organization_metadata_request: BetaOrganizationServiceDeleteOrganizationMetadataRequest, + ) -> "ApiResult[BetaOrganizationServiceDeleteOrganizationMetadataResponse]": + """Delete Organization Metadata (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + :param beta_organization_service_delete_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_delete_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_delete_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/DeleteOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/DeleteOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_delete_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceDeleteOrganizationMetadataResponse", + None, ) - - - - @validate_call - def generate_organization_domain_validation( self, beta_organization_service_generate_organization_domain_validation_request: BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceGenerateOrganizationDomainValidationResponse: + async def generate_organization_domain_validation( + self, + beta_organization_service_generate_organization_domain_validation_request: BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, + ) -> BetaOrganizationServiceGenerateOrganizationDomainValidationResponse: """Generate Organization Domain Validation - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + :param beta_organization_service_generate_organization_domain_validation_request: (required) + + :return: BetaOrganizationServiceGenerateOrganizationDomainValidationResponse + :raises ApiException: if fails to make API call + """ + if ( + beta_organization_service_generate_organization_domain_validation_request + is None + ): + raise ValueError( + "Missing the required parameter 'beta_organization_service_generate_organization_domain_validation_request'" + ) - :param beta_organization_service_generate_organization_domain_validation_request: (required) - :type beta_organization_service_generate_organization_domain_validation_request: BetaOrganizationServiceGenerateOrganizationDomainValidationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._generate_organization_domain_validation_serialize( - beta_organization_service_generate_organization_domain_validation_request=beta_organization_service_generate_organization_domain_validation_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.generate_organization_domain_validation_with_http_info( + beta_organization_service_generate_organization_domain_validation_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceGenerateOrganizationDomainValidationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _generate_organization_domain_validation_serialize( + async def generate_organization_domain_validation_with_http_info( self, - beta_organization_service_generate_organization_domain_validation_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_generate_organization_domain_validation_request is not None: - _body_params = beta_organization_service_generate_organization_domain_validation_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_generate_organization_domain_validation_request: BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, + ) -> ( + "ApiResult[BetaOrganizationServiceGenerateOrganizationDomainValidationResponse]" + ): + """Generate Organization Domain Validation (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + :param beta_organization_service_generate_organization_domain_validation_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if ( + beta_organization_service_generate_organization_domain_validation_request + is None + ): + raise ValueError( + "Missing the required parameter 'beta_organization_service_generate_organization_domain_validation_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/GenerateOrganizationDomainValidation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/GenerateOrganizationDomainValidation" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_generate_organization_domain_validation_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceGenerateOrganizationDomainValidationResponse", + None, ) - - - - @validate_call - def list_organization_domains( self, beta_organization_service_list_organization_domains_request: BetaOrganizationServiceListOrganizationDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceListOrganizationDomainsResponse: + async def list_organization_domains( + self, + beta_organization_service_list_organization_domains_request: BetaOrganizationServiceListOrganizationDomainsRequest, + ) -> BetaOrganizationServiceListOrganizationDomainsResponse: """List Organization Domains - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + :param beta_organization_service_list_organization_domains_request: (required) + + :return: BetaOrganizationServiceListOrganizationDomainsResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organization_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organization_domains_request'" + ) - :param beta_organization_service_list_organization_domains_request: (required) - :type beta_organization_service_list_organization_domains_request: BetaOrganizationServiceListOrganizationDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organization_domains_serialize( - beta_organization_service_list_organization_domains_request=beta_organization_service_list_organization_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organization_domains_with_http_info( + beta_organization_service_list_organization_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceListOrganizationDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organization_domains_serialize( + async def list_organization_domains_with_http_info( self, - beta_organization_service_list_organization_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_list_organization_domains_request is not None: - _body_params = beta_organization_service_list_organization_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_list_organization_domains_request: BetaOrganizationServiceListOrganizationDomainsRequest, + ) -> "ApiResult[BetaOrganizationServiceListOrganizationDomainsResponse]": + """List Organization Domains (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + :param beta_organization_service_list_organization_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organization_domains_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organization_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/ListOrganizationDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/ListOrganizationDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_list_organization_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceListOrganizationDomainsResponse", + None, ) - - - - @validate_call - def list_organization_metadata( self, beta_organization_service_list_organization_metadata_request: BetaOrganizationServiceListOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceListOrganizationMetadataResponse: + async def list_organization_metadata( + self, + beta_organization_service_list_organization_metadata_request: BetaOrganizationServiceListOrganizationMetadataRequest, + ) -> BetaOrganizationServiceListOrganizationMetadataResponse: """List Organization Metadata - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. List metadata of an organization filtered by query. Required permission: - `org.read` + :param beta_organization_service_list_organization_metadata_request: (required) + + :return: BetaOrganizationServiceListOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organization_metadata_request'" + ) - :param beta_organization_service_list_organization_metadata_request: (required) - :type beta_organization_service_list_organization_metadata_request: BetaOrganizationServiceListOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organization_metadata_serialize( - beta_organization_service_list_organization_metadata_request=beta_organization_service_list_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organization_metadata_with_http_info( + beta_organization_service_list_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceListOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organization_metadata_serialize( + async def list_organization_metadata_with_http_info( self, - beta_organization_service_list_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_list_organization_metadata_request is not None: - _body_params = beta_organization_service_list_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_list_organization_metadata_request: BetaOrganizationServiceListOrganizationMetadataRequest, + ) -> "ApiResult[BetaOrganizationServiceListOrganizationMetadataResponse]": + """List Organization Metadata (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. List metadata of an organization filtered by query. Required permission: - `org.read` + :param beta_organization_service_list_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/ListOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/ListOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_list_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceListOrganizationMetadataResponse", + None, ) - - - - @validate_call - def list_organizations( self, beta_organization_service_list_organizations_request: BetaOrganizationServiceListOrganizationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceListOrganizationsResponse: + async def list_organizations( + self, + beta_organization_service_list_organizations_request: BetaOrganizationServiceListOrganizationsRequest, + ) -> BetaOrganizationServiceListOrganizationsResponse: """List Organizations - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition. Required permission: - `org.read` Deprecated: Use [ListOrganizations](/apis/resources/org_service_v2/organization-service-list-organizations.api.mdx) instead to list organizations. + :param beta_organization_service_list_organizations_request: (required) + + :return: BetaOrganizationServiceListOrganizationsResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organizations_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organizations_request'" + ) - :param beta_organization_service_list_organizations_request: (required) - :type beta_organization_service_list_organizations_request: BetaOrganizationServiceListOrganizationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organizations_serialize( - beta_organization_service_list_organizations_request=beta_organization_service_list_organizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organizations_with_http_info( + beta_organization_service_list_organizations_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceListOrganizationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organizations_serialize( + async def list_organizations_with_http_info( self, - beta_organization_service_list_organizations_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_list_organizations_request is not None: - _body_params = beta_organization_service_list_organizations_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_list_organizations_request: BetaOrganizationServiceListOrganizationsRequest, + ) -> "ApiResult[BetaOrganizationServiceListOrganizationsResponse]": + """List Organizations (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of organizations that match the requesting filters. All filters are applied with an AND condition. Required permission: - `org.read` Deprecated: Use [ListOrganizations](/apis/resources/org_service_v2/organization-service-list-organizations.api.mdx) instead to list organizations. + :param beta_organization_service_list_organizations_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_list_organizations_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_list_organizations_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/ListOrganizations', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/ListOrganizations" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_list_organizations_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceListOrganizationsResponse", + None, ) - - - - @validate_call - def set_organization_metadata( self, beta_organization_service_set_organization_metadata_request: BetaOrganizationServiceSetOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceSetOrganizationMetadataResponse: + async def set_organization_metadata( + self, + beta_organization_service_set_organization_metadata_request: BetaOrganizationServiceSetOrganizationMetadataRequest, + ) -> BetaOrganizationServiceSetOrganizationMetadataResponse: """Set Organization Metadata - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + :param beta_organization_service_set_organization_metadata_request: (required) + + :return: BetaOrganizationServiceSetOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_set_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_set_organization_metadata_request'" + ) - :param beta_organization_service_set_organization_metadata_request: (required) - :type beta_organization_service_set_organization_metadata_request: BetaOrganizationServiceSetOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_organization_metadata_serialize( - beta_organization_service_set_organization_metadata_request=beta_organization_service_set_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_organization_metadata_with_http_info( + beta_organization_service_set_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceSetOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_organization_metadata_serialize( + async def set_organization_metadata_with_http_info( self, - beta_organization_service_set_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_set_organization_metadata_request is not None: - _body_params = beta_organization_service_set_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_set_organization_metadata_request: BetaOrganizationServiceSetOrganizationMetadataRequest, + ) -> "ApiResult[BetaOrganizationServiceSetOrganizationMetadataResponse]": + """Set Organization Metadata (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + :param beta_organization_service_set_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_set_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_set_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/SetOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/SetOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_set_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceSetOrganizationMetadataResponse", + None, ) - - - - @validate_call - def update_organization( self, beta_organization_service_update_organization_request: BetaOrganizationServiceUpdateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceUpdateOrganizationResponse: + async def update_organization( + self, + beta_organization_service_update_organization_request: BetaOrganizationServiceUpdateOrganizationRequest, + ) -> BetaOrganizationServiceUpdateOrganizationResponse: """Update Organization - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Change the name of the organization. Required permission: - `org.write` + :param beta_organization_service_update_organization_request: (required) + + :return: BetaOrganizationServiceUpdateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_update_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_update_organization_request'" + ) - :param beta_organization_service_update_organization_request: (required) - :type beta_organization_service_update_organization_request: BetaOrganizationServiceUpdateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_organization_serialize( - beta_organization_service_update_organization_request=beta_organization_service_update_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_organization_with_http_info( + beta_organization_service_update_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceUpdateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_organization_serialize( + async def update_organization_with_http_info( self, - beta_organization_service_update_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_update_organization_request is not None: - _body_params = beta_organization_service_update_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_update_organization_request: BetaOrganizationServiceUpdateOrganizationRequest, + ) -> "ApiResult[BetaOrganizationServiceUpdateOrganizationResponse]": + """Update Organization (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Change the name of the organization. Required permission: - `org.write` + :param beta_organization_service_update_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_update_organization_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_update_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/UpdateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/UpdateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_update_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceUpdateOrganizationResponse", + None, ) - - - - @validate_call - def verify_organization_domain( self, beta_organization_service_verify_organization_domain_request: BetaOrganizationServiceVerifyOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaOrganizationServiceVerifyOrganizationDomainResponse: + async def verify_organization_domain( + self, + beta_organization_service_verify_organization_domain_request: BetaOrganizationServiceVerifyOrganizationDomainRequest, + ) -> BetaOrganizationServiceVerifyOrganizationDomainResponse: """Verify Organization Domain - Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + :param beta_organization_service_verify_organization_domain_request: (required) + + :return: BetaOrganizationServiceVerifyOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if beta_organization_service_verify_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_verify_organization_domain_request'" + ) - :param beta_organization_service_verify_organization_domain_request: (required) - :type beta_organization_service_verify_organization_domain_request: BetaOrganizationServiceVerifyOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_organization_domain_serialize( - beta_organization_service_verify_organization_domain_request=beta_organization_service_verify_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_organization_domain_with_http_info( + beta_organization_service_verify_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaOrganizationServiceVerifyOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_organization_domain_serialize( + async def verify_organization_domain_with_http_info( self, - beta_organization_service_verify_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_organization_service_verify_organization_domain_request is not None: - _body_params = beta_organization_service_verify_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_organization_service_verify_organization_domain_request: BetaOrganizationServiceVerifyOrganizationDomainRequest, + ) -> "ApiResult[BetaOrganizationServiceVerifyOrganizationDomainResponse]": + """Verify Organization Domain (with HTTP info) + Deprecated: please move to the corresponding endpoint under organization service v2. This endpoint will be removed with the next major version of ZITADEL. Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + :param beta_organization_service_verify_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_organization_service_verify_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'beta_organization_service_verify_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2beta.OrganizationService/VerifyOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2beta.OrganizationService/VerifyOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_organization_service_verify_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaOrganizationServiceVerifyOrganizationDomainResponse", + None, ) - - diff --git a/zitadel_client/api/beta_project_service_api.py b/zitadel_client/api/beta_project_service_api.py index e98cb9d7..4aeeb7aa 100644 --- a/zitadel_client/api/beta_project_service_api.py +++ b/zitadel_client/api/beta_project_service_api.py @@ -1,2245 +1,1254 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_project_service_activate_project_grant_request import BetaProjectServiceActivateProjectGrantRequest -from zitadel_client.models.beta_project_service_activate_project_grant_response import BetaProjectServiceActivateProjectGrantResponse -from zitadel_client.models.beta_project_service_activate_project_request import BetaProjectServiceActivateProjectRequest -from zitadel_client.models.beta_project_service_activate_project_response import BetaProjectServiceActivateProjectResponse -from zitadel_client.models.beta_project_service_add_project_role_request import BetaProjectServiceAddProjectRoleRequest -from zitadel_client.models.beta_project_service_add_project_role_response import BetaProjectServiceAddProjectRoleResponse -from zitadel_client.models.beta_project_service_create_project_grant_request import BetaProjectServiceCreateProjectGrantRequest -from zitadel_client.models.beta_project_service_create_project_grant_response import BetaProjectServiceCreateProjectGrantResponse -from zitadel_client.models.beta_project_service_create_project_request import BetaProjectServiceCreateProjectRequest -from zitadel_client.models.beta_project_service_create_project_response import BetaProjectServiceCreateProjectResponse -from zitadel_client.models.beta_project_service_deactivate_project_grant_request import BetaProjectServiceDeactivateProjectGrantRequest -from zitadel_client.models.beta_project_service_deactivate_project_grant_response import BetaProjectServiceDeactivateProjectGrantResponse -from zitadel_client.models.beta_project_service_deactivate_project_request import BetaProjectServiceDeactivateProjectRequest -from zitadel_client.models.beta_project_service_deactivate_project_response import BetaProjectServiceDeactivateProjectResponse -from zitadel_client.models.beta_project_service_delete_project_grant_request import BetaProjectServiceDeleteProjectGrantRequest -from zitadel_client.models.beta_project_service_delete_project_grant_response import BetaProjectServiceDeleteProjectGrantResponse -from zitadel_client.models.beta_project_service_delete_project_request import BetaProjectServiceDeleteProjectRequest -from zitadel_client.models.beta_project_service_delete_project_response import BetaProjectServiceDeleteProjectResponse -from zitadel_client.models.beta_project_service_get_project_request import BetaProjectServiceGetProjectRequest -from zitadel_client.models.beta_project_service_get_project_response import BetaProjectServiceGetProjectResponse -from zitadel_client.models.beta_project_service_list_project_grants_request import BetaProjectServiceListProjectGrantsRequest -from zitadel_client.models.beta_project_service_list_project_grants_response import BetaProjectServiceListProjectGrantsResponse -from zitadel_client.models.beta_project_service_list_project_roles_request import BetaProjectServiceListProjectRolesRequest -from zitadel_client.models.beta_project_service_list_project_roles_response import BetaProjectServiceListProjectRolesResponse -from zitadel_client.models.beta_project_service_list_projects_request import BetaProjectServiceListProjectsRequest -from zitadel_client.models.beta_project_service_list_projects_response import BetaProjectServiceListProjectsResponse -from zitadel_client.models.beta_project_service_remove_project_role_request import BetaProjectServiceRemoveProjectRoleRequest -from zitadel_client.models.beta_project_service_remove_project_role_response import BetaProjectServiceRemoveProjectRoleResponse -from zitadel_client.models.beta_project_service_update_project_grant_request import BetaProjectServiceUpdateProjectGrantRequest -from zitadel_client.models.beta_project_service_update_project_grant_response import BetaProjectServiceUpdateProjectGrantResponse -from zitadel_client.models.beta_project_service_update_project_request import BetaProjectServiceUpdateProjectRequest -from zitadel_client.models.beta_project_service_update_project_response import BetaProjectServiceUpdateProjectResponse -from zitadel_client.models.beta_project_service_update_project_role_request import BetaProjectServiceUpdateProjectRoleRequest -from zitadel_client.models.beta_project_service_update_project_role_response import BetaProjectServiceUpdateProjectRoleResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaProjectServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def activate_project( self, beta_project_service_activate_project_request: BetaProjectServiceActivateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceActivateProjectResponse: - """Activate Project +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_project_service_activate_project_grant_request import ( + BetaProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_activate_project_grant_response import ( + BetaProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_activate_project_request import ( + BetaProjectServiceActivateProjectRequest, +) +from zitadel_client.models.beta_project_service_activate_project_response import ( + BetaProjectServiceActivateProjectResponse, +) +from zitadel_client.models.beta_project_service_add_project_role_request import ( + BetaProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_add_project_role_response import ( + BetaProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_create_project_grant_request import ( + BetaProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_create_project_grant_response import ( + BetaProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_create_project_request import ( + BetaProjectServiceCreateProjectRequest, +) +from zitadel_client.models.beta_project_service_create_project_response import ( + BetaProjectServiceCreateProjectResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_request import ( + BetaProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_response import ( + BetaProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_request import ( + BetaProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_response import ( + BetaProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.beta_project_service_delete_project_grant_request import ( + BetaProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_delete_project_grant_response import ( + BetaProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_delete_project_request import ( + BetaProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.beta_project_service_delete_project_response import ( + BetaProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.beta_project_service_get_project_request import ( + BetaProjectServiceGetProjectRequest, +) +from zitadel_client.models.beta_project_service_get_project_response import ( + BetaProjectServiceGetProjectResponse, +) +from zitadel_client.models.beta_project_service_list_project_grants_request import ( + BetaProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.beta_project_service_list_project_grants_response import ( + BetaProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.beta_project_service_list_project_roles_request import ( + BetaProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.beta_project_service_list_project_roles_response import ( + BetaProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.beta_project_service_list_projects_request import ( + BetaProjectServiceListProjectsRequest, +) +from zitadel_client.models.beta_project_service_list_projects_response import ( + BetaProjectServiceListProjectsResponse, +) +from zitadel_client.models.beta_project_service_remove_project_role_request import ( + BetaProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_remove_project_role_response import ( + BetaProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_update_project_grant_request import ( + BetaProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_update_project_grant_response import ( + BetaProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_update_project_request import ( + BetaProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.beta_project_service_update_project_response import ( + BetaProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.beta_project_service_update_project_role_request import ( + BetaProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_update_project_role_response import ( + BetaProjectServiceUpdateProjectRoleResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaProjectServiceApi(BaseApi): + """BetaProjectServiceApi provides methods for the BetaProjectService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def activate_project( + self, + beta_project_service_activate_project_request: BetaProjectServiceActivateProjectRequest, + ) -> BetaProjectServiceActivateProjectResponse: + """Activate Project Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + :param beta_project_service_activate_project_request: (required) + + :return: BetaProjectServiceActivateProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_activate_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_activate_project_request'" + ) - :param beta_project_service_activate_project_request: (required) - :type beta_project_service_activate_project_request: BetaProjectServiceActivateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_project_serialize( - beta_project_service_activate_project_request=beta_project_service_activate_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_project_with_http_info( + beta_project_service_activate_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceActivateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_project_serialize( + async def activate_project_with_http_info( self, - beta_project_service_activate_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_activate_project_request is not None: - _body_params = beta_project_service_activate_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_activate_project_request: BetaProjectServiceActivateProjectRequest, + ) -> "ApiResult[BetaProjectServiceActivateProjectResponse]": + """Activate Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + :param beta_project_service_activate_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_activate_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_activate_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/ActivateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/ActivateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_activate_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceActivateProjectResponse", + None, ) - - - - @validate_call - def activate_project_grant( self, beta_project_service_activate_project_grant_request: BetaProjectServiceActivateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceActivateProjectGrantResponse: + async def activate_project_grant( + self, + beta_project_service_activate_project_grant_request: BetaProjectServiceActivateProjectGrantRequest, + ) -> BetaProjectServiceActivateProjectGrantResponse: """Activate Project Grant - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to activated. Required permission: - `project.grant.write` + :param beta_project_service_activate_project_grant_request: (required) + + :return: BetaProjectServiceActivateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_activate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_activate_project_grant_request'" + ) - :param beta_project_service_activate_project_grant_request: (required) - :type beta_project_service_activate_project_grant_request: BetaProjectServiceActivateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_project_grant_serialize( - beta_project_service_activate_project_grant_request=beta_project_service_activate_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_project_grant_with_http_info( + beta_project_service_activate_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceActivateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_project_grant_serialize( + async def activate_project_grant_with_http_info( self, - beta_project_service_activate_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_activate_project_grant_request is not None: - _body_params = beta_project_service_activate_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_activate_project_grant_request: BetaProjectServiceActivateProjectGrantRequest, + ) -> "ApiResult[BetaProjectServiceActivateProjectGrantResponse]": + """Activate Project Grant (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to activated. Required permission: - `project.grant.write` + :param beta_project_service_activate_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_activate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_activate_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/ActivateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/ActivateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_activate_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceActivateProjectGrantResponse", + None, ) - - - - @validate_call - def add_project_role( self, beta_project_service_add_project_role_request: BetaProjectServiceAddProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceAddProjectRoleResponse: + async def add_project_role( + self, + beta_project_service_add_project_role_request: BetaProjectServiceAddProjectRoleRequest, + ) -> BetaProjectServiceAddProjectRoleResponse: """Add Project Role - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + :param beta_project_service_add_project_role_request: (required) + + :return: BetaProjectServiceAddProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_add_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_add_project_role_request'" + ) - :param beta_project_service_add_project_role_request: (required) - :type beta_project_service_add_project_role_request: BetaProjectServiceAddProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_project_role_serialize( - beta_project_service_add_project_role_request=beta_project_service_add_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_project_role_with_http_info( + beta_project_service_add_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceAddProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_project_role_serialize( + async def add_project_role_with_http_info( self, - beta_project_service_add_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_add_project_role_request is not None: - _body_params = beta_project_service_add_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_add_project_role_request: BetaProjectServiceAddProjectRoleRequest, + ) -> "ApiResult[BetaProjectServiceAddProjectRoleResponse]": + """Add Project Role (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + :param beta_project_service_add_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_add_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_add_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/AddProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/AddProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_add_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceAddProjectRoleResponse", + None, ) - - - - @validate_call - def create_project( self, beta_project_service_create_project_request: BetaProjectServiceCreateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceCreateProjectResponse: + async def create_project( + self, + beta_project_service_create_project_request: BetaProjectServiceCreateProjectRequest, + ) -> BetaProjectServiceCreateProjectResponse: """Create Project - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new Project. Required permission: - `project.create` + :param beta_project_service_create_project_request: (required) + + :return: BetaProjectServiceCreateProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_create_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_create_project_request'" + ) - :param beta_project_service_create_project_request: (required) - :type beta_project_service_create_project_request: BetaProjectServiceCreateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_project_serialize( - beta_project_service_create_project_request=beta_project_service_create_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_project_with_http_info( + beta_project_service_create_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceCreateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_project_serialize( + async def create_project_with_http_info( self, - beta_project_service_create_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_create_project_request is not None: - _body_params = beta_project_service_create_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_create_project_request: BetaProjectServiceCreateProjectRequest, + ) -> "ApiResult[BetaProjectServiceCreateProjectResponse]": + """Create Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Create a new Project. Required permission: - `project.create` + :param beta_project_service_create_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_create_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_create_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/CreateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/CreateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_create_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceCreateProjectResponse", + None, ) - - - - @validate_call - def create_project_grant( self, beta_project_service_create_project_grant_request: BetaProjectServiceCreateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceCreateProjectGrantResponse: + async def create_project_grant( + self, + beta_project_service_create_project_grant_request: BetaProjectServiceCreateProjectGrantRequest, + ) -> BetaProjectServiceCreateProjectGrantResponse: """Create Project Grant - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + :param beta_project_service_create_project_grant_request: (required) + + :return: BetaProjectServiceCreateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_create_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_create_project_grant_request'" + ) - :param beta_project_service_create_project_grant_request: (required) - :type beta_project_service_create_project_grant_request: BetaProjectServiceCreateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_project_grant_serialize( - beta_project_service_create_project_grant_request=beta_project_service_create_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_project_grant_with_http_info( + beta_project_service_create_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceCreateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_project_grant_serialize( + async def create_project_grant_with_http_info( self, - beta_project_service_create_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_create_project_grant_request is not None: - _body_params = beta_project_service_create_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_create_project_grant_request: BetaProjectServiceCreateProjectGrantRequest, + ) -> "ApiResult[BetaProjectServiceCreateProjectGrantResponse]": + """Create Project Grant (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + :param beta_project_service_create_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_create_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_create_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/CreateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/CreateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_create_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceCreateProjectGrantResponse", + None, ) - - - - @validate_call - def deactivate_project( self, beta_project_service_deactivate_project_request: BetaProjectServiceDeactivateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceDeactivateProjectResponse: + async def deactivate_project( + self, + beta_project_service_deactivate_project_request: BetaProjectServiceDeactivateProjectRequest, + ) -> BetaProjectServiceDeactivateProjectResponse: """Deactivate Project - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + :param beta_project_service_deactivate_project_request: (required) + + :return: BetaProjectServiceDeactivateProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_deactivate_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_deactivate_project_request'" + ) - :param beta_project_service_deactivate_project_request: (required) - :type beta_project_service_deactivate_project_request: BetaProjectServiceDeactivateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_project_serialize( - beta_project_service_deactivate_project_request=beta_project_service_deactivate_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_project_with_http_info( + beta_project_service_deactivate_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceDeactivateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_project_serialize( + async def deactivate_project_with_http_info( self, - beta_project_service_deactivate_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_deactivate_project_request is not None: - _body_params = beta_project_service_deactivate_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_deactivate_project_request: BetaProjectServiceDeactivateProjectRequest, + ) -> "ApiResult[BetaProjectServiceDeactivateProjectResponse]": + """Deactivate Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + :param beta_project_service_deactivate_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_deactivate_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_deactivate_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/DeactivateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/DeactivateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_deactivate_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceDeactivateProjectResponse", + None, ) - - - - @validate_call - def deactivate_project_grant( self, beta_project_service_deactivate_project_grant_request: BetaProjectServiceDeactivateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceDeactivateProjectGrantResponse: + async def deactivate_project_grant( + self, + beta_project_service_deactivate_project_grant_request: BetaProjectServiceDeactivateProjectGrantRequest, + ) -> BetaProjectServiceDeactivateProjectGrantResponse: """Deactivate Project Grant - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + :param beta_project_service_deactivate_project_grant_request: (required) + + :return: BetaProjectServiceDeactivateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_deactivate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_deactivate_project_grant_request'" + ) - :param beta_project_service_deactivate_project_grant_request: (required) - :type beta_project_service_deactivate_project_grant_request: BetaProjectServiceDeactivateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_project_grant_serialize( - beta_project_service_deactivate_project_grant_request=beta_project_service_deactivate_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_project_grant_with_http_info( + beta_project_service_deactivate_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceDeactivateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_project_grant_serialize( + async def deactivate_project_grant_with_http_info( self, - beta_project_service_deactivate_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_deactivate_project_grant_request is not None: - _body_params = beta_project_service_deactivate_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_deactivate_project_grant_request: BetaProjectServiceDeactivateProjectGrantRequest, + ) -> "ApiResult[BetaProjectServiceDeactivateProjectGrantResponse]": + """Deactivate Project Grant (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + :param beta_project_service_deactivate_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_deactivate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_deactivate_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/DeactivateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/DeactivateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_deactivate_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceDeactivateProjectGrantResponse", + None, ) - - - - @validate_call - def delete_project( self, beta_project_service_delete_project_request: BetaProjectServiceDeleteProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceDeleteProjectResponse: + async def delete_project( + self, + beta_project_service_delete_project_request: BetaProjectServiceDeleteProjectRequest, + ) -> BetaProjectServiceDeleteProjectResponse: """Delete Project - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + :param beta_project_service_delete_project_request: (required) + + :return: BetaProjectServiceDeleteProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_delete_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_delete_project_request'" + ) - :param beta_project_service_delete_project_request: (required) - :type beta_project_service_delete_project_request: BetaProjectServiceDeleteProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_project_serialize( - beta_project_service_delete_project_request=beta_project_service_delete_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_project_with_http_info( + beta_project_service_delete_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceDeleteProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_project_serialize( + async def delete_project_with_http_info( self, - beta_project_service_delete_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_delete_project_request is not None: - _body_params = beta_project_service_delete_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_delete_project_request: BetaProjectServiceDeleteProjectRequest, + ) -> "ApiResult[BetaProjectServiceDeleteProjectResponse]": + """Delete Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + :param beta_project_service_delete_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_delete_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_delete_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/DeleteProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/DeleteProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_delete_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceDeleteProjectResponse", + None, ) - - - - @validate_call - def delete_project_grant( self, beta_project_service_delete_project_grant_request: BetaProjectServiceDeleteProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceDeleteProjectGrantResponse: + async def delete_project_grant( + self, + beta_project_service_delete_project_grant_request: BetaProjectServiceDeleteProjectGrantRequest, + ) -> BetaProjectServiceDeleteProjectGrantResponse: """Delete Project Grant - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + :param beta_project_service_delete_project_grant_request: (required) + + :return: BetaProjectServiceDeleteProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_delete_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_delete_project_grant_request'" + ) - :param beta_project_service_delete_project_grant_request: (required) - :type beta_project_service_delete_project_grant_request: BetaProjectServiceDeleteProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_project_grant_serialize( - beta_project_service_delete_project_grant_request=beta_project_service_delete_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_project_grant_with_http_info( + beta_project_service_delete_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceDeleteProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_project_grant_serialize( + async def delete_project_grant_with_http_info( self, - beta_project_service_delete_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_delete_project_grant_request is not None: - _body_params = beta_project_service_delete_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_delete_project_grant_request: BetaProjectServiceDeleteProjectGrantRequest, + ) -> "ApiResult[BetaProjectServiceDeleteProjectGrantResponse]": + """Delete Project Grant (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + :param beta_project_service_delete_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_delete_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_delete_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/DeleteProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/DeleteProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_delete_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceDeleteProjectGrantResponse", + None, ) - - - - @validate_call - def get_project( self, beta_project_service_get_project_request: BetaProjectServiceGetProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceGetProjectResponse: + async def get_project( + self, + beta_project_service_get_project_request: BetaProjectServiceGetProjectRequest, + ) -> BetaProjectServiceGetProjectResponse: """Get Project - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the project identified by the requested ID. Required permission: - `project.read` + :param beta_project_service_get_project_request: (required) + + :return: BetaProjectServiceGetProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_get_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_get_project_request'" + ) - :param beta_project_service_get_project_request: (required) - :type beta_project_service_get_project_request: BetaProjectServiceGetProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_project_serialize( - beta_project_service_get_project_request=beta_project_service_get_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_project_with_http_info( + beta_project_service_get_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceGetProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_project_serialize( + async def get_project_with_http_info( self, - beta_project_service_get_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_get_project_request is not None: - _body_params = beta_project_service_get_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_get_project_request: BetaProjectServiceGetProjectRequest, + ) -> "ApiResult[BetaProjectServiceGetProjectResponse]": + """Get Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns the project identified by the requested ID. Required permission: - `project.read` + :param beta_project_service_get_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_get_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_get_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/GetProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/GetProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_get_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceGetProjectResponse", + None, ) - - - - @validate_call - def list_project_grants( self, beta_project_service_list_project_grants_request: BetaProjectServiceListProjectGrantsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceListProjectGrantsResponse: + async def list_project_grants( + self, + beta_project_service_list_project_grants_request: BetaProjectServiceListProjectGrantsRequest, + ) -> BetaProjectServiceListProjectGrantsResponse: """List Project Grants - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.write` + :param beta_project_service_list_project_grants_request: (required) + + :return: BetaProjectServiceListProjectGrantsResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_project_grants_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_project_grants_request'" + ) - :param beta_project_service_list_project_grants_request: (required) - :type beta_project_service_list_project_grants_request: BetaProjectServiceListProjectGrantsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_project_grants_serialize( - beta_project_service_list_project_grants_request=beta_project_service_list_project_grants_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_project_grants_with_http_info( + beta_project_service_list_project_grants_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceListProjectGrantsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_project_grants_serialize( + async def list_project_grants_with_http_info( self, - beta_project_service_list_project_grants_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_list_project_grants_request is not None: - _body_params = beta_project_service_list_project_grants_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_list_project_grants_request: BetaProjectServiceListProjectGrantsRequest, + ) -> "ApiResult[BetaProjectServiceListProjectGrantsResponse]": + """List Project Grants (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.write` + :param beta_project_service_list_project_grants_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_project_grants_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_project_grants_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/ListProjectGrants', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/ListProjectGrants" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_list_project_grants_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceListProjectGrantsResponse", + None, ) - - - - @validate_call - def list_project_roles( self, beta_project_service_list_project_roles_request: BetaProjectServiceListProjectRolesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceListProjectRolesResponse: + async def list_project_roles( + self, + beta_project_service_list_project_roles_request: BetaProjectServiceListProjectRolesRequest, + ) -> BetaProjectServiceListProjectRolesResponse: """List Project Roles - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns all roles of a project matching the search query. Required permission: - `project.role.read` + :param beta_project_service_list_project_roles_request: (required) + + :return: BetaProjectServiceListProjectRolesResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_project_roles_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_project_roles_request'" + ) - :param beta_project_service_list_project_roles_request: (required) - :type beta_project_service_list_project_roles_request: BetaProjectServiceListProjectRolesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_project_roles_serialize( - beta_project_service_list_project_roles_request=beta_project_service_list_project_roles_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_project_roles_with_http_info( + beta_project_service_list_project_roles_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceListProjectRolesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_project_roles_serialize( + async def list_project_roles_with_http_info( self, - beta_project_service_list_project_roles_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_list_project_roles_request is not None: - _body_params = beta_project_service_list_project_roles_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_list_project_roles_request: BetaProjectServiceListProjectRolesRequest, + ) -> "ApiResult[BetaProjectServiceListProjectRolesResponse]": + """List Project Roles (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Returns all roles of a project matching the search query. Required permission: - `project.role.read` + :param beta_project_service_list_project_roles_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_project_roles_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_project_roles_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/ListProjectRoles', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/ListProjectRoles" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_list_project_roles_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceListProjectRolesResponse", + None, ) - - - - @validate_call - def list_projects( self, beta_project_service_list_projects_request: BetaProjectServiceListProjectsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceListProjectsResponse: + async def list_projects( + self, + beta_project_service_list_projects_request: BetaProjectServiceListProjectsRequest, + ) -> BetaProjectServiceListProjectsResponse: """List Projects - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + :param beta_project_service_list_projects_request: (required) + + :return: BetaProjectServiceListProjectsResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_projects_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_projects_request'" + ) - :param beta_project_service_list_projects_request: (required) - :type beta_project_service_list_projects_request: BetaProjectServiceListProjectsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_projects_serialize( - beta_project_service_list_projects_request=beta_project_service_list_projects_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_projects_with_http_info( + beta_project_service_list_projects_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceListProjectsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_projects_serialize( + async def list_projects_with_http_info( self, - beta_project_service_list_projects_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_list_projects_request is not None: - _body_params = beta_project_service_list_projects_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_list_projects_request: BetaProjectServiceListProjectsRequest, + ) -> "ApiResult[BetaProjectServiceListProjectsResponse]": + """List Projects (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + :param beta_project_service_list_projects_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_list_projects_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_list_projects_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/ListProjects', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/ListProjects" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_list_projects_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceListProjectsResponse", + None, ) - - - - @validate_call - def remove_project_role( self, beta_project_service_remove_project_role_request: BetaProjectServiceRemoveProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceRemoveProjectRoleResponse: + async def remove_project_role( + self, + beta_project_service_remove_project_role_request: BetaProjectServiceRemoveProjectRoleRequest, + ) -> BetaProjectServiceRemoveProjectRoleResponse: """Remove Project Role - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + :param beta_project_service_remove_project_role_request: (required) + + :return: BetaProjectServiceRemoveProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_remove_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_remove_project_role_request'" + ) - :param beta_project_service_remove_project_role_request: (required) - :type beta_project_service_remove_project_role_request: BetaProjectServiceRemoveProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_project_role_serialize( - beta_project_service_remove_project_role_request=beta_project_service_remove_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_project_role_with_http_info( + beta_project_service_remove_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceRemoveProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_project_role_serialize( + async def remove_project_role_with_http_info( self, - beta_project_service_remove_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_remove_project_role_request is not None: - _body_params = beta_project_service_remove_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_remove_project_role_request: BetaProjectServiceRemoveProjectRoleRequest, + ) -> "ApiResult[BetaProjectServiceRemoveProjectRoleResponse]": + """Remove Project Role (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + :param beta_project_service_remove_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_remove_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_remove_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/RemoveProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/RemoveProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_remove_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceRemoveProjectRoleResponse", + None, ) - - - - @validate_call - def update_project( self, beta_project_service_update_project_request: BetaProjectServiceUpdateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceUpdateProjectResponse: + async def update_project( + self, + beta_project_service_update_project_request: BetaProjectServiceUpdateProjectRequest, + ) -> BetaProjectServiceUpdateProjectResponse: """Update Project - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing project. Required permission: - `project.write` + :param beta_project_service_update_project_request: (required) + + :return: BetaProjectServiceUpdateProjectResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_request'" + ) - :param beta_project_service_update_project_request: (required) - :type beta_project_service_update_project_request: BetaProjectServiceUpdateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_serialize( - beta_project_service_update_project_request=beta_project_service_update_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_with_http_info( + beta_project_service_update_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceUpdateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_serialize( + async def update_project_with_http_info( self, - beta_project_service_update_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_update_project_request is not None: - _body_params = beta_project_service_update_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_update_project_request: BetaProjectServiceUpdateProjectRequest, + ) -> "ApiResult[BetaProjectServiceUpdateProjectResponse]": + """Update Project (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Update an existing project. Required permission: - `project.write` + :param beta_project_service_update_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/UpdateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/UpdateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_update_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceUpdateProjectResponse", + None, ) - - - - @validate_call - def update_project_grant( self, beta_project_service_update_project_grant_request: BetaProjectServiceUpdateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceUpdateProjectGrantResponse: + async def update_project_grant( + self, + beta_project_service_update_project_grant_request: BetaProjectServiceUpdateProjectGrantRequest, + ) -> BetaProjectServiceUpdateProjectGrantResponse: """Update Project Grant - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + :param beta_project_service_update_project_grant_request: (required) + + :return: BetaProjectServiceUpdateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_grant_request'" + ) - :param beta_project_service_update_project_grant_request: (required) - :type beta_project_service_update_project_grant_request: BetaProjectServiceUpdateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_grant_serialize( - beta_project_service_update_project_grant_request=beta_project_service_update_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_grant_with_http_info( + beta_project_service_update_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceUpdateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_grant_serialize( + async def update_project_grant_with_http_info( self, - beta_project_service_update_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_update_project_grant_request is not None: - _body_params = beta_project_service_update_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_update_project_grant_request: BetaProjectServiceUpdateProjectGrantRequest, + ) -> "ApiResult[BetaProjectServiceUpdateProjectGrantResponse]": + """Update Project Grant (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + :param beta_project_service_update_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/UpdateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/UpdateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_update_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceUpdateProjectGrantResponse", + None, ) - - - - @validate_call - def update_project_role( self, beta_project_service_update_project_role_request: BetaProjectServiceUpdateProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaProjectServiceUpdateProjectRoleResponse: + async def update_project_role( + self, + beta_project_service_update_project_role_request: BetaProjectServiceUpdateProjectRoleRequest, + ) -> BetaProjectServiceUpdateProjectRoleResponse: """Update Project Role - Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + :param beta_project_service_update_project_role_request: (required) + + :return: BetaProjectServiceUpdateProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_role_request'" + ) - :param beta_project_service_update_project_role_request: (required) - :type beta_project_service_update_project_role_request: BetaProjectServiceUpdateProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_role_serialize( - beta_project_service_update_project_role_request=beta_project_service_update_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_role_with_http_info( + beta_project_service_update_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaProjectServiceUpdateProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_role_serialize( + async def update_project_role_with_http_info( self, - beta_project_service_update_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_project_service_update_project_role_request is not None: - _body_params = beta_project_service_update_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_project_service_update_project_role_request: BetaProjectServiceUpdateProjectRoleRequest, + ) -> "ApiResult[BetaProjectServiceUpdateProjectRoleResponse]": + """Update Project Role (with HTTP info) + Deprecated: please move to the corresponding endpoint under project service v2. This endpoint will be removed with the next major version of ZITADEL. Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + :param beta_project_service_update_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_project_service_update_project_role_request is None: + raise ValueError( + "Missing the required parameter 'beta_project_service_update_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2beta.ProjectService/UpdateProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2beta.ProjectService/UpdateProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_project_service_update_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaProjectServiceUpdateProjectRoleResponse", + None, ) - - diff --git a/zitadel_client/api/beta_session_service_api.py b/zitadel_client/api/beta_session_service_api.py index bf6f3186..8410c7e9 100644 --- a/zitadel_client/api/beta_session_service_api.py +++ b/zitadel_client/api/beta_session_service_api.py @@ -1,685 +1,390 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_session_service_create_session_request import BetaSessionServiceCreateSessionRequest -from zitadel_client.models.beta_session_service_create_session_response import BetaSessionServiceCreateSessionResponse -from zitadel_client.models.beta_session_service_delete_session_request import BetaSessionServiceDeleteSessionRequest -from zitadel_client.models.beta_session_service_delete_session_response import BetaSessionServiceDeleteSessionResponse -from zitadel_client.models.beta_session_service_get_session_request import BetaSessionServiceGetSessionRequest -from zitadel_client.models.beta_session_service_get_session_response import BetaSessionServiceGetSessionResponse -from zitadel_client.models.beta_session_service_list_sessions_request import BetaSessionServiceListSessionsRequest -from zitadel_client.models.beta_session_service_list_sessions_response import BetaSessionServiceListSessionsResponse -from zitadel_client.models.beta_session_service_set_session_request import BetaSessionServiceSetSessionRequest -from zitadel_client.models.beta_session_service_set_session_response import BetaSessionServiceSetSessionResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaSessionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_session_service_create_session_request import ( + BetaSessionServiceCreateSessionRequest, +) +from zitadel_client.models.beta_session_service_create_session_response import ( + BetaSessionServiceCreateSessionResponse, +) +from zitadel_client.models.beta_session_service_delete_session_request import ( + BetaSessionServiceDeleteSessionRequest, +) +from zitadel_client.models.beta_session_service_delete_session_response import ( + BetaSessionServiceDeleteSessionResponse, +) +from zitadel_client.models.beta_session_service_get_session_request import ( + BetaSessionServiceGetSessionRequest, +) +from zitadel_client.models.beta_session_service_get_session_response import ( + BetaSessionServiceGetSessionResponse, +) +from zitadel_client.models.beta_session_service_list_sessions_request import ( + BetaSessionServiceListSessionsRequest, +) +from zitadel_client.models.beta_session_service_list_sessions_response import ( + BetaSessionServiceListSessionsResponse, +) +from zitadel_client.models.beta_session_service_set_session_request import ( + BetaSessionServiceSetSessionRequest, +) +from zitadel_client.models.beta_session_service_set_session_response import ( + BetaSessionServiceSetSessionResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaSessionServiceApi(BaseApi): + """BetaSessionServiceApi provides methods for the BetaSessionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_session( self, beta_session_service_create_session_request: BetaSessionServiceCreateSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSessionServiceCreateSessionResponse: + async def create_session( + self, + beta_session_service_create_session_request: BetaSessionServiceCreateSessionRequest, + ) -> BetaSessionServiceCreateSessionResponse: """Create a new session - Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_create_session_request: (required) + + :return: BetaSessionServiceCreateSessionResponse + :raises ApiException: if fails to make API call + """ + if beta_session_service_create_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_create_session_request'" + ) - :param beta_session_service_create_session_request: (required) - :type beta_session_service_create_session_request: BetaSessionServiceCreateSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_session_serialize( - beta_session_service_create_session_request=beta_session_service_create_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_session_with_http_info( + beta_session_service_create_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSessionServiceCreateSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_session_serialize( + async def create_session_with_http_info( self, - beta_session_service_create_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_session_service_create_session_request is not None: - _body_params = beta_session_service_create_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_session_service_create_session_request: BetaSessionServiceCreateSessionRequest, + ) -> "ApiResult[BetaSessionServiceCreateSessionResponse]": + """Create a new session (with HTTP info) + Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_create_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_session_service_create_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_create_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2beta.SessionService/CreateSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2beta.SessionService/CreateSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_session_service_create_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSessionServiceCreateSessionResponse", + None, ) - - - - @validate_call - def delete_session( self, beta_session_service_delete_session_request: BetaSessionServiceDeleteSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSessionServiceDeleteSessionResponse: + async def delete_session( + self, + beta_session_service_delete_session_request: BetaSessionServiceDeleteSessionRequest, + ) -> BetaSessionServiceDeleteSessionResponse: """Terminate a session - Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_delete_session_request: (required) + + :return: BetaSessionServiceDeleteSessionResponse + :raises ApiException: if fails to make API call + """ + if beta_session_service_delete_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_delete_session_request'" + ) - :param beta_session_service_delete_session_request: (required) - :type beta_session_service_delete_session_request: BetaSessionServiceDeleteSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_session_serialize( - beta_session_service_delete_session_request=beta_session_service_delete_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_session_with_http_info( + beta_session_service_delete_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSessionServiceDeleteSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_session_serialize( + async def delete_session_with_http_info( self, - beta_session_service_delete_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_session_service_delete_session_request is not None: - _body_params = beta_session_service_delete_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_session_service_delete_session_request: BetaSessionServiceDeleteSessionRequest, + ) -> "ApiResult[BetaSessionServiceDeleteSessionResponse]": + """Terminate a session (with HTTP info) + Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_delete_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_session_service_delete_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_delete_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2beta.SessionService/DeleteSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2beta.SessionService/DeleteSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_session_service_delete_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSessionServiceDeleteSessionResponse", + None, ) - - - - @validate_call - def get_session( self, beta_session_service_get_session_request: BetaSessionServiceGetSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSessionServiceGetSessionResponse: + async def get_session( + self, + beta_session_service_get_session_request: BetaSessionServiceGetSessionRequest, + ) -> BetaSessionServiceGetSessionResponse: """GetSession a session - Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_get_session_request: (required) + + :return: BetaSessionServiceGetSessionResponse + :raises ApiException: if fails to make API call + """ + if beta_session_service_get_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_get_session_request'" + ) - :param beta_session_service_get_session_request: (required) - :type beta_session_service_get_session_request: BetaSessionServiceGetSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_session_serialize( - beta_session_service_get_session_request=beta_session_service_get_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_session_with_http_info( + beta_session_service_get_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSessionServiceGetSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_session_serialize( + async def get_session_with_http_info( self, - beta_session_service_get_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_session_service_get_session_request is not None: - _body_params = beta_session_service_get_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_session_service_get_session_request: BetaSessionServiceGetSessionRequest, + ) -> "ApiResult[BetaSessionServiceGetSessionResponse]": + """GetSession a session (with HTTP info) + Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_get_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_session_service_get_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_get_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2beta.SessionService/GetSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2beta.SessionService/GetSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_session_service_get_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSessionServiceGetSessionResponse", + None, ) - - - - @validate_call - def list_sessions( self, beta_session_service_list_sessions_request: BetaSessionServiceListSessionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSessionServiceListSessionsResponse: + async def list_sessions( + self, + beta_session_service_list_sessions_request: BetaSessionServiceListSessionsRequest, + ) -> BetaSessionServiceListSessionsResponse: """Search sessions - Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_list_sessions_request: (required) + + :return: BetaSessionServiceListSessionsResponse + :raises ApiException: if fails to make API call + """ + if beta_session_service_list_sessions_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_list_sessions_request'" + ) - :param beta_session_service_list_sessions_request: (required) - :type beta_session_service_list_sessions_request: BetaSessionServiceListSessionsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_sessions_serialize( - beta_session_service_list_sessions_request=beta_session_service_list_sessions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_sessions_with_http_info( + beta_session_service_list_sessions_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSessionServiceListSessionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_sessions_serialize( + async def list_sessions_with_http_info( self, - beta_session_service_list_sessions_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_session_service_list_sessions_request is not None: - _body_params = beta_session_service_list_sessions_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_session_service_list_sessions_request: BetaSessionServiceListSessionsRequest, + ) -> "ApiResult[BetaSessionServiceListSessionsResponse]": + """Search sessions (with HTTP info) + Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_list_sessions_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_session_service_list_sessions_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_list_sessions_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2beta.SessionService/ListSessions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2beta.SessionService/ListSessions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_session_service_list_sessions_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSessionServiceListSessionsResponse", + None, ) - - - - @validate_call - def set_session( self, beta_session_service_set_session_request: BetaSessionServiceSetSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSessionServiceSetSessionResponse: + async def set_session( + self, + beta_session_service_set_session_request: BetaSessionServiceSetSessionRequest, + ) -> BetaSessionServiceSetSessionResponse: """Update a session - Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_set_session_request: (required) + + :return: BetaSessionServiceSetSessionResponse + :raises ApiException: if fails to make API call + """ + if beta_session_service_set_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_set_session_request'" + ) - :param beta_session_service_set_session_request: (required) - :type beta_session_service_set_session_request: BetaSessionServiceSetSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_session_serialize( - beta_session_service_set_session_request=beta_session_service_set_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_session_with_http_info( + beta_session_service_set_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSessionServiceSetSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_session_serialize( + async def set_session_with_http_info( self, - beta_session_service_set_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_session_service_set_session_request is not None: - _body_params = beta_session_service_set_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_session_service_set_session_request: BetaSessionServiceSetSessionRequest, + ) -> "ApiResult[BetaSessionServiceSetSessionResponse]": + """Update a session (with HTTP info) + Deprecated: please move to the corresponding endpoint under session service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_session_service_set_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_session_service_set_session_request is None: + raise ValueError( + "Missing the required parameter 'beta_session_service_set_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2beta.SessionService/SetSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2beta.SessionService/SetSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_session_service_set_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSessionServiceSetSessionResponse", + None, ) - - diff --git a/zitadel_client/api/beta_settings_service_api.py b/zitadel_client/api/beta_settings_service_api.py index 4207e4ed..0dd2035c 100644 --- a/zitadel_client/api/beta_settings_service_api.py +++ b/zitadel_client/api/beta_settings_service_api.py @@ -1,1468 +1,804 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.beta_settings_service_get_active_identity_providers_request import BetaSettingsServiceGetActiveIdentityProvidersRequest -from zitadel_client.models.beta_settings_service_get_active_identity_providers_response import BetaSettingsServiceGetActiveIdentityProvidersResponse -from zitadel_client.models.beta_settings_service_get_branding_settings_request import BetaSettingsServiceGetBrandingSettingsRequest -from zitadel_client.models.beta_settings_service_get_branding_settings_response import BetaSettingsServiceGetBrandingSettingsResponse -from zitadel_client.models.beta_settings_service_get_domain_settings_request import BetaSettingsServiceGetDomainSettingsRequest -from zitadel_client.models.beta_settings_service_get_domain_settings_response import BetaSettingsServiceGetDomainSettingsResponse -from zitadel_client.models.beta_settings_service_get_general_settings_response import BetaSettingsServiceGetGeneralSettingsResponse -from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_request import BetaSettingsServiceGetLegalAndSupportSettingsRequest -from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_response import BetaSettingsServiceGetLegalAndSupportSettingsResponse -from zitadel_client.models.beta_settings_service_get_lockout_settings_request import BetaSettingsServiceGetLockoutSettingsRequest -from zitadel_client.models.beta_settings_service_get_lockout_settings_response import BetaSettingsServiceGetLockoutSettingsResponse -from zitadel_client.models.beta_settings_service_get_login_settings_request import BetaSettingsServiceGetLoginSettingsRequest -from zitadel_client.models.beta_settings_service_get_login_settings_response import BetaSettingsServiceGetLoginSettingsResponse -from zitadel_client.models.beta_settings_service_get_password_complexity_settings_request import BetaSettingsServiceGetPasswordComplexitySettingsRequest -from zitadel_client.models.beta_settings_service_get_password_complexity_settings_response import BetaSettingsServiceGetPasswordComplexitySettingsResponse -from zitadel_client.models.beta_settings_service_get_password_expiry_settings_request import BetaSettingsServiceGetPasswordExpirySettingsRequest -from zitadel_client.models.beta_settings_service_get_password_expiry_settings_response import BetaSettingsServiceGetPasswordExpirySettingsResponse -from zitadel_client.models.beta_settings_service_get_security_settings_response import BetaSettingsServiceGetSecuritySettingsResponse -from zitadel_client.models.beta_settings_service_set_security_settings_request import BetaSettingsServiceSetSecuritySettingsRequest -from zitadel_client.models.beta_settings_service_set_security_settings_response import BetaSettingsServiceSetSecuritySettingsResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaSettingsServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def get_active_identity_providers( self, beta_settings_service_get_active_identity_providers_request: BetaSettingsServiceGetActiveIdentityProvidersRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetActiveIdentityProvidersResponse: - """Get the current active identity providers - - Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. - - :param beta_settings_service_get_active_identity_providers_request: (required) - :type beta_settings_service_get_active_identity_providers_request: BetaSettingsServiceGetActiveIdentityProvidersRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_active_identity_providers_serialize( - beta_settings_service_get_active_identity_providers_request=beta_settings_service_get_active_identity_providers_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetActiveIdentityProvidersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_settings_service_get_active_identity_providers_request import ( + BetaSettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.beta_settings_service_get_active_identity_providers_response import ( + BetaSettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_request import ( + BetaSettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_response import ( + BetaSettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_request import ( + BetaSettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_response import ( + BetaSettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_general_settings_response import ( + BetaSettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_request import ( + BetaSettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_response import ( + BetaSettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_request import ( + BetaSettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_response import ( + BetaSettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_login_settings_request import ( + BetaSettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_login_settings_response import ( + BetaSettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_request import ( + BetaSettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_response import ( + BetaSettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_request import ( + BetaSettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_response import ( + BetaSettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_security_settings_response import ( + BetaSettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.beta_settings_service_set_security_settings_request import ( + BetaSettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.beta_settings_service_set_security_settings_response import ( + BetaSettingsServiceSetSecuritySettingsResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaSettingsServiceApi(BaseApi): + """BetaSettingsServiceApi provides methods for the BetaSettingsService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - def _get_active_identity_providers_serialize( + async def get_active_identity_providers( self, - beta_settings_service_get_active_identity_providers_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_active_identity_providers_request is not None: - _body_params = beta_settings_service_get_active_identity_providers_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_active_identity_providers_request: BetaSettingsServiceGetActiveIdentityProvidersRequest, + ) -> BetaSettingsServiceGetActiveIdentityProvidersResponse: + """Get the current active identity providers + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_active_identity_providers_request: (required) + + :return: BetaSettingsServiceGetActiveIdentityProvidersResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_active_identity_providers_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetActiveIdentityProviders', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_active_identity_providers_with_http_info( + beta_settings_service_get_active_identity_providers_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_branding_settings( self, beta_settings_service_get_branding_settings_request: BetaSettingsServiceGetBrandingSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetBrandingSettingsResponse: - """Get the current active branding settings - + async def get_active_identity_providers_with_http_info( + self, + beta_settings_service_get_active_identity_providers_request: BetaSettingsServiceGetActiveIdentityProvidersRequest, + ) -> "ApiResult[BetaSettingsServiceGetActiveIdentityProvidersResponse]": + """Get the current active identity providers (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_active_identity_providers_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_active_identity_providers_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_active_identity_providers_request'" + ) - :param beta_settings_service_get_branding_settings_request: (required) - :type beta_settings_service_get_branding_settings_request: BetaSettingsServiceGetBrandingSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_branding_settings_serialize( - beta_settings_service_get_branding_settings_request=beta_settings_service_get_branding_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetActiveIdentityProviders" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_active_identity_providers_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetBrandingSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetActiveIdentityProvidersResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_branding_settings_serialize( + async def get_branding_settings( self, - beta_settings_service_get_branding_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_branding_settings_request is not None: - _body_params = beta_settings_service_get_branding_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_branding_settings_request: BetaSettingsServiceGetBrandingSettingsRequest, + ) -> BetaSettingsServiceGetBrandingSettingsResponse: + """Get the current active branding settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_branding_settings_request: (required) + + :return: BetaSettingsServiceGetBrandingSettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_branding_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_branding_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetBrandingSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_branding_settings_with_http_info( + beta_settings_service_get_branding_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_domain_settings( self, beta_settings_service_get_domain_settings_request: BetaSettingsServiceGetDomainSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetDomainSettingsResponse: - """Get the domain settings - + async def get_branding_settings_with_http_info( + self, + beta_settings_service_get_branding_settings_request: BetaSettingsServiceGetBrandingSettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetBrandingSettingsResponse]": + """Get the current active branding settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_branding_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_branding_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_branding_settings_request'" + ) - :param beta_settings_service_get_domain_settings_request: (required) - :type beta_settings_service_get_domain_settings_request: BetaSettingsServiceGetDomainSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_domain_settings_serialize( - beta_settings_service_get_domain_settings_request=beta_settings_service_get_domain_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetBrandingSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_branding_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetDomainSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetBrandingSettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_domain_settings_serialize( + async def get_domain_settings( self, - beta_settings_service_get_domain_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_domain_settings_request is not None: - _body_params = beta_settings_service_get_domain_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_domain_settings_request: BetaSettingsServiceGetDomainSettingsRequest, + ) -> BetaSettingsServiceGetDomainSettingsResponse: + """Get the domain settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_domain_settings_request: (required) + + :return: BetaSettingsServiceGetDomainSettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_domain_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_domain_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetDomainSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_domain_settings_with_http_info( + beta_settings_service_get_domain_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_general_settings( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetGeneralSettingsResponse: - if body is None: - body = {} - """Get basic information over the instance - + async def get_domain_settings_with_http_info( + self, + beta_settings_service_get_domain_settings_request: BetaSettingsServiceGetDomainSettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetDomainSettingsResponse]": + """Get the domain settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_domain_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_domain_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_domain_settings_request'" + ) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_general_settings_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetDomainSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_domain_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetGeneralSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetDomainSettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_general_settings_serialize( + async def get_general_settings( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> BetaSettingsServiceGetGeneralSettingsResponse: + """Get basic information over the instance + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: BetaSettingsServiceGetGeneralSettingsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_general_settings_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetGeneralSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_legal_and_support_settings( self, beta_settings_service_get_legal_and_support_settings_request: BetaSettingsServiceGetLegalAndSupportSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetLegalAndSupportSettingsResponse: - """Get the legal and support settings + return result.data + async def get_general_settings_with_http_info( + self, + body: object, + ) -> "ApiResult[BetaSettingsServiceGetGeneralSettingsResponse]": + """Get basic information over the instance (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param body: (required) - :param beta_settings_service_get_legal_and_support_settings_request: (required) - :type beta_settings_service_get_legal_and_support_settings_request: BetaSettingsServiceGetLegalAndSupportSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_legal_and_support_settings_serialize( - beta_settings_service_get_legal_and_support_settings_request=beta_settings_service_get_legal_and_support_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetLegalAndSupportSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _get_legal_and_support_settings_serialize( + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.settings.v2beta.SettingsService/GetGeneralSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetGeneralSettingsResponse", + None, + ) + + async def get_legal_and_support_settings( self, - beta_settings_service_get_legal_and_support_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_legal_and_support_settings_request is not None: - _body_params = beta_settings_service_get_legal_and_support_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_legal_and_support_settings_request: BetaSettingsServiceGetLegalAndSupportSettingsRequest, + ) -> BetaSettingsServiceGetLegalAndSupportSettingsResponse: + """Get the legal and support settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_legal_and_support_settings_request: (required) + + :return: BetaSettingsServiceGetLegalAndSupportSettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_legal_and_support_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetLegalAndSupportSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_legal_and_support_settings_with_http_info( + beta_settings_service_get_legal_and_support_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_lockout_settings( self, beta_settings_service_get_lockout_settings_request: BetaSettingsServiceGetLockoutSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetLockoutSettingsResponse: - """Get the lockout settings - + async def get_legal_and_support_settings_with_http_info( + self, + beta_settings_service_get_legal_and_support_settings_request: BetaSettingsServiceGetLegalAndSupportSettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetLegalAndSupportSettingsResponse]": + """Get the legal and support settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_legal_and_support_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_legal_and_support_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_legal_and_support_settings_request'" + ) - :param beta_settings_service_get_lockout_settings_request: (required) - :type beta_settings_service_get_lockout_settings_request: BetaSettingsServiceGetLockoutSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_lockout_settings_serialize( - beta_settings_service_get_lockout_settings_request=beta_settings_service_get_lockout_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetLegalAndSupportSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_legal_and_support_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetLockoutSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetLegalAndSupportSettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_lockout_settings_serialize( + async def get_lockout_settings( self, - beta_settings_service_get_lockout_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_lockout_settings_request is not None: - _body_params = beta_settings_service_get_lockout_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_lockout_settings_request: BetaSettingsServiceGetLockoutSettingsRequest, + ) -> BetaSettingsServiceGetLockoutSettingsResponse: + """Get the lockout settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_lockout_settings_request: (required) + + :return: BetaSettingsServiceGetLockoutSettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_lockout_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_lockout_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetLockoutSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_lockout_settings_with_http_info( + beta_settings_service_get_lockout_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_login_settings( self, beta_settings_service_get_login_settings_request: BetaSettingsServiceGetLoginSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetLoginSettingsResponse: - """Get the login settings - + async def get_lockout_settings_with_http_info( + self, + beta_settings_service_get_lockout_settings_request: BetaSettingsServiceGetLockoutSettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetLockoutSettingsResponse]": + """Get the lockout settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_lockout_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_lockout_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_lockout_settings_request'" + ) - :param beta_settings_service_get_login_settings_request: (required) - :type beta_settings_service_get_login_settings_request: BetaSettingsServiceGetLoginSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_login_settings_serialize( - beta_settings_service_get_login_settings_request=beta_settings_service_get_login_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetLockoutSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_lockout_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetLoginSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetLockoutSettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_login_settings_serialize( + async def get_login_settings( self, - beta_settings_service_get_login_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_login_settings_request is not None: - _body_params = beta_settings_service_get_login_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_login_settings_request: BetaSettingsServiceGetLoginSettingsRequest, + ) -> BetaSettingsServiceGetLoginSettingsResponse: + """Get the login settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_login_settings_request: (required) + + :return: BetaSettingsServiceGetLoginSettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_login_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_login_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetLoginSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_login_settings_with_http_info( + beta_settings_service_get_login_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_password_complexity_settings( self, beta_settings_service_get_password_complexity_settings_request: BetaSettingsServiceGetPasswordComplexitySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetPasswordComplexitySettingsResponse: - """Get the password complexity settings - + async def get_login_settings_with_http_info( + self, + beta_settings_service_get_login_settings_request: BetaSettingsServiceGetLoginSettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetLoginSettingsResponse]": + """Get the login settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_login_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_login_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_login_settings_request'" + ) - :param beta_settings_service_get_password_complexity_settings_request: (required) - :type beta_settings_service_get_password_complexity_settings_request: BetaSettingsServiceGetPasswordComplexitySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_password_complexity_settings_serialize( - beta_settings_service_get_password_complexity_settings_request=beta_settings_service_get_password_complexity_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetLoginSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_login_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetPasswordComplexitySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetLoginSettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_password_complexity_settings_serialize( + async def get_password_complexity_settings( self, - beta_settings_service_get_password_complexity_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_password_complexity_settings_request is not None: - _body_params = beta_settings_service_get_password_complexity_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_password_complexity_settings_request: BetaSettingsServiceGetPasswordComplexitySettingsRequest, + ) -> BetaSettingsServiceGetPasswordComplexitySettingsResponse: + """Get the password complexity settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_password_complexity_settings_request: (required) + + :return: BetaSettingsServiceGetPasswordComplexitySettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_password_complexity_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetPasswordComplexitySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_password_complexity_settings_with_http_info( + beta_settings_service_get_password_complexity_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_password_expiry_settings( self, beta_settings_service_get_password_expiry_settings_request: BetaSettingsServiceGetPasswordExpirySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetPasswordExpirySettingsResponse: - """Get the password expiry settings - + async def get_password_complexity_settings_with_http_info( + self, + beta_settings_service_get_password_complexity_settings_request: BetaSettingsServiceGetPasswordComplexitySettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetPasswordComplexitySettingsResponse]": + """Get the password complexity settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_password_complexity_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_password_complexity_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_password_complexity_settings_request'" + ) - :param beta_settings_service_get_password_expiry_settings_request: (required) - :type beta_settings_service_get_password_expiry_settings_request: BetaSettingsServiceGetPasswordExpirySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_password_expiry_settings_serialize( - beta_settings_service_get_password_expiry_settings_request=beta_settings_service_get_password_expiry_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetPasswordComplexitySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_password_complexity_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetPasswordExpirySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetPasswordComplexitySettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_password_expiry_settings_serialize( + async def get_password_expiry_settings( self, - beta_settings_service_get_password_expiry_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_get_password_expiry_settings_request is not None: - _body_params = beta_settings_service_get_password_expiry_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_get_password_expiry_settings_request: BetaSettingsServiceGetPasswordExpirySettingsRequest, + ) -> BetaSettingsServiceGetPasswordExpirySettingsResponse: + """Get the password expiry settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_password_expiry_settings_request: (required) + + :return: BetaSettingsServiceGetPasswordExpirySettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_password_expiry_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetPasswordExpirySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_password_expiry_settings_with_http_info( + beta_settings_service_get_password_expiry_settings_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_security_settings( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceGetSecuritySettingsResponse: - if body is None: - body = {} - """Get the security settings - + async def get_password_expiry_settings_with_http_info( + self, + beta_settings_service_get_password_expiry_settings_request: BetaSettingsServiceGetPasswordExpirySettingsRequest, + ) -> "ApiResult[BetaSettingsServiceGetPasswordExpirySettingsResponse]": + """Get the password expiry settings (with HTTP info) Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_get_password_expiry_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_get_password_expiry_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_get_password_expiry_settings_request'" + ) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_security_settings_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.settings.v2beta.SettingsService/GetPasswordExpirySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_get_password_expiry_settings_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceGetSecuritySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetPasswordExpirySettingsResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_security_settings_serialize( + async def get_security_settings( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> BetaSettingsServiceGetSecuritySettingsResponse: + """Get the security settings + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: BetaSettingsServiceGetSecuritySettingsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_security_settings_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/GetSecuritySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def get_security_settings_with_http_info( + self, + body: object, + ) -> "ApiResult[BetaSettingsServiceGetSecuritySettingsResponse]": + """Get the security settings (with HTTP info) + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param body: (required) - @validate_call - def set_security_settings( self, beta_settings_service_set_security_settings_request: BetaSettingsServiceSetSecuritySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaSettingsServiceSetSecuritySettingsResponse: + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.settings.v2beta.SettingsService/GetSecuritySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceGetSecuritySettingsResponse", + None, + ) + + async def set_security_settings( + self, + beta_settings_service_set_security_settings_request: BetaSettingsServiceSetSecuritySettingsRequest, + ) -> BetaSettingsServiceSetSecuritySettingsResponse: """Set the security settings - Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_set_security_settings_request: (required) + + :return: BetaSettingsServiceSetSecuritySettingsResponse + :raises ApiException: if fails to make API call + """ + if beta_settings_service_set_security_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_set_security_settings_request'" + ) - :param beta_settings_service_set_security_settings_request: (required) - :type beta_settings_service_set_security_settings_request: BetaSettingsServiceSetSecuritySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_security_settings_serialize( - beta_settings_service_set_security_settings_request=beta_settings_service_set_security_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_security_settings_with_http_info( + beta_settings_service_set_security_settings_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaSettingsServiceSetSecuritySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_security_settings_serialize( + async def set_security_settings_with_http_info( self, - beta_settings_service_set_security_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_settings_service_set_security_settings_request is not None: - _body_params = beta_settings_service_set_security_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_settings_service_set_security_settings_request: BetaSettingsServiceSetSecuritySettingsRequest, + ) -> "ApiResult[BetaSettingsServiceSetSecuritySettingsResponse]": + """Set the security settings (with HTTP info) + Deprecated: please move to the corresponding endpoint under settings service v2. This endpoint will be removed with the next major version of ZITADEL. + :param beta_settings_service_set_security_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_settings_service_set_security_settings_request is None: + raise ValueError( + "Missing the required parameter 'beta_settings_service_set_security_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2beta.SettingsService/SetSecuritySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.settings.v2beta.SettingsService/SetSecuritySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_settings_service_set_security_settings_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaSettingsServiceSetSecuritySettingsResponse", + None, ) - - diff --git a/zitadel_client/api/beta_telemetry_service_api.py b/zitadel_client/api/beta_telemetry_service_api.py index 4fb0c27b..3d6b981e 100644 --- a/zitadel_client/api/beta_telemetry_service_api.py +++ b/zitadel_client/api/beta_telemetry_service_api.py @@ -1,295 +1,174 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_telemetry_service_report_base_information_request import BetaTelemetryServiceReportBaseInformationRequest -from zitadel_client.models.beta_telemetry_service_report_base_information_response import BetaTelemetryServiceReportBaseInformationResponse -from zitadel_client.models.beta_telemetry_service_report_resource_counts_request import BetaTelemetryServiceReportResourceCountsRequest -from zitadel_client.models.beta_telemetry_service_report_resource_counts_response import BetaTelemetryServiceReportResourceCountsResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaTelemetryServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_telemetry_service_report_base_information_request import ( + BetaTelemetryServiceReportBaseInformationRequest, +) +from zitadel_client.models.beta_telemetry_service_report_base_information_response import ( + BetaTelemetryServiceReportBaseInformationResponse, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_request import ( + BetaTelemetryServiceReportResourceCountsRequest, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_response import ( + BetaTelemetryServiceReportResourceCountsResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaTelemetryServiceApi(BaseApi): + """BetaTelemetryServiceApi provides methods for the BetaTelemetryService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def report_base_information( self, beta_telemetry_service_report_base_information_request: BetaTelemetryServiceReportBaseInformationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaTelemetryServiceReportBaseInformationResponse: + async def report_base_information( + self, + beta_telemetry_service_report_base_information_request: BetaTelemetryServiceReportBaseInformationRequest, + ) -> BetaTelemetryServiceReportBaseInformationResponse: """ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. - ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. + :param beta_telemetry_service_report_base_information_request: (required) + + :return: BetaTelemetryServiceReportBaseInformationResponse + :raises ApiException: if fails to make API call + """ + if beta_telemetry_service_report_base_information_request is None: + raise ValueError( + "Missing the required parameter 'beta_telemetry_service_report_base_information_request'" + ) - :param beta_telemetry_service_report_base_information_request: (required) - :type beta_telemetry_service_report_base_information_request: BetaTelemetryServiceReportBaseInformationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._report_base_information_serialize( - beta_telemetry_service_report_base_information_request=beta_telemetry_service_report_base_information_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaTelemetryServiceReportBaseInformationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.report_base_information_with_http_info( + beta_telemetry_service_report_base_information_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _report_base_information_serialize( - self, - beta_telemetry_service_report_base_information_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_telemetry_service_report_base_information_request is not None: - _body_params = beta_telemetry_service_report_base_information_request - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def report_base_information_with_http_info( + self, + beta_telemetry_service_report_base_information_request: BetaTelemetryServiceReportBaseInformationRequest, + ) -> "ApiResult[BetaTelemetryServiceReportBaseInformationResponse]": + """ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. (with HTTP info) + ReportBaseInformation is used to report the base information of the ZITADEL system, including the version, instances, their creation date and domains. The response contains a report ID to link it to the resource counts or other reports. The report ID is only valid for the same system ID. + :param beta_telemetry_service_report_base_information_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_telemetry_service_report_base_information_request is None: + raise ValueError( + "Missing the required parameter 'beta_telemetry_service_report_base_information_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.analytics.v2beta.TelemetryService/ReportBaseInformation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.analytics.v2beta.TelemetryService/ReportBaseInformation" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_telemetry_service_report_base_information_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaTelemetryServiceReportBaseInformationResponse", + None, ) - - - - @validate_call - def report_resource_counts( self, beta_telemetry_service_report_resource_counts_request: BetaTelemetryServiceReportResourceCountsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaTelemetryServiceReportResourceCountsResponse: + async def report_resource_counts( + self, + beta_telemetry_service_report_resource_counts_request: BetaTelemetryServiceReportResourceCountsRequest, + ) -> BetaTelemetryServiceReportResourceCountsResponse: """ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. - ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. + :param beta_telemetry_service_report_resource_counts_request: (required) + + :return: BetaTelemetryServiceReportResourceCountsResponse + :raises ApiException: if fails to make API call + """ + if beta_telemetry_service_report_resource_counts_request is None: + raise ValueError( + "Missing the required parameter 'beta_telemetry_service_report_resource_counts_request'" + ) - :param beta_telemetry_service_report_resource_counts_request: (required) - :type beta_telemetry_service_report_resource_counts_request: BetaTelemetryServiceReportResourceCountsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._report_resource_counts_serialize( - beta_telemetry_service_report_resource_counts_request=beta_telemetry_service_report_resource_counts_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaTelemetryServiceReportResourceCountsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.report_resource_counts_with_http_info( + beta_telemetry_service_report_resource_counts_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _report_resource_counts_serialize( - self, - beta_telemetry_service_report_resource_counts_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_telemetry_service_report_resource_counts_request is not None: - _body_params = beta_telemetry_service_report_resource_counts_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def report_resource_counts_with_http_info( + self, + beta_telemetry_service_report_resource_counts_request: BetaTelemetryServiceReportResourceCountsRequest, + ) -> "ApiResult[BetaTelemetryServiceReportResourceCountsResponse]": + """ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. (with HTTP info) + ReportResourceCounts is used to report the resource counts such as amount of organizations or users per organization and much more. Since the resource counts can be reported in multiple batches, the response contains a report ID to continue reporting. The report ID is only valid for the same system ID. + :param beta_telemetry_service_report_resource_counts_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_telemetry_service_report_resource_counts_request is None: + raise ValueError( + "Missing the required parameter 'beta_telemetry_service_report_resource_counts_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.analytics.v2beta.TelemetryService/ReportResourceCounts', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.analytics.v2beta.TelemetryService/ReportResourceCounts" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_telemetry_service_report_resource_counts_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaTelemetryServiceReportResourceCountsResponse", + None, ) - - diff --git a/zitadel_client/api/beta_user_service_api.py b/zitadel_client/api/beta_user_service_api.py index 357e9f59..728b79b8 100644 --- a/zitadel_client/api/beta_user_service_api.py +++ b/zitadel_client/api/beta_user_service_api.py @@ -1,4473 +1,2478 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.beta_user_service_add_human_user_request import BetaUserServiceAddHumanUserRequest -from zitadel_client.models.beta_user_service_add_human_user_response import BetaUserServiceAddHumanUserResponse -from zitadel_client.models.beta_user_service_add_idp_link_request import BetaUserServiceAddIDPLinkRequest -from zitadel_client.models.beta_user_service_add_idp_link_response import BetaUserServiceAddIDPLinkResponse -from zitadel_client.models.beta_user_service_add_otp_email_request import BetaUserServiceAddOTPEmailRequest -from zitadel_client.models.beta_user_service_add_otp_email_response import BetaUserServiceAddOTPEmailResponse -from zitadel_client.models.beta_user_service_add_otpsms_request import BetaUserServiceAddOTPSMSRequest -from zitadel_client.models.beta_user_service_add_otpsms_response import BetaUserServiceAddOTPSMSResponse -from zitadel_client.models.beta_user_service_create_passkey_registration_link_request import BetaUserServiceCreatePasskeyRegistrationLinkRequest -from zitadel_client.models.beta_user_service_create_passkey_registration_link_response import BetaUserServiceCreatePasskeyRegistrationLinkResponse -from zitadel_client.models.beta_user_service_deactivate_user_request import BetaUserServiceDeactivateUserRequest -from zitadel_client.models.beta_user_service_deactivate_user_response import BetaUserServiceDeactivateUserResponse -from zitadel_client.models.beta_user_service_delete_user_request import BetaUserServiceDeleteUserRequest -from zitadel_client.models.beta_user_service_delete_user_response import BetaUserServiceDeleteUserResponse -from zitadel_client.models.beta_user_service_get_user_by_id_request import BetaUserServiceGetUserByIDRequest -from zitadel_client.models.beta_user_service_get_user_by_id_response import BetaUserServiceGetUserByIDResponse -from zitadel_client.models.beta_user_service_list_authentication_method_types_request import BetaUserServiceListAuthenticationMethodTypesRequest -from zitadel_client.models.beta_user_service_list_authentication_method_types_response import BetaUserServiceListAuthenticationMethodTypesResponse -from zitadel_client.models.beta_user_service_list_users_request import BetaUserServiceListUsersRequest -from zitadel_client.models.beta_user_service_list_users_response import BetaUserServiceListUsersResponse -from zitadel_client.models.beta_user_service_lock_user_request import BetaUserServiceLockUserRequest -from zitadel_client.models.beta_user_service_lock_user_response import BetaUserServiceLockUserResponse -from zitadel_client.models.beta_user_service_password_reset_request import BetaUserServicePasswordResetRequest -from zitadel_client.models.beta_user_service_password_reset_response import BetaUserServicePasswordResetResponse -from zitadel_client.models.beta_user_service_reactivate_user_request import BetaUserServiceReactivateUserRequest -from zitadel_client.models.beta_user_service_reactivate_user_response import BetaUserServiceReactivateUserResponse -from zitadel_client.models.beta_user_service_register_passkey_request import BetaUserServiceRegisterPasskeyRequest -from zitadel_client.models.beta_user_service_register_passkey_response import BetaUserServiceRegisterPasskeyResponse -from zitadel_client.models.beta_user_service_register_totp_request import BetaUserServiceRegisterTOTPRequest -from zitadel_client.models.beta_user_service_register_totp_response import BetaUserServiceRegisterTOTPResponse -from zitadel_client.models.beta_user_service_register_u2_f_request import BetaUserServiceRegisterU2FRequest -from zitadel_client.models.beta_user_service_register_u2_f_response import BetaUserServiceRegisterU2FResponse -from zitadel_client.models.beta_user_service_remove_otp_email_request import BetaUserServiceRemoveOTPEmailRequest -from zitadel_client.models.beta_user_service_remove_otp_email_response import BetaUserServiceRemoveOTPEmailResponse -from zitadel_client.models.beta_user_service_remove_otpsms_request import BetaUserServiceRemoveOTPSMSRequest -from zitadel_client.models.beta_user_service_remove_otpsms_response import BetaUserServiceRemoveOTPSMSResponse -from zitadel_client.models.beta_user_service_remove_phone_request import BetaUserServiceRemovePhoneRequest -from zitadel_client.models.beta_user_service_remove_phone_response import BetaUserServiceRemovePhoneResponse -from zitadel_client.models.beta_user_service_remove_totp_request import BetaUserServiceRemoveTOTPRequest -from zitadel_client.models.beta_user_service_remove_totp_response import BetaUserServiceRemoveTOTPResponse -from zitadel_client.models.beta_user_service_resend_email_code_request import BetaUserServiceResendEmailCodeRequest -from zitadel_client.models.beta_user_service_resend_email_code_response import BetaUserServiceResendEmailCodeResponse -from zitadel_client.models.beta_user_service_resend_phone_code_request import BetaUserServiceResendPhoneCodeRequest -from zitadel_client.models.beta_user_service_resend_phone_code_response import BetaUserServiceResendPhoneCodeResponse -from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_request import BetaUserServiceRetrieveIdentityProviderIntentRequest -from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_response import BetaUserServiceRetrieveIdentityProviderIntentResponse -from zitadel_client.models.beta_user_service_set_email_request import BetaUserServiceSetEmailRequest -from zitadel_client.models.beta_user_service_set_email_response import BetaUserServiceSetEmailResponse -from zitadel_client.models.beta_user_service_set_password_request import BetaUserServiceSetPasswordRequest -from zitadel_client.models.beta_user_service_set_password_response import BetaUserServiceSetPasswordResponse -from zitadel_client.models.beta_user_service_set_phone_request import BetaUserServiceSetPhoneRequest -from zitadel_client.models.beta_user_service_set_phone_response import BetaUserServiceSetPhoneResponse -from zitadel_client.models.beta_user_service_start_identity_provider_intent_request import BetaUserServiceStartIdentityProviderIntentRequest -from zitadel_client.models.beta_user_service_start_identity_provider_intent_response import BetaUserServiceStartIdentityProviderIntentResponse -from zitadel_client.models.beta_user_service_unlock_user_request import BetaUserServiceUnlockUserRequest -from zitadel_client.models.beta_user_service_unlock_user_response import BetaUserServiceUnlockUserResponse -from zitadel_client.models.beta_user_service_update_human_user_request import BetaUserServiceUpdateHumanUserRequest -from zitadel_client.models.beta_user_service_update_human_user_response import BetaUserServiceUpdateHumanUserResponse -from zitadel_client.models.beta_user_service_verify_email_request import BetaUserServiceVerifyEmailRequest -from zitadel_client.models.beta_user_service_verify_email_response import BetaUserServiceVerifyEmailResponse -from zitadel_client.models.beta_user_service_verify_passkey_registration_request import BetaUserServiceVerifyPasskeyRegistrationRequest -from zitadel_client.models.beta_user_service_verify_passkey_registration_response import BetaUserServiceVerifyPasskeyRegistrationResponse -from zitadel_client.models.beta_user_service_verify_phone_request import BetaUserServiceVerifyPhoneRequest -from zitadel_client.models.beta_user_service_verify_phone_response import BetaUserServiceVerifyPhoneResponse -from zitadel_client.models.beta_user_service_verify_totp_registration_request import BetaUserServiceVerifyTOTPRegistrationRequest -from zitadel_client.models.beta_user_service_verify_totp_registration_response import BetaUserServiceVerifyTOTPRegistrationResponse -from zitadel_client.models.beta_user_service_verify_u2_f_registration_request import BetaUserServiceVerifyU2FRegistrationRequest -from zitadel_client.models.beta_user_service_verify_u2_f_registration_response import BetaUserServiceVerifyU2FRegistrationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaUserServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def add_human_user( self, beta_user_service_add_human_user_request: Optional[BetaUserServiceAddHumanUserRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceAddHumanUserResponse: - if beta_user_service_add_human_user_request is None: - beta_user_service_add_human_user_request = {} - """Create a new human user +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_user_service_add_human_user_request import ( + BetaUserServiceAddHumanUserRequest, +) +from zitadel_client.models.beta_user_service_add_human_user_response import ( + BetaUserServiceAddHumanUserResponse, +) +from zitadel_client.models.beta_user_service_add_idp_link_request import ( + BetaUserServiceAddIDPLinkRequest, +) +from zitadel_client.models.beta_user_service_add_idp_link_response import ( + BetaUserServiceAddIDPLinkResponse, +) +from zitadel_client.models.beta_user_service_add_otp_email_request import ( + BetaUserServiceAddOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_add_otp_email_response import ( + BetaUserServiceAddOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_add_otpsms_request import ( + BetaUserServiceAddOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_add_otpsms_response import ( + BetaUserServiceAddOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_request import ( + BetaUserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_response import ( + BetaUserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.beta_user_service_deactivate_user_request import ( + BetaUserServiceDeactivateUserRequest, +) +from zitadel_client.models.beta_user_service_deactivate_user_response import ( + BetaUserServiceDeactivateUserResponse, +) +from zitadel_client.models.beta_user_service_delete_user_request import ( + BetaUserServiceDeleteUserRequest, +) +from zitadel_client.models.beta_user_service_delete_user_response import ( + BetaUserServiceDeleteUserResponse, +) +from zitadel_client.models.beta_user_service_get_user_by_id_request import ( + BetaUserServiceGetUserByIDRequest, +) +from zitadel_client.models.beta_user_service_get_user_by_id_response import ( + BetaUserServiceGetUserByIDResponse, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_request import ( + BetaUserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_response import ( + BetaUserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.beta_user_service_list_users_request import ( + BetaUserServiceListUsersRequest, +) +from zitadel_client.models.beta_user_service_list_users_response import ( + BetaUserServiceListUsersResponse, +) +from zitadel_client.models.beta_user_service_lock_user_request import ( + BetaUserServiceLockUserRequest, +) +from zitadel_client.models.beta_user_service_lock_user_response import ( + BetaUserServiceLockUserResponse, +) +from zitadel_client.models.beta_user_service_password_reset_request import ( + BetaUserServicePasswordResetRequest, +) +from zitadel_client.models.beta_user_service_password_reset_response import ( + BetaUserServicePasswordResetResponse, +) +from zitadel_client.models.beta_user_service_reactivate_user_request import ( + BetaUserServiceReactivateUserRequest, +) +from zitadel_client.models.beta_user_service_reactivate_user_response import ( + BetaUserServiceReactivateUserResponse, +) +from zitadel_client.models.beta_user_service_register_passkey_request import ( + BetaUserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.beta_user_service_register_passkey_response import ( + BetaUserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.beta_user_service_register_totp_request import ( + BetaUserServiceRegisterTOTPRequest, +) +from zitadel_client.models.beta_user_service_register_totp_response import ( + BetaUserServiceRegisterTOTPResponse, +) +from zitadel_client.models.beta_user_service_register_u2_f_request import ( + BetaUserServiceRegisterU2FRequest, +) +from zitadel_client.models.beta_user_service_register_u2_f_response import ( + BetaUserServiceRegisterU2FResponse, +) +from zitadel_client.models.beta_user_service_remove_otp_email_request import ( + BetaUserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_remove_otp_email_response import ( + BetaUserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_remove_otpsms_request import ( + BetaUserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_remove_otpsms_response import ( + BetaUserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_remove_phone_request import ( + BetaUserServiceRemovePhoneRequest, +) +from zitadel_client.models.beta_user_service_remove_phone_response import ( + BetaUserServiceRemovePhoneResponse, +) +from zitadel_client.models.beta_user_service_remove_totp_request import ( + BetaUserServiceRemoveTOTPRequest, +) +from zitadel_client.models.beta_user_service_remove_totp_response import ( + BetaUserServiceRemoveTOTPResponse, +) +from zitadel_client.models.beta_user_service_resend_email_code_request import ( + BetaUserServiceResendEmailCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_email_code_response import ( + BetaUserServiceResendEmailCodeResponse, +) +from zitadel_client.models.beta_user_service_resend_phone_code_request import ( + BetaUserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_phone_code_response import ( + BetaUserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_request import ( + BetaUserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_response import ( + BetaUserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_set_email_request import ( + BetaUserServiceSetEmailRequest, +) +from zitadel_client.models.beta_user_service_set_email_response import ( + BetaUserServiceSetEmailResponse, +) +from zitadel_client.models.beta_user_service_set_password_request import ( + BetaUserServiceSetPasswordRequest, +) +from zitadel_client.models.beta_user_service_set_password_response import ( + BetaUserServiceSetPasswordResponse, +) +from zitadel_client.models.beta_user_service_set_phone_request import ( + BetaUserServiceSetPhoneRequest, +) +from zitadel_client.models.beta_user_service_set_phone_response import ( + BetaUserServiceSetPhoneResponse, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_request import ( + BetaUserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_response import ( + BetaUserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_unlock_user_request import ( + BetaUserServiceUnlockUserRequest, +) +from zitadel_client.models.beta_user_service_unlock_user_response import ( + BetaUserServiceUnlockUserResponse, +) +from zitadel_client.models.beta_user_service_update_human_user_request import ( + BetaUserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.beta_user_service_update_human_user_response import ( + BetaUserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.beta_user_service_verify_email_request import ( + BetaUserServiceVerifyEmailRequest, +) +from zitadel_client.models.beta_user_service_verify_email_response import ( + BetaUserServiceVerifyEmailResponse, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_request import ( + BetaUserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_response import ( + BetaUserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_phone_request import ( + BetaUserServiceVerifyPhoneRequest, +) +from zitadel_client.models.beta_user_service_verify_phone_response import ( + BetaUserServiceVerifyPhoneResponse, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_request import ( + BetaUserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_response import ( + BetaUserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_request import ( + BetaUserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_response import ( + BetaUserServiceVerifyU2FRegistrationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaUserServiceApi(BaseApi): + """BetaUserServiceApi provides methods for the BetaUserService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def add_human_user( + self, + beta_user_service_add_human_user_request: BetaUserServiceAddHumanUserRequest, + ) -> BetaUserServiceAddHumanUserResponse: + """Create a new human user Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. Deprecated: please move to the corresponding endpoint under user service v2 (GA) + :param beta_user_service_add_human_user_request: (required) - :param beta_user_service_add_human_user_request: (required) - :type beta_user_service_add_human_user_request: BetaUserServiceAddHumanUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_human_user_serialize( - beta_user_service_add_human_user_request=beta_user_service_add_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceAddHumanUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_human_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_human_user_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceAddHumanUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.add_human_user_with_http_info( + beta_user_service_add_human_user_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _add_human_user_serialize( - self, - beta_user_service_add_human_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_add_human_user_request is not None: - _body_params = beta_user_service_add_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/AddHumanUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def add_human_user_with_http_info( + self, + beta_user_service_add_human_user_request: BetaUserServiceAddHumanUserRequest, + ) -> "ApiResult[BetaUserServiceAddHumanUserResponse]": + """Create a new human user (with HTTP info) + Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. Deprecated: please move to the corresponding endpoint under user service v2 (GA) + :param beta_user_service_add_human_user_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_human_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_human_user_request'" + ) + path = "/zitadel.user.v2beta.UserService/AddHumanUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_add_human_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceAddHumanUserResponse", + None, + ) - @validate_call - def add_idp_link( self, beta_user_service_add_idp_link_request: BetaUserServiceAddIDPLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceAddIDPLinkResponse: + async def add_idp_link( + self, + beta_user_service_add_idp_link_request: BetaUserServiceAddIDPLinkRequest, + ) -> BetaUserServiceAddIDPLinkResponse: """Add link to an identity provider to an user - Add link to an identity provider to an user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_idp_link_request: (required) - :param beta_user_service_add_idp_link_request: (required) - :type beta_user_service_add_idp_link_request: BetaUserServiceAddIDPLinkRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_idp_link_serialize( - beta_user_service_add_idp_link_request=beta_user_service_add_idp_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceAddIDPLinkResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _add_idp_link_serialize( - self, - beta_user_service_add_idp_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_add_idp_link_request is not None: - _body_params = beta_user_service_add_idp_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceAddIDPLinkResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_idp_link_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/AddIDPLink', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.add_idp_link_with_http_info( + beta_user_service_add_idp_link_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def add_otp_email( self, beta_user_service_add_otp_email_request: BetaUserServiceAddOTPEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceAddOTPEmailResponse: + async def add_idp_link_with_http_info( + self, + beta_user_service_add_idp_link_request: BetaUserServiceAddIDPLinkRequest, + ) -> "ApiResult[BetaUserServiceAddIDPLinkResponse]": + """Add link to an identity provider to an user (with HTTP info) + Add link to an identity provider to an user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_idp_link_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_idp_link_request'" + ) + + path = "/zitadel.user.v2beta.UserService/AddIDPLink" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_add_idp_link_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceAddIDPLinkResponse", + None, + ) + + async def add_otp_email( + self, + beta_user_service_add_otp_email_request: BetaUserServiceAddOTPEmailRequest, + ) -> BetaUserServiceAddOTPEmailResponse: """Add OTP Email for a user - Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_otp_email_request: (required) - :param beta_user_service_add_otp_email_request: (required) - :type beta_user_service_add_otp_email_request: BetaUserServiceAddOTPEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_otp_email_serialize( - beta_user_service_add_otp_email_request=beta_user_service_add_otp_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceAddOTPEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _add_otp_email_serialize( - self, - beta_user_service_add_otp_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_add_otp_email_request is not None: - _body_params = beta_user_service_add_otp_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceAddOTPEmailResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_otp_email_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/AddOTPEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.add_otp_email_with_http_info( + beta_user_service_add_otp_email_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def add_otpsms( self, beta_user_service_add_otpsms_request: BetaUserServiceAddOTPSMSRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceAddOTPSMSResponse: + async def add_otp_email_with_http_info( + self, + beta_user_service_add_otp_email_request: BetaUserServiceAddOTPEmailRequest, + ) -> "ApiResult[BetaUserServiceAddOTPEmailResponse]": + """Add OTP Email for a user (with HTTP info) + Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_otp_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_otp_email_request'" + ) + + path = "/zitadel.user.v2beta.UserService/AddOTPEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_add_otp_email_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceAddOTPEmailResponse", + None, + ) + + async def add_otpsms( + self, + beta_user_service_add_otpsms_request: BetaUserServiceAddOTPSMSRequest, + ) -> BetaUserServiceAddOTPSMSResponse: """Add OTP SMS for a user - Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_otpsms_request: (required) - :param beta_user_service_add_otpsms_request: (required) - :type beta_user_service_add_otpsms_request: BetaUserServiceAddOTPSMSRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_otpsms_serialize( - beta_user_service_add_otpsms_request=beta_user_service_add_otpsms_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceAddOTPSMSResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _add_otpsms_serialize( - self, - beta_user_service_add_otpsms_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_add_otpsms_request is not None: - _body_params = beta_user_service_add_otpsms_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceAddOTPSMSResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_otpsms_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/AddOTPSMS', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.add_otpsms_with_http_info( + beta_user_service_add_otpsms_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def create_passkey_registration_link( self, beta_user_service_create_passkey_registration_link_request: Optional[BetaUserServiceCreatePasskeyRegistrationLinkRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceCreatePasskeyRegistrationLinkResponse: - if beta_user_service_create_passkey_registration_link_request is None: - beta_user_service_create_passkey_registration_link_request = {} + async def add_otpsms_with_http_info( + self, + beta_user_service_add_otpsms_request: BetaUserServiceAddOTPSMSRequest, + ) -> "ApiResult[BetaUserServiceAddOTPSMSResponse]": + """Add OTP SMS for a user (with HTTP info) + Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_add_otpsms_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_add_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_add_otpsms_request'" + ) + + path = "/zitadel.user.v2beta.UserService/AddOTPSMS" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_add_otpsms_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceAddOTPSMSResponse", + None, + ) + + async def create_passkey_registration_link( + self, + beta_user_service_create_passkey_registration_link_request: BetaUserServiceCreatePasskeyRegistrationLinkRequest, + ) -> BetaUserServiceCreatePasskeyRegistrationLinkResponse: """Create a passkey registration link for a user - Create a passkey registration link which includes a code and either return it or send it to the user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_create_passkey_registration_link_request: (required) - :param beta_user_service_create_passkey_registration_link_request: (required) - :type beta_user_service_create_passkey_registration_link_request: BetaUserServiceCreatePasskeyRegistrationLinkRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_passkey_registration_link_serialize( - beta_user_service_create_passkey_registration_link_request=beta_user_service_create_passkey_registration_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceCreatePasskeyRegistrationLinkResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_create_passkey_registration_link_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceCreatePasskeyRegistrationLinkResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_passkey_registration_link_with_http_info( + beta_user_service_create_passkey_registration_link_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_passkey_registration_link_serialize( - self, - beta_user_service_create_passkey_registration_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_create_passkey_registration_link_request is not None: - _body_params = beta_user_service_create_passkey_registration_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/CreatePasskeyRegistrationLink', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def create_passkey_registration_link_with_http_info( + self, + beta_user_service_create_passkey_registration_link_request: BetaUserServiceCreatePasskeyRegistrationLinkRequest, + ) -> "ApiResult[BetaUserServiceCreatePasskeyRegistrationLinkResponse]": + """Create a passkey registration link for a user (with HTTP info) + Create a passkey registration link which includes a code and either return it or send it to the user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_create_passkey_registration_link_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_create_passkey_registration_link_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_create_passkey_registration_link_request'" + ) + path = "/zitadel.user.v2beta.UserService/CreatePasskeyRegistrationLink" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_create_passkey_registration_link_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceCreatePasskeyRegistrationLinkResponse", + None, + ) - @validate_call - def deactivate_user( self, beta_user_service_deactivate_user_request: BetaUserServiceDeactivateUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceDeactivateUserResponse: + async def deactivate_user( + self, + beta_user_service_deactivate_user_request: BetaUserServiceDeactivateUserRequest, + ) -> BetaUserServiceDeactivateUserResponse: """Deactivate user - The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_deactivate_user_request: (required) - :param beta_user_service_deactivate_user_request: (required) - :type beta_user_service_deactivate_user_request: BetaUserServiceDeactivateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_user_serialize( - beta_user_service_deactivate_user_request=beta_user_service_deactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceDeactivateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _deactivate_user_serialize( - self, - beta_user_service_deactivate_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_deactivate_user_request is not None: - _body_params = beta_user_service_deactivate_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceDeactivateUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_deactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_deactivate_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/DeactivateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.deactivate_user_with_http_info( + beta_user_service_deactivate_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def delete_user( self, beta_user_service_delete_user_request: BetaUserServiceDeleteUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceDeleteUserResponse: + async def deactivate_user_with_http_info( + self, + beta_user_service_deactivate_user_request: BetaUserServiceDeactivateUserRequest, + ) -> "ApiResult[BetaUserServiceDeactivateUserResponse]": + """Deactivate user (with HTTP info) + The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_deactivate_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_deactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_deactivate_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/DeactivateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_deactivate_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceDeactivateUserResponse", + None, + ) + + async def delete_user( + self, + beta_user_service_delete_user_request: BetaUserServiceDeleteUserRequest, + ) -> BetaUserServiceDeleteUserResponse: """Delete user - The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_delete_user_request: (required) - :param beta_user_service_delete_user_request: (required) - :type beta_user_service_delete_user_request: BetaUserServiceDeleteUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_serialize( - beta_user_service_delete_user_request=beta_user_service_delete_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceDeleteUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _delete_user_serialize( - self, - beta_user_service_delete_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_delete_user_request is not None: - _body_params = beta_user_service_delete_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceDeleteUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_delete_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_delete_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/DeleteUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.delete_user_with_http_info( + beta_user_service_delete_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def get_user_by_id( self, beta_user_service_get_user_by_id_request: BetaUserServiceGetUserByIDRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceGetUserByIDResponse: + async def delete_user_with_http_info( + self, + beta_user_service_delete_user_request: BetaUserServiceDeleteUserRequest, + ) -> "ApiResult[BetaUserServiceDeleteUserResponse]": + """Delete user (with HTTP info) + The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_delete_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_delete_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_delete_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/DeleteUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_delete_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceDeleteUserResponse", + None, + ) + + async def get_user_by_id( + self, + beta_user_service_get_user_by_id_request: BetaUserServiceGetUserByIDRequest, + ) -> BetaUserServiceGetUserByIDResponse: """User by ID - Returns the full user object (human or machine) including the profile, email, etc. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_get_user_by_id_request: (required) - :param beta_user_service_get_user_by_id_request: (required) - :type beta_user_service_get_user_by_id_request: BetaUserServiceGetUserByIDRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_by_id_serialize( - beta_user_service_get_user_by_id_request=beta_user_service_get_user_by_id_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceGetUserByIDResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _get_user_by_id_serialize( - self, - beta_user_service_get_user_by_id_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_get_user_by_id_request is not None: - _body_params = beta_user_service_get_user_by_id_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceGetUserByIDResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_get_user_by_id_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_get_user_by_id_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/GetUserByID', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.get_user_by_id_with_http_info( + beta_user_service_get_user_by_id_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def list_authentication_method_types( self, beta_user_service_list_authentication_method_types_request: BetaUserServiceListAuthenticationMethodTypesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceListAuthenticationMethodTypesResponse: + async def get_user_by_id_with_http_info( + self, + beta_user_service_get_user_by_id_request: BetaUserServiceGetUserByIDRequest, + ) -> "ApiResult[BetaUserServiceGetUserByIDResponse]": + """User by ID (with HTTP info) + Returns the full user object (human or machine) including the profile, email, etc. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_get_user_by_id_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_get_user_by_id_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_get_user_by_id_request'" + ) + + path = "/zitadel.user.v2beta.UserService/GetUserByID" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_get_user_by_id_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceGetUserByIDResponse", + None, + ) + + async def list_authentication_method_types( + self, + beta_user_service_list_authentication_method_types_request: BetaUserServiceListAuthenticationMethodTypesRequest, + ) -> BetaUserServiceListAuthenticationMethodTypesResponse: """List all possible authentication methods of a user - List all possible authentication methods of a user like password, passwordless, (T)OTP and more. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_list_authentication_method_types_request: (required) - :param beta_user_service_list_authentication_method_types_request: (required) - :type beta_user_service_list_authentication_method_types_request: BetaUserServiceListAuthenticationMethodTypesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_authentication_method_types_serialize( - beta_user_service_list_authentication_method_types_request=beta_user_service_list_authentication_method_types_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceListAuthenticationMethodTypesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _list_authentication_method_types_serialize( - self, - beta_user_service_list_authentication_method_types_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_list_authentication_method_types_request is not None: - _body_params = beta_user_service_list_authentication_method_types_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceListAuthenticationMethodTypesResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_list_authentication_method_types_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_list_authentication_method_types_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/ListAuthenticationMethodTypes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.list_authentication_method_types_with_http_info( + beta_user_service_list_authentication_method_types_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def list_users( self, beta_user_service_list_users_request: BetaUserServiceListUsersRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceListUsersResponse: + async def list_authentication_method_types_with_http_info( + self, + beta_user_service_list_authentication_method_types_request: BetaUserServiceListAuthenticationMethodTypesRequest, + ) -> "ApiResult[BetaUserServiceListAuthenticationMethodTypesResponse]": + """List all possible authentication methods of a user (with HTTP info) + List all possible authentication methods of a user like password, passwordless, (T)OTP and more. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_list_authentication_method_types_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_list_authentication_method_types_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_list_authentication_method_types_request'" + ) + + path = "/zitadel.user.v2beta.UserService/ListAuthenticationMethodTypes" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_list_authentication_method_types_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceListAuthenticationMethodTypesResponse", + None, + ) + + async def list_users( + self, + beta_user_service_list_users_request: BetaUserServiceListUsersRequest, + ) -> BetaUserServiceListUsersResponse: """Search Users - Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_list_users_request: (required) - :param beta_user_service_list_users_request: (required) - :type beta_user_service_list_users_request: BetaUserServiceListUsersRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_users_serialize( - beta_user_service_list_users_request=beta_user_service_list_users_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceListUsersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _list_users_serialize( - self, - beta_user_service_list_users_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_list_users_request is not None: - _body_params = beta_user_service_list_users_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceListUsersResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_list_users_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_list_users_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/ListUsers', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.list_users_with_http_info( + beta_user_service_list_users_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def lock_user( self, beta_user_service_lock_user_request: BetaUserServiceLockUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceLockUserResponse: + async def list_users_with_http_info( + self, + beta_user_service_list_users_request: BetaUserServiceListUsersRequest, + ) -> "ApiResult[BetaUserServiceListUsersResponse]": + """Search Users (with HTTP info) + Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_list_users_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_list_users_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_list_users_request'" + ) + + path = "/zitadel.user.v2beta.UserService/ListUsers" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_list_users_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceListUsersResponse", + None, + ) + + async def lock_user( + self, + beta_user_service_lock_user_request: BetaUserServiceLockUserRequest, + ) -> BetaUserServiceLockUserResponse: """Lock user - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_lock_user_request: (required) - :param beta_user_service_lock_user_request: (required) - :type beta_user_service_lock_user_request: BetaUserServiceLockUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._lock_user_serialize( - beta_user_service_lock_user_request=beta_user_service_lock_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceLockUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _lock_user_serialize( - self, - beta_user_service_lock_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_lock_user_request is not None: - _body_params = beta_user_service_lock_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceLockUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_lock_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_lock_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/LockUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.lock_user_with_http_info( + beta_user_service_lock_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def password_reset( self, beta_user_service_password_reset_request: Optional[BetaUserServicePasswordResetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServicePasswordResetResponse: - if beta_user_service_password_reset_request is None: - beta_user_service_password_reset_request = {} + async def lock_user_with_http_info( + self, + beta_user_service_lock_user_request: BetaUserServiceLockUserRequest, + ) -> "ApiResult[BetaUserServiceLockUserResponse]": + """Lock user (with HTTP info) + The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_lock_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_lock_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_lock_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/LockUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_lock_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceLockUserResponse", + None, + ) + + async def password_reset( + self, + beta_user_service_password_reset_request: BetaUserServicePasswordResetRequest, + ) -> BetaUserServicePasswordResetResponse: """Request a code to reset a password - Request a code to reset a password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_password_reset_request: (required) - :param beta_user_service_password_reset_request: (required) - :type beta_user_service_password_reset_request: BetaUserServicePasswordResetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._password_reset_serialize( - beta_user_service_password_reset_request=beta_user_service_password_reset_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServicePasswordResetResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_password_reset_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_password_reset_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServicePasswordResetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.password_reset_with_http_info( + beta_user_service_password_reset_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _password_reset_serialize( - self, - beta_user_service_password_reset_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_password_reset_request is not None: - _body_params = beta_user_service_password_reset_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/PasswordReset', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def password_reset_with_http_info( + self, + beta_user_service_password_reset_request: BetaUserServicePasswordResetRequest, + ) -> "ApiResult[BetaUserServicePasswordResetResponse]": + """Request a code to reset a password (with HTTP info) + Request a code to reset a password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_password_reset_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_password_reset_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_password_reset_request'" + ) + path = "/zitadel.user.v2beta.UserService/PasswordReset" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_password_reset_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServicePasswordResetResponse", + None, + ) - @validate_call - def reactivate_user( self, beta_user_service_reactivate_user_request: BetaUserServiceReactivateUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceReactivateUserResponse: + async def reactivate_user( + self, + beta_user_service_reactivate_user_request: BetaUserServiceReactivateUserRequest, + ) -> BetaUserServiceReactivateUserResponse: """Reactivate user - Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_reactivate_user_request: (required) - :param beta_user_service_reactivate_user_request: (required) - :type beta_user_service_reactivate_user_request: BetaUserServiceReactivateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reactivate_user_serialize( - beta_user_service_reactivate_user_request=beta_user_service_reactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceReactivateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _reactivate_user_serialize( - self, - beta_user_service_reactivate_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_reactivate_user_request is not None: - _body_params = beta_user_service_reactivate_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceReactivateUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_reactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_reactivate_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/ReactivateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.reactivate_user_with_http_info( + beta_user_service_reactivate_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def register_passkey( self, beta_user_service_register_passkey_request: BetaUserServiceRegisterPasskeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRegisterPasskeyResponse: + async def reactivate_user_with_http_info( + self, + beta_user_service_reactivate_user_request: BetaUserServiceReactivateUserRequest, + ) -> "ApiResult[BetaUserServiceReactivateUserResponse]": + """Reactivate user (with HTTP info) + Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_reactivate_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_reactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_reactivate_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/ReactivateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_reactivate_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceReactivateUserResponse", + None, + ) + + async def register_passkey( + self, + beta_user_service_register_passkey_request: BetaUserServiceRegisterPasskeyRequest, + ) -> BetaUserServiceRegisterPasskeyResponse: """Start the registration of passkey for a user - Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_passkey_request: (required) - :param beta_user_service_register_passkey_request: (required) - :type beta_user_service_register_passkey_request: BetaUserServiceRegisterPasskeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_passkey_serialize( - beta_user_service_register_passkey_request=beta_user_service_register_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRegisterPasskeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _register_passkey_serialize( - self, - beta_user_service_register_passkey_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_register_passkey_request is not None: - _body_params = beta_user_service_register_passkey_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRegisterPasskeyResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_passkey_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_passkey_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RegisterPasskey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.register_passkey_with_http_info( + beta_user_service_register_passkey_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def register_totp( self, beta_user_service_register_totp_request: BetaUserServiceRegisterTOTPRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRegisterTOTPResponse: + async def register_passkey_with_http_info( + self, + beta_user_service_register_passkey_request: BetaUserServiceRegisterPasskeyRequest, + ) -> "ApiResult[BetaUserServiceRegisterPasskeyResponse]": + """Start the registration of passkey for a user (with HTTP info) + Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_passkey_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_passkey_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_passkey_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RegisterPasskey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_register_passkey_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRegisterPasskeyResponse", + None, + ) + + async def register_totp( + self, + beta_user_service_register_totp_request: BetaUserServiceRegisterTOTPRequest, + ) -> BetaUserServiceRegisterTOTPResponse: """Start the registration of a TOTP generator for a user - Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_totp_request: (required) - :param beta_user_service_register_totp_request: (required) - :type beta_user_service_register_totp_request: BetaUserServiceRegisterTOTPRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_totp_serialize( - beta_user_service_register_totp_request=beta_user_service_register_totp_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRegisterTOTPResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _register_totp_serialize( - self, - beta_user_service_register_totp_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_register_totp_request is not None: - _body_params = beta_user_service_register_totp_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRegisterTOTPResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_totp_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_totp_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RegisterTOTP', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.register_totp_with_http_info( + beta_user_service_register_totp_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def register_u2_f( self, beta_user_service_register_u2_f_request: BetaUserServiceRegisterU2FRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRegisterU2FResponse: + async def register_totp_with_http_info( + self, + beta_user_service_register_totp_request: BetaUserServiceRegisterTOTPRequest, + ) -> "ApiResult[BetaUserServiceRegisterTOTPResponse]": + """Start the registration of a TOTP generator for a user (with HTTP info) + Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_totp_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_totp_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_totp_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RegisterTOTP" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_register_totp_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRegisterTOTPResponse", + None, + ) + + async def register_u2_f( + self, + beta_user_service_register_u2_f_request: BetaUserServiceRegisterU2FRequest, + ) -> BetaUserServiceRegisterU2FResponse: """Start the registration of a u2f token for a user - Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_u2_f_request: (required) - :param beta_user_service_register_u2_f_request: (required) - :type beta_user_service_register_u2_f_request: BetaUserServiceRegisterU2FRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_u2_f_serialize( - beta_user_service_register_u2_f_request=beta_user_service_register_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRegisterU2FResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _register_u2_f_serialize( - self, - beta_user_service_register_u2_f_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_register_u2_f_request is not None: - _body_params = beta_user_service_register_u2_f_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRegisterU2FResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_u2_f_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RegisterU2F', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.register_u2_f_with_http_info( + beta_user_service_register_u2_f_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def remove_otp_email( self, beta_user_service_remove_otp_email_request: BetaUserServiceRemoveOTPEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRemoveOTPEmailResponse: + async def register_u2_f_with_http_info( + self, + beta_user_service_register_u2_f_request: BetaUserServiceRegisterU2FRequest, + ) -> "ApiResult[BetaUserServiceRegisterU2FResponse]": + """Start the registration of a u2f token for a user (with HTTP info) + Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_register_u2_f_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_register_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_register_u2_f_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RegisterU2F" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_register_u2_f_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRegisterU2FResponse", + None, + ) + + async def remove_otp_email( + self, + beta_user_service_remove_otp_email_request: BetaUserServiceRemoveOTPEmailRequest, + ) -> BetaUserServiceRemoveOTPEmailResponse: """Remove One-Time Password (OTP) Email from a user - Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_otp_email_request: (required) - :param beta_user_service_remove_otp_email_request: (required) - :type beta_user_service_remove_otp_email_request: BetaUserServiceRemoveOTPEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_otp_email_serialize( - beta_user_service_remove_otp_email_request=beta_user_service_remove_otp_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRemoveOTPEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _remove_otp_email_serialize( - self, - beta_user_service_remove_otp_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_remove_otp_email_request is not None: - _body_params = beta_user_service_remove_otp_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRemoveOTPEmailResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_otp_email_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RemoveOTPEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.remove_otp_email_with_http_info( + beta_user_service_remove_otp_email_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def remove_otpsms( self, beta_user_service_remove_otpsms_request: BetaUserServiceRemoveOTPSMSRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRemoveOTPSMSResponse: + async def remove_otp_email_with_http_info( + self, + beta_user_service_remove_otp_email_request: BetaUserServiceRemoveOTPEmailRequest, + ) -> "ApiResult[BetaUserServiceRemoveOTPEmailResponse]": + """Remove One-Time Password (OTP) Email from a user (with HTTP info) + Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_otp_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_otp_email_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RemoveOTPEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_remove_otp_email_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRemoveOTPEmailResponse", + None, + ) + + async def remove_otpsms( + self, + beta_user_service_remove_otpsms_request: BetaUserServiceRemoveOTPSMSRequest, + ) -> BetaUserServiceRemoveOTPSMSResponse: """Remove One-Time Password (OTP) SMS from a user - Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_otpsms_request: (required) - :param beta_user_service_remove_otpsms_request: (required) - :type beta_user_service_remove_otpsms_request: BetaUserServiceRemoveOTPSMSRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_otpsms_serialize( - beta_user_service_remove_otpsms_request=beta_user_service_remove_otpsms_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRemoveOTPSMSResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _remove_otpsms_serialize( - self, - beta_user_service_remove_otpsms_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_remove_otpsms_request is not None: - _body_params = beta_user_service_remove_otpsms_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRemoveOTPSMSResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_otpsms_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RemoveOTPSMS', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.remove_otpsms_with_http_info( + beta_user_service_remove_otpsms_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def remove_phone( self, beta_user_service_remove_phone_request: BetaUserServiceRemovePhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRemovePhoneResponse: + async def remove_otpsms_with_http_info( + self, + beta_user_service_remove_otpsms_request: BetaUserServiceRemoveOTPSMSRequest, + ) -> "ApiResult[BetaUserServiceRemoveOTPSMSResponse]": + """Remove One-Time Password (OTP) SMS from a user (with HTTP info) + Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_otpsms_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_otpsms_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RemoveOTPSMS" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_remove_otpsms_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRemoveOTPSMSResponse", + None, + ) + + async def remove_phone( + self, + beta_user_service_remove_phone_request: BetaUserServiceRemovePhoneRequest, + ) -> BetaUserServiceRemovePhoneResponse: """Remove the user phone - Remove the user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_phone_request: (required) - :param beta_user_service_remove_phone_request: (required) - :type beta_user_service_remove_phone_request: BetaUserServiceRemovePhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_phone_serialize( - beta_user_service_remove_phone_request=beta_user_service_remove_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRemovePhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _remove_phone_serialize( - self, - beta_user_service_remove_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_remove_phone_request is not None: - _body_params = beta_user_service_remove_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRemovePhoneResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_phone_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RemovePhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.remove_phone_with_http_info( + beta_user_service_remove_phone_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def remove_totp( self, beta_user_service_remove_totp_request: BetaUserServiceRemoveTOTPRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRemoveTOTPResponse: + async def remove_phone_with_http_info( + self, + beta_user_service_remove_phone_request: BetaUserServiceRemovePhoneRequest, + ) -> "ApiResult[BetaUserServiceRemovePhoneResponse]": + """Remove the user phone (with HTTP info) + Remove the user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_phone_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_phone_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RemovePhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_remove_phone_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRemovePhoneResponse", + None, + ) + + async def remove_totp( + self, + beta_user_service_remove_totp_request: BetaUserServiceRemoveTOTPRequest, + ) -> BetaUserServiceRemoveTOTPResponse: """Remove TOTP generator from a user - Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_totp_request: (required) - :param beta_user_service_remove_totp_request: (required) - :type beta_user_service_remove_totp_request: BetaUserServiceRemoveTOTPRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_totp_serialize( - beta_user_service_remove_totp_request=beta_user_service_remove_totp_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRemoveTOTPResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _remove_totp_serialize( - self, - beta_user_service_remove_totp_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_remove_totp_request is not None: - _body_params = beta_user_service_remove_totp_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRemoveTOTPResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_totp_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_totp_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RemoveTOTP', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.remove_totp_with_http_info( + beta_user_service_remove_totp_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def resend_email_code( self, beta_user_service_resend_email_code_request: Optional[BetaUserServiceResendEmailCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceResendEmailCodeResponse: - if beta_user_service_resend_email_code_request is None: - beta_user_service_resend_email_code_request = {} + async def remove_totp_with_http_info( + self, + beta_user_service_remove_totp_request: BetaUserServiceRemoveTOTPRequest, + ) -> "ApiResult[BetaUserServiceRemoveTOTPResponse]": + """Remove TOTP generator from a user (with HTTP info) + Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_remove_totp_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_remove_totp_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_remove_totp_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RemoveTOTP" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_remove_totp_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRemoveTOTPResponse", + None, + ) + + async def resend_email_code( + self, + beta_user_service_resend_email_code_request: BetaUserServiceResendEmailCodeRequest, + ) -> BetaUserServiceResendEmailCodeResponse: """Resend code to verify user email - Resend code to verify user email Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_resend_email_code_request: (required) - :param beta_user_service_resend_email_code_request: (required) - :type beta_user_service_resend_email_code_request: BetaUserServiceResendEmailCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._resend_email_code_serialize( - beta_user_service_resend_email_code_request=beta_user_service_resend_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceResendEmailCodeResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_resend_email_code_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_resend_email_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceResendEmailCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.resend_email_code_with_http_info( + beta_user_service_resend_email_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _resend_email_code_serialize( - self, - beta_user_service_resend_email_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_resend_email_code_request is not None: - _body_params = beta_user_service_resend_email_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/ResendEmailCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def resend_email_code_with_http_info( + self, + beta_user_service_resend_email_code_request: BetaUserServiceResendEmailCodeRequest, + ) -> "ApiResult[BetaUserServiceResendEmailCodeResponse]": + """Resend code to verify user email (with HTTP info) + Resend code to verify user email Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_resend_email_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_resend_email_code_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_resend_email_code_request'" + ) + path = "/zitadel.user.v2beta.UserService/ResendEmailCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_resend_email_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceResendEmailCodeResponse", + None, + ) - @validate_call - def resend_phone_code( self, beta_user_service_resend_phone_code_request: Optional[BetaUserServiceResendPhoneCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceResendPhoneCodeResponse: - if beta_user_service_resend_phone_code_request is None: - beta_user_service_resend_phone_code_request = {} + async def resend_phone_code( + self, + beta_user_service_resend_phone_code_request: BetaUserServiceResendPhoneCodeRequest, + ) -> BetaUserServiceResendPhoneCodeResponse: """Resend code to verify user phone - Resend code to verify user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_resend_phone_code_request: (required) - :param beta_user_service_resend_phone_code_request: (required) - :type beta_user_service_resend_phone_code_request: BetaUserServiceResendPhoneCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._resend_phone_code_serialize( - beta_user_service_resend_phone_code_request=beta_user_service_resend_phone_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceResendPhoneCodeResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_resend_phone_code_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_resend_phone_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceResendPhoneCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.resend_phone_code_with_http_info( + beta_user_service_resend_phone_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _resend_phone_code_serialize( - self, - beta_user_service_resend_phone_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_resend_phone_code_request is not None: - _body_params = beta_user_service_resend_phone_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/ResendPhoneCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def resend_phone_code_with_http_info( + self, + beta_user_service_resend_phone_code_request: BetaUserServiceResendPhoneCodeRequest, + ) -> "ApiResult[BetaUserServiceResendPhoneCodeResponse]": + """Resend code to verify user phone (with HTTP info) + Resend code to verify user phone Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_resend_phone_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_resend_phone_code_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_resend_phone_code_request'" + ) + path = "/zitadel.user.v2beta.UserService/ResendPhoneCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_resend_phone_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceResendPhoneCodeResponse", + None, + ) - @validate_call - def retrieve_identity_provider_intent( self, beta_user_service_retrieve_identity_provider_intent_request: BetaUserServiceRetrieveIdentityProviderIntentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceRetrieveIdentityProviderIntentResponse: + async def retrieve_identity_provider_intent( + self, + beta_user_service_retrieve_identity_provider_intent_request: BetaUserServiceRetrieveIdentityProviderIntentRequest, + ) -> BetaUserServiceRetrieveIdentityProviderIntentResponse: """Retrieve the information returned by the identity provider - Retrieve the information returned by the identity provider for registration or updating an existing user with new information. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_retrieve_identity_provider_intent_request: (required) - :param beta_user_service_retrieve_identity_provider_intent_request: (required) - :type beta_user_service_retrieve_identity_provider_intent_request: BetaUserServiceRetrieveIdentityProviderIntentRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._retrieve_identity_provider_intent_serialize( - beta_user_service_retrieve_identity_provider_intent_request=beta_user_service_retrieve_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceRetrieveIdentityProviderIntentResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _retrieve_identity_provider_intent_serialize( - self, - beta_user_service_retrieve_identity_provider_intent_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_retrieve_identity_provider_intent_request is not None: - _body_params = beta_user_service_retrieve_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceRetrieveIdentityProviderIntentResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_retrieve_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/RetrieveIdentityProviderIntent', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.retrieve_identity_provider_intent_with_http_info( + beta_user_service_retrieve_identity_provider_intent_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def set_email( self, beta_user_service_set_email_request: Optional[BetaUserServiceSetEmailRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceSetEmailResponse: - if beta_user_service_set_email_request is None: - beta_user_service_set_email_request = {} + async def retrieve_identity_provider_intent_with_http_info( + self, + beta_user_service_retrieve_identity_provider_intent_request: BetaUserServiceRetrieveIdentityProviderIntentRequest, + ) -> "ApiResult[BetaUserServiceRetrieveIdentityProviderIntentResponse]": + """Retrieve the information returned by the identity provider (with HTTP info) + Retrieve the information returned by the identity provider for registration or updating an existing user with new information. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_retrieve_identity_provider_intent_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_retrieve_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_retrieve_identity_provider_intent_request'" + ) + + path = "/zitadel.user.v2beta.UserService/RetrieveIdentityProviderIntent" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_retrieve_identity_provider_intent_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceRetrieveIdentityProviderIntentResponse", + None, + ) + + async def set_email( + self, + beta_user_service_set_email_request: BetaUserServiceSetEmailRequest, + ) -> BetaUserServiceSetEmailResponse: """Change the user email - Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_email_request: (required) - :param beta_user_service_set_email_request: (required) - :type beta_user_service_set_email_request: BetaUserServiceSetEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_email_serialize( - beta_user_service_set_email_request=beta_user_service_set_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceSetEmailResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_email_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceSetEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_email_with_http_info( + beta_user_service_set_email_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_email_serialize( - self, - beta_user_service_set_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_set_email_request is not None: - _body_params = beta_user_service_set_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/SetEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def set_email_with_http_info( + self, + beta_user_service_set_email_request: BetaUserServiceSetEmailRequest, + ) -> "ApiResult[BetaUserServiceSetEmailResponse]": + """Change the user email (with HTTP info) + Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_email_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_email_request'" + ) + path = "/zitadel.user.v2beta.UserService/SetEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_set_email_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceSetEmailResponse", + None, + ) - @validate_call - def set_password( self, beta_user_service_set_password_request: Optional[BetaUserServiceSetPasswordRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceSetPasswordResponse: - if beta_user_service_set_password_request is None: - beta_user_service_set_password_request = {} + async def set_password( + self, + beta_user_service_set_password_request: BetaUserServiceSetPasswordRequest, + ) -> BetaUserServiceSetPasswordResponse: """Change password - Change the password of a user with either a verification code or the current password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_password_request: (required) - :param beta_user_service_set_password_request: (required) - :type beta_user_service_set_password_request: BetaUserServiceSetPasswordRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_password_serialize( - beta_user_service_set_password_request=beta_user_service_set_password_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceSetPasswordResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_password_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_password_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceSetPasswordResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_password_with_http_info( + beta_user_service_set_password_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_password_serialize( - self, - beta_user_service_set_password_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_set_password_request is not None: - _body_params = beta_user_service_set_password_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/SetPassword', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def set_password_with_http_info( + self, + beta_user_service_set_password_request: BetaUserServiceSetPasswordRequest, + ) -> "ApiResult[BetaUserServiceSetPasswordResponse]": + """Change password (with HTTP info) + Change the password of a user with either a verification code or the current password. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_password_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_password_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_password_request'" + ) + path = "/zitadel.user.v2beta.UserService/SetPassword" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_set_password_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceSetPasswordResponse", + None, + ) - @validate_call - def set_phone( self, beta_user_service_set_phone_request: Optional[BetaUserServiceSetPhoneRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceSetPhoneResponse: - if beta_user_service_set_phone_request is None: - beta_user_service_set_phone_request = {} + async def set_phone( + self, + beta_user_service_set_phone_request: BetaUserServiceSetPhoneRequest, + ) -> BetaUserServiceSetPhoneResponse: """Set the user phone - Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_phone_request: (required) - :param beta_user_service_set_phone_request: (required) - :type beta_user_service_set_phone_request: BetaUserServiceSetPhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_phone_serialize( - beta_user_service_set_phone_request=beta_user_service_set_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceSetPhoneResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_phone_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceSetPhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_phone_with_http_info( + beta_user_service_set_phone_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_phone_serialize( - self, - beta_user_service_set_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_set_phone_request is not None: - _body_params = beta_user_service_set_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/SetPhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def set_phone_with_http_info( + self, + beta_user_service_set_phone_request: BetaUserServiceSetPhoneRequest, + ) -> "ApiResult[BetaUserServiceSetPhoneResponse]": + """Set the user phone (with HTTP info) + Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_set_phone_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_set_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_set_phone_request'" + ) + path = "/zitadel.user.v2beta.UserService/SetPhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_set_phone_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceSetPhoneResponse", + None, + ) - @validate_call - def start_identity_provider_intent( self, beta_user_service_start_identity_provider_intent_request: Optional[BetaUserServiceStartIdentityProviderIntentRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceStartIdentityProviderIntentResponse: - if beta_user_service_start_identity_provider_intent_request is None: - beta_user_service_start_identity_provider_intent_request = {} + async def start_identity_provider_intent( + self, + beta_user_service_start_identity_provider_intent_request: BetaUserServiceStartIdentityProviderIntentRequest, + ) -> BetaUserServiceStartIdentityProviderIntentResponse: """Start flow with an identity provider - Start a flow with an identity provider, for external login, registration or linking. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_start_identity_provider_intent_request: (required) - :param beta_user_service_start_identity_provider_intent_request: (required) - :type beta_user_service_start_identity_provider_intent_request: BetaUserServiceStartIdentityProviderIntentRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_identity_provider_intent_serialize( - beta_user_service_start_identity_provider_intent_request=beta_user_service_start_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceStartIdentityProviderIntentResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_start_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceStartIdentityProviderIntentResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.start_identity_provider_intent_with_http_info( + beta_user_service_start_identity_provider_intent_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _start_identity_provider_intent_serialize( - self, - beta_user_service_start_identity_provider_intent_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_start_identity_provider_intent_request is not None: - _body_params = beta_user_service_start_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/StartIdentityProviderIntent', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def start_identity_provider_intent_with_http_info( + self, + beta_user_service_start_identity_provider_intent_request: BetaUserServiceStartIdentityProviderIntentRequest, + ) -> "ApiResult[BetaUserServiceStartIdentityProviderIntentResponse]": + """Start flow with an identity provider (with HTTP info) + Start a flow with an identity provider, for external login, registration or linking. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_start_identity_provider_intent_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_start_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_start_identity_provider_intent_request'" + ) + path = "/zitadel.user.v2beta.UserService/StartIdentityProviderIntent" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_start_identity_provider_intent_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceStartIdentityProviderIntentResponse", + None, + ) - @validate_call - def unlock_user( self, beta_user_service_unlock_user_request: BetaUserServiceUnlockUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceUnlockUserResponse: + async def unlock_user( + self, + beta_user_service_unlock_user_request: BetaUserServiceUnlockUserRequest, + ) -> BetaUserServiceUnlockUserResponse: """Unlock user - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_unlock_user_request: (required) - :param beta_user_service_unlock_user_request: (required) - :type beta_user_service_unlock_user_request: BetaUserServiceUnlockUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unlock_user_serialize( - beta_user_service_unlock_user_request=beta_user_service_unlock_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceUnlockUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _unlock_user_serialize( - self, - beta_user_service_unlock_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_unlock_user_request is not None: - _body_params = beta_user_service_unlock_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceUnlockUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_unlock_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_unlock_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/UnlockUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.unlock_user_with_http_info( + beta_user_service_unlock_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def update_human_user( self, beta_user_service_update_human_user_request: BetaUserServiceUpdateHumanUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceUpdateHumanUserResponse: + async def unlock_user_with_http_info( + self, + beta_user_service_unlock_user_request: BetaUserServiceUnlockUserRequest, + ) -> "ApiResult[BetaUserServiceUnlockUserResponse]": + """Unlock user (with HTTP info) + The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.). Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_unlock_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_unlock_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_unlock_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/UnlockUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_unlock_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceUnlockUserResponse", + None, + ) + + async def update_human_user( + self, + beta_user_service_update_human_user_request: BetaUserServiceUpdateHumanUserRequest, + ) -> BetaUserServiceUpdateHumanUserResponse: """Update User - Update all information from a user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_update_human_user_request: (required) - :param beta_user_service_update_human_user_request: (required) - :type beta_user_service_update_human_user_request: BetaUserServiceUpdateHumanUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_human_user_serialize( - beta_user_service_update_human_user_request=beta_user_service_update_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceUpdateHumanUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _update_human_user_serialize( - self, - beta_user_service_update_human_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_update_human_user_request is not None: - _body_params = beta_user_service_update_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceUpdateHumanUserResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_update_human_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_update_human_user_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/UpdateHumanUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.update_human_user_with_http_info( + beta_user_service_update_human_user_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def verify_email( self, beta_user_service_verify_email_request: BetaUserServiceVerifyEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceVerifyEmailResponse: + async def update_human_user_with_http_info( + self, + beta_user_service_update_human_user_request: BetaUserServiceUpdateHumanUserRequest, + ) -> "ApiResult[BetaUserServiceUpdateHumanUserResponse]": + """Update User (with HTTP info) + Update all information from a user. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_update_human_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_update_human_user_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_update_human_user_request'" + ) + + path = "/zitadel.user.v2beta.UserService/UpdateHumanUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_update_human_user_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceUpdateHumanUserResponse", + None, + ) + + async def verify_email( + self, + beta_user_service_verify_email_request: BetaUserServiceVerifyEmailRequest, + ) -> BetaUserServiceVerifyEmailResponse: """Verify the email - Verify the email with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_email_request: (required) - :param beta_user_service_verify_email_request: (required) - :type beta_user_service_verify_email_request: BetaUserServiceVerifyEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_email_serialize( - beta_user_service_verify_email_request=beta_user_service_verify_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceVerifyEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _verify_email_serialize( - self, - beta_user_service_verify_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_verify_email_request is not None: - _body_params = beta_user_service_verify_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceVerifyEmailResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_email_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/VerifyEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.verify_email_with_http_info( + beta_user_service_verify_email_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def verify_passkey_registration( self, beta_user_service_verify_passkey_registration_request: BetaUserServiceVerifyPasskeyRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceVerifyPasskeyRegistrationResponse: + async def verify_email_with_http_info( + self, + beta_user_service_verify_email_request: BetaUserServiceVerifyEmailRequest, + ) -> "ApiResult[BetaUserServiceVerifyEmailResponse]": + """Verify the email (with HTTP info) + Verify the email with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_email_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_email_request'" + ) + + path = "/zitadel.user.v2beta.UserService/VerifyEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_verify_email_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceVerifyEmailResponse", + None, + ) + + async def verify_passkey_registration( + self, + beta_user_service_verify_passkey_registration_request: BetaUserServiceVerifyPasskeyRegistrationRequest, + ) -> BetaUserServiceVerifyPasskeyRegistrationResponse: """Verify a passkey for a user - Verify the passkey registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_passkey_registration_request: (required) - :param beta_user_service_verify_passkey_registration_request: (required) - :type beta_user_service_verify_passkey_registration_request: BetaUserServiceVerifyPasskeyRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_passkey_registration_serialize( - beta_user_service_verify_passkey_registration_request=beta_user_service_verify_passkey_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceVerifyPasskeyRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _verify_passkey_registration_serialize( - self, - beta_user_service_verify_passkey_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_verify_passkey_registration_request is not None: - _body_params = beta_user_service_verify_passkey_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceVerifyPasskeyRegistrationResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_passkey_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_passkey_registration_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/VerifyPasskeyRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.verify_passkey_registration_with_http_info( + beta_user_service_verify_passkey_registration_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def verify_phone( self, beta_user_service_verify_phone_request: BetaUserServiceVerifyPhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceVerifyPhoneResponse: + async def verify_passkey_registration_with_http_info( + self, + beta_user_service_verify_passkey_registration_request: BetaUserServiceVerifyPasskeyRegistrationRequest, + ) -> "ApiResult[BetaUserServiceVerifyPasskeyRegistrationResponse]": + """Verify a passkey for a user (with HTTP info) + Verify the passkey registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_passkey_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_passkey_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_passkey_registration_request'" + ) + + path = "/zitadel.user.v2beta.UserService/VerifyPasskeyRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_verify_passkey_registration_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceVerifyPasskeyRegistrationResponse", + None, + ) + + async def verify_phone( + self, + beta_user_service_verify_phone_request: BetaUserServiceVerifyPhoneRequest, + ) -> BetaUserServiceVerifyPhoneResponse: """Verify the phone - Verify the phone with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_phone_request: (required) - :param beta_user_service_verify_phone_request: (required) - :type beta_user_service_verify_phone_request: BetaUserServiceVerifyPhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_phone_serialize( - beta_user_service_verify_phone_request=beta_user_service_verify_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceVerifyPhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _verify_phone_serialize( - self, - beta_user_service_verify_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_verify_phone_request is not None: - _body_params = beta_user_service_verify_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceVerifyPhoneResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_phone_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/VerifyPhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.verify_phone_with_http_info( + beta_user_service_verify_phone_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def verify_totp_registration( self, beta_user_service_verify_totp_registration_request: BetaUserServiceVerifyTOTPRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceVerifyTOTPRegistrationResponse: + async def verify_phone_with_http_info( + self, + beta_user_service_verify_phone_request: BetaUserServiceVerifyPhoneRequest, + ) -> "ApiResult[BetaUserServiceVerifyPhoneResponse]": + """Verify the phone (with HTTP info) + Verify the phone with the generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_phone_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_phone_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_phone_request'" + ) + + path = "/zitadel.user.v2beta.UserService/VerifyPhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_verify_phone_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceVerifyPhoneResponse", + None, + ) + + async def verify_totp_registration( + self, + beta_user_service_verify_totp_registration_request: BetaUserServiceVerifyTOTPRegistrationRequest, + ) -> BetaUserServiceVerifyTOTPRegistrationResponse: """Verify a TOTP generator for a user - Verify the TOTP registration with a generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_totp_registration_request: (required) - :param beta_user_service_verify_totp_registration_request: (required) - :type beta_user_service_verify_totp_registration_request: BetaUserServiceVerifyTOTPRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_totp_registration_serialize( - beta_user_service_verify_totp_registration_request=beta_user_service_verify_totp_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceVerifyTOTPRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _verify_totp_registration_serialize( - self, - beta_user_service_verify_totp_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_verify_totp_registration_request is not None: - _body_params = beta_user_service_verify_totp_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + :return: BetaUserServiceVerifyTOTPRegistrationResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_totp_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_totp_registration_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/VerifyTOTPRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + result = await self.verify_totp_registration_with_http_info( + beta_user_service_verify_totp_registration_request ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - - - @validate_call - def verify_u2_f_registration( self, beta_user_service_verify_u2_f_registration_request: BetaUserServiceVerifyU2FRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaUserServiceVerifyU2FRegistrationResponse: + async def verify_totp_registration_with_http_info( + self, + beta_user_service_verify_totp_registration_request: BetaUserServiceVerifyTOTPRegistrationRequest, + ) -> "ApiResult[BetaUserServiceVerifyTOTPRegistrationResponse]": + """Verify a TOTP generator for a user (with HTTP info) + Verify the TOTP registration with a generated code. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_totp_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_totp_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_totp_registration_request'" + ) + + path = "/zitadel.user.v2beta.UserService/VerifyTOTPRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_verify_totp_registration_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceVerifyTOTPRegistrationResponse", + None, + ) + + async def verify_u2_f_registration( + self, + beta_user_service_verify_u2_f_registration_request: BetaUserServiceVerifyU2FRegistrationRequest, + ) -> BetaUserServiceVerifyU2FRegistrationResponse: """Verify a u2f token for a user - Verify the u2f token registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_u2_f_registration_request: (required) - :param beta_user_service_verify_u2_f_registration_request: (required) - :type beta_user_service_verify_u2_f_registration_request: BetaUserServiceVerifyU2FRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_u2_f_registration_serialize( - beta_user_service_verify_u2_f_registration_request=beta_user_service_verify_u2_f_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: BetaUserServiceVerifyU2FRegistrationResponse + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_u2_f_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaUserServiceVerifyU2FRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.verify_u2_f_registration_with_http_info( + beta_user_service_verify_u2_f_registration_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _verify_u2_f_registration_serialize( - self, - beta_user_service_verify_u2_f_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_user_service_verify_u2_f_registration_request is not None: - _body_params = beta_user_service_verify_u2_f_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2beta.UserService/VerifyU2FRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + async def verify_u2_f_registration_with_http_info( + self, + beta_user_service_verify_u2_f_registration_request: BetaUserServiceVerifyU2FRegistrationRequest, + ) -> "ApiResult[BetaUserServiceVerifyU2FRegistrationResponse]": + """Verify a u2f token for a user (with HTTP info) + Verify the u2f token registration with the public key credential. Deprecated: please move to the corresponding endpoint under user service v2 (GA). + :param beta_user_service_verify_u2_f_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_user_service_verify_u2_f_registration_request is None: + raise ValueError( + "Missing the required parameter 'beta_user_service_verify_u2_f_registration_request'" + ) + + path = "/zitadel.user.v2beta.UserService/VerifyU2FRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_user_service_verify_u2_f_registration_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaUserServiceVerifyU2FRegistrationResponse", + None, ) - - diff --git a/zitadel_client/api/beta_web_key_service_api.py b/zitadel_client/api/beta_web_key_service_api.py index aa997f2d..e94ea200 100644 --- a/zitadel_client/api/beta_web_key_service_api.py +++ b/zitadel_client/api/beta_web_key_service_api.py @@ -1,557 +1,309 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.beta_web_key_service_activate_web_key_request import BetaWebKeyServiceActivateWebKeyRequest -from zitadel_client.models.beta_web_key_service_activate_web_key_response import BetaWebKeyServiceActivateWebKeyResponse -from zitadel_client.models.beta_web_key_service_create_web_key_request import BetaWebKeyServiceCreateWebKeyRequest -from zitadel_client.models.beta_web_key_service_create_web_key_response import BetaWebKeyServiceCreateWebKeyResponse -from zitadel_client.models.beta_web_key_service_delete_web_key_request import BetaWebKeyServiceDeleteWebKeyRequest -from zitadel_client.models.beta_web_key_service_delete_web_key_response import BetaWebKeyServiceDeleteWebKeyResponse -from zitadel_client.models.beta_web_key_service_list_web_keys_response import BetaWebKeyServiceListWebKeysResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class BetaWebKeyServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.beta_web_key_service_activate_web_key_request import ( + BetaWebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_activate_web_key_response import ( + BetaWebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_create_web_key_request import ( + BetaWebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_create_web_key_response import ( + BetaWebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_request import ( + BetaWebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_response import ( + BetaWebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_list_web_keys_response import ( + BetaWebKeyServiceListWebKeysResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class BetaWebKeyServiceApi(BaseApi): + """BetaWebKeyServiceApi provides methods for the BetaWebKeyService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def activate_web_key( self, beta_web_key_service_activate_web_key_request: BetaWebKeyServiceActivateWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaWebKeyServiceActivateWebKeyResponse: + async def activate_web_key( + self, + beta_web_key_service_activate_web_key_request: BetaWebKeyServiceActivateWebKeyRequest, + ) -> BetaWebKeyServiceActivateWebKeyResponse: """Activate Web Key - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + :param beta_web_key_service_activate_web_key_request: (required) + + :return: BetaWebKeyServiceActivateWebKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_activate_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_activate_web_key_request'" + ) - :param beta_web_key_service_activate_web_key_request: (required) - :type beta_web_key_service_activate_web_key_request: BetaWebKeyServiceActivateWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_web_key_serialize( - beta_web_key_service_activate_web_key_request=beta_web_key_service_activate_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_web_key_with_http_info( + beta_web_key_service_activate_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaWebKeyServiceActivateWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_web_key_serialize( + async def activate_web_key_with_http_info( self, - beta_web_key_service_activate_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_web_key_service_activate_web_key_request is not None: - _body_params = beta_web_key_service_activate_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_web_key_service_activate_web_key_request: BetaWebKeyServiceActivateWebKeyRequest, + ) -> "ApiResult[BetaWebKeyServiceActivateWebKeyResponse]": + """Activate Web Key (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + :param beta_web_key_service_activate_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_activate_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_activate_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2beta.WebKeyService/ActivateWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2beta.WebKeyService/ActivateWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_web_key_service_activate_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaWebKeyServiceActivateWebKeyResponse", + None, ) - - - - @validate_call - def create_web_key( self, beta_web_key_service_create_web_key_request: BetaWebKeyServiceCreateWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaWebKeyServiceCreateWebKeyResponse: + async def create_web_key( + self, + beta_web_key_service_create_web_key_request: BetaWebKeyServiceCreateWebKeyRequest, + ) -> BetaWebKeyServiceCreateWebKeyResponse: """Create Web Key - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + :param beta_web_key_service_create_web_key_request: (required) + + :return: BetaWebKeyServiceCreateWebKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_create_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_create_web_key_request'" + ) - :param beta_web_key_service_create_web_key_request: (required) - :type beta_web_key_service_create_web_key_request: BetaWebKeyServiceCreateWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_web_key_serialize( - beta_web_key_service_create_web_key_request=beta_web_key_service_create_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_web_key_with_http_info( + beta_web_key_service_create_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaWebKeyServiceCreateWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_web_key_serialize( + async def create_web_key_with_http_info( self, - beta_web_key_service_create_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_web_key_service_create_web_key_request is not None: - _body_params = beta_web_key_service_create_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_web_key_service_create_web_key_request: BetaWebKeyServiceCreateWebKeyRequest, + ) -> "ApiResult[BetaWebKeyServiceCreateWebKeyResponse]": + """Create Web Key (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + :param beta_web_key_service_create_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_create_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_create_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2beta.WebKeyService/CreateWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2beta.WebKeyService/CreateWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_web_key_service_create_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaWebKeyServiceCreateWebKeyResponse", + None, ) - - - - @validate_call - def delete_web_key( self, beta_web_key_service_delete_web_key_request: BetaWebKeyServiceDeleteWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaWebKeyServiceDeleteWebKeyResponse: + async def delete_web_key( + self, + beta_web_key_service_delete_web_key_request: BetaWebKeyServiceDeleteWebKeyRequest, + ) -> BetaWebKeyServiceDeleteWebKeyResponse: """Delete Web Key - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + :param beta_web_key_service_delete_web_key_request: (required) + + :return: BetaWebKeyServiceDeleteWebKeyResponse + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_delete_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_delete_web_key_request'" + ) - :param beta_web_key_service_delete_web_key_request: (required) - :type beta_web_key_service_delete_web_key_request: BetaWebKeyServiceDeleteWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_web_key_serialize( - beta_web_key_service_delete_web_key_request=beta_web_key_service_delete_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_web_key_with_http_info( + beta_web_key_service_delete_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaWebKeyServiceDeleteWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_web_key_serialize( + async def delete_web_key_with_http_info( self, - beta_web_key_service_delete_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if beta_web_key_service_delete_web_key_request is not None: - _body_params = beta_web_key_service_delete_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + beta_web_key_service_delete_web_key_request: BetaWebKeyServiceDeleteWebKeyRequest, + ) -> "ApiResult[BetaWebKeyServiceDeleteWebKeyResponse]": + """Delete Web Key (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + :param beta_web_key_service_delete_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if beta_web_key_service_delete_web_key_request is None: + raise ValueError( + "Missing the required parameter 'beta_web_key_service_delete_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2beta.WebKeyService/DeleteWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2beta.WebKeyService/DeleteWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = beta_web_key_service_delete_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaWebKeyServiceDeleteWebKeyResponse", + None, ) - - - - @validate_call - def list_web_keys( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> BetaWebKeyServiceListWebKeysResponse: - if body is None: - body = {} + async def list_web_keys( + self, + body: object, + ) -> BetaWebKeyServiceListWebKeysResponse: """List Web Keys - Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. List all web keys and their states. Required permission: - `iam.web_key.read` + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_web_keys_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "BetaWebKeyServiceListWebKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: BetaWebKeyServiceListWebKeysResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_web_keys_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_web_keys_serialize( + async def list_web_keys_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[BetaWebKeyServiceListWebKeysResponse]": + """List Web Keys (with HTTP info) + Deprecated: please move to the corresponding endpoint under oidc service v2. This endpoint will be removed with the next major version of ZITADEL. List all web keys and their states. Required permission: - `iam.web_key.read` + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2beta.WebKeyService/ListWebKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.webkey.v2beta.WebKeyService/ListWebKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "BetaWebKeyServiceListWebKeysResponse", + None, ) - - diff --git a/zitadel_client/api/feature_service_api.py b/zitadel_client/api/feature_service_api.py index 13cb8e25..4c6b35e2 100644 --- a/zitadel_client/api/feature_service_api.py +++ b/zitadel_client/api/feature_service_api.py @@ -1,1599 +1,867 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.feature_service_get_instance_features_request import FeatureServiceGetInstanceFeaturesRequest -from zitadel_client.models.feature_service_get_instance_features_response import FeatureServiceGetInstanceFeaturesResponse -from zitadel_client.models.feature_service_get_organization_features_request import FeatureServiceGetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_get_organization_features_response import FeatureServiceGetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_get_system_features_response import FeatureServiceGetSystemFeaturesResponse -from zitadel_client.models.feature_service_get_user_features_request import FeatureServiceGetUserFeaturesRequest -from zitadel_client.models.feature_service_get_user_features_response import FeatureServiceGetUserFeaturesResponse -from zitadel_client.models.feature_service_reset_instance_features_response import FeatureServiceResetInstanceFeaturesResponse -from zitadel_client.models.feature_service_reset_organization_features_request import FeatureServiceResetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_reset_organization_features_response import FeatureServiceResetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_reset_system_features_response import FeatureServiceResetSystemFeaturesResponse -from zitadel_client.models.feature_service_reset_user_features_request import FeatureServiceResetUserFeaturesRequest -from zitadel_client.models.feature_service_reset_user_features_response import FeatureServiceResetUserFeaturesResponse -from zitadel_client.models.feature_service_set_instance_features_request import FeatureServiceSetInstanceFeaturesRequest -from zitadel_client.models.feature_service_set_instance_features_response import FeatureServiceSetInstanceFeaturesResponse -from zitadel_client.models.feature_service_set_organization_features_request import FeatureServiceSetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_set_organization_features_response import FeatureServiceSetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_set_system_features_request import FeatureServiceSetSystemFeaturesRequest -from zitadel_client.models.feature_service_set_system_features_response import FeatureServiceSetSystemFeaturesResponse -from zitadel_client.models.feature_service_set_user_feature_request import FeatureServiceSetUserFeatureRequest -from zitadel_client.models.feature_service_set_user_features_response import FeatureServiceSetUserFeaturesResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class FeatureServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def get_instance_features( self, feature_service_get_instance_features_request: FeatureServiceGetInstanceFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceGetInstanceFeaturesResponse: - """Get Instance Features +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.feature_service_get_instance_features_request import ( + FeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_get_instance_features_response import ( + FeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_get_organization_features_request import ( + FeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_get_organization_features_response import ( + FeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_get_system_features_response import ( + FeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_get_user_features_request import ( + FeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_get_user_features_response import ( + FeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_instance_features_response import ( + FeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_organization_features_request import ( + FeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_organization_features_response import ( + FeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_system_features_response import ( + FeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_user_features_request import ( + FeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_user_features_response import ( + FeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_set_instance_features_request import ( + FeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_set_instance_features_response import ( + FeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_set_organization_features_request import ( + FeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_set_organization_features_response import ( + FeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_set_system_features_request import ( + FeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.feature_service_set_system_features_response import ( + FeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_set_user_feature_request import ( + FeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.feature_service_set_user_features_response import ( + FeatureServiceSetUserFeaturesResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class FeatureServiceApi(BaseApi): + """FeatureServiceApi provides methods for the FeatureService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def get_instance_features( + self, + feature_service_get_instance_features_request: FeatureServiceGetInstanceFeaturesRequest, + ) -> FeatureServiceGetInstanceFeaturesResponse: + """Get Instance Features Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + :param feature_service_get_instance_features_request: (required) + + :return: FeatureServiceGetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_get_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_instance_features_request'" + ) - :param feature_service_get_instance_features_request: (required) - :type feature_service_get_instance_features_request: FeatureServiceGetInstanceFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_instance_features_serialize( - feature_service_get_instance_features_request=feature_service_get_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_instance_features_with_http_info( + feature_service_get_instance_features_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_instance_features_serialize( + async def get_instance_features_with_http_info( self, - feature_service_get_instance_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_get_instance_features_request is not None: - _body_params = feature_service_get_instance_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + feature_service_get_instance_features_request: FeatureServiceGetInstanceFeaturesRequest, + ) -> "ApiResult[FeatureServiceGetInstanceFeaturesResponse]": + """Get Instance Features (with HTTP info) + Returns all configured features for an instance. Unset fields mean the feature is the current system default. Required permissions: - none + :param feature_service_get_instance_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_get_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_instance_features_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/GetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.feature.v2.FeatureService/GetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_get_instance_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceGetInstanceFeaturesResponse", + None, + ) - @validate_call - def get_organization_features( self, feature_service_get_organization_features_request: FeatureServiceGetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceGetOrganizationFeaturesResponse: + async def get_organization_features( + self, + feature_service_get_organization_features_request: FeatureServiceGetOrganizationFeaturesRequest, + ) -> FeatureServiceGetOrganizationFeaturesResponse: """Get Organization Features - Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + :param feature_service_get_organization_features_request: (required) + + :return: FeatureServiceGetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_get_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_organization_features_request'" + ) - :param feature_service_get_organization_features_request: (required) - :type feature_service_get_organization_features_request: FeatureServiceGetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_organization_features_serialize( - feature_service_get_organization_features_request=feature_service_get_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_organization_features_with_http_info( + feature_service_get_organization_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_organization_features_serialize( - self, - feature_service_get_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_get_organization_features_request is not None: - _body_params = feature_service_get_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_organization_features_with_http_info( + self, + feature_service_get_organization_features_request: FeatureServiceGetOrganizationFeaturesRequest, + ) -> "ApiResult[FeatureServiceGetOrganizationFeaturesResponse]": + """Get Organization Features (with HTTP info) + Returns all configured features for an organization. Unset fields mean the feature is the current instance default. Required permissions: - org.feature.read - no permission required for the organization the user belongs to + :param feature_service_get_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_get_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_organization_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/GetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.feature.v2.FeatureService/GetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_get_organization_features_request - @validate_call - def get_system_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceGetSystemFeaturesResponse: - if body is None: - body = {} - """Get System Features - - Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_system_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceGetOrganizationFeaturesResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _get_system_features_serialize( + async def get_system_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> FeatureServiceGetSystemFeaturesResponse: + """Get System Features + Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: FeatureServiceGetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_system_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/GetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def get_system_features_with_http_info( + self, + body: object, + ) -> "ApiResult[FeatureServiceGetSystemFeaturesResponse]": + """Get System Features (with HTTP info) + Returns all configured features for the system. Unset fields mean the feature is the current system default. Required permissions: - none + :param body: (required) - @validate_call - def get_user_features( self, feature_service_get_user_features_request: FeatureServiceGetUserFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceGetUserFeaturesResponse: + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2.FeatureService/GetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceGetSystemFeaturesResponse", + None, + ) + + async def get_user_features( + self, + feature_service_get_user_features_request: FeatureServiceGetUserFeaturesRequest, + ) -> FeatureServiceGetUserFeaturesResponse: """Get User Features - Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + :param feature_service_get_user_features_request: (required) + + :return: FeatureServiceGetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_get_user_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_user_features_request'" + ) - :param feature_service_get_user_features_request: (required) - :type feature_service_get_user_features_request: FeatureServiceGetUserFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_features_serialize( - feature_service_get_user_features_request=feature_service_get_user_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceGetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_user_features_with_http_info( + feature_service_get_user_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_user_features_serialize( - self, - feature_service_get_user_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_get_user_features_request is not None: - _body_params = feature_service_get_user_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_user_features_with_http_info( + self, + feature_service_get_user_features_request: FeatureServiceGetUserFeaturesRequest, + ) -> "ApiResult[FeatureServiceGetUserFeaturesResponse]": + """Get User Features (with HTTP info) + Returns all configured features for a user. Unset fields mean the feature is the current organization default. Required permissions: - user.feature.read - no permission required for the own user + :param feature_service_get_user_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_get_user_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_get_user_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/GetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call - def reset_instance_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceResetInstanceFeaturesResponse: - if body is None: - body = {} - """Reset Instance Features - - Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + path = "/zitadel.feature.v2.FeatureService/GetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_get_user_features_request - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_instance_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceGetUserFeaturesResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _reset_instance_features_serialize( + async def reset_instance_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> FeatureServiceResetInstanceFeaturesResponse: + """Reset Instance Features + Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: FeatureServiceResetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.reset_instance_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/ResetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def reset_instance_features_with_http_info( + self, + body: object, + ) -> "ApiResult[FeatureServiceResetInstanceFeaturesResponse]": + """Reset Instance Features (with HTTP info) + Deletes ALL configured features for an instance, reverting the behaviors to system defaults. Required permissions: - iam.feature.delete + :param body: (required) - @validate_call - def reset_organization_features( self, feature_service_reset_organization_features_request: FeatureServiceResetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceResetOrganizationFeaturesResponse: + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2.FeatureService/ResetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceResetInstanceFeaturesResponse", + None, + ) + + async def reset_organization_features( + self, + feature_service_reset_organization_features_request: FeatureServiceResetOrganizationFeaturesRequest, + ) -> FeatureServiceResetOrganizationFeaturesResponse: """Reset Organization Features - Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete + :param feature_service_reset_organization_features_request: (required) + + :return: FeatureServiceResetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_reset_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_reset_organization_features_request'" + ) - :param feature_service_reset_organization_features_request: (required) - :type feature_service_reset_organization_features_request: FeatureServiceResetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_organization_features_serialize( - feature_service_reset_organization_features_request=feature_service_reset_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.reset_organization_features_with_http_info( + feature_service_reset_organization_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _reset_organization_features_serialize( - self, - feature_service_reset_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_reset_organization_features_request is not None: - _body_params = feature_service_reset_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def reset_organization_features_with_http_info( + self, + feature_service_reset_organization_features_request: FeatureServiceResetOrganizationFeaturesRequest, + ) -> "ApiResult[FeatureServiceResetOrganizationFeaturesResponse]": + """Reset Organization Features (with HTTP info) + Deletes ALL configured features for an organization, reverting the behaviors to instance defaults. Required permissions: - org.feature.delete + :param feature_service_reset_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_reset_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_reset_organization_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/ResetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.feature.v2.FeatureService/ResetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_reset_organization_features_request - @validate_call - def reset_system_features( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceResetSystemFeaturesResponse: - if body is None: - body = {} - """Reset System Features - - Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_system_features_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceResetOrganizationFeaturesResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _reset_system_features_serialize( + async def reset_system_features( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> FeatureServiceResetSystemFeaturesResponse: + """Reset System Features + Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: FeatureServiceResetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.reset_system_features_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/ResetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def reset_system_features_with_http_info( + self, + body: object, + ) -> "ApiResult[FeatureServiceResetSystemFeaturesResponse]": + """Reset System Features (with HTTP info) + Deletes ALL configured features for the system, reverting the behaviors to system defaults. Required permissions: - system.feature.delete + :param body: (required) - @validate_call - def reset_user_features( self, feature_service_reset_user_features_request: FeatureServiceResetUserFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceResetUserFeaturesResponse: + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.feature.v2.FeatureService/ResetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceResetSystemFeaturesResponse", + None, + ) + + async def reset_user_features( + self, + feature_service_reset_user_features_request: FeatureServiceResetUserFeaturesRequest, + ) -> FeatureServiceResetUserFeaturesResponse: """Reset User Features - Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete + :param feature_service_reset_user_features_request: (required) + + :return: FeatureServiceResetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_reset_user_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_reset_user_features_request'" + ) - :param feature_service_reset_user_features_request: (required) - :type feature_service_reset_user_features_request: FeatureServiceResetUserFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reset_user_features_serialize( - feature_service_reset_user_features_request=feature_service_reset_user_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceResetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.reset_user_features_with_http_info( + feature_service_reset_user_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _reset_user_features_serialize( - self, - feature_service_reset_user_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_reset_user_features_request is not None: - _body_params = feature_service_reset_user_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def reset_user_features_with_http_info( + self, + feature_service_reset_user_features_request: FeatureServiceResetUserFeaturesRequest, + ) -> "ApiResult[FeatureServiceResetUserFeaturesResponse]": + """Reset User Features (with HTTP info) + Deletes ALL configured features for a user, reverting the behaviors to organization defaults. Required permissions: - user.feature.delete + :param feature_service_reset_user_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_reset_user_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_reset_user_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/ResetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2.FeatureService/ResetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_reset_user_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceResetUserFeaturesResponse", + None, + ) - @validate_call - def set_instance_features( self, feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceSetInstanceFeaturesResponse: + async def set_instance_features( + self, + feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, + ) -> FeatureServiceSetInstanceFeaturesResponse: """Set Instance Features - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write + :param feature_service_set_instance_features_request: (required) + + :return: FeatureServiceSetInstanceFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_set_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_instance_features_request'" + ) - :param feature_service_set_instance_features_request: (required) - :type feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_instance_features_serialize( - feature_service_set_instance_features_request=feature_service_set_instance_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetInstanceFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_instance_features_with_http_info( + feature_service_set_instance_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_instance_features_serialize( - self, - feature_service_set_instance_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_set_instance_features_request is not None: - _body_params = feature_service_set_instance_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_instance_features_with_http_info( + self, + feature_service_set_instance_features_request: FeatureServiceSetInstanceFeaturesRequest, + ) -> "ApiResult[FeatureServiceSetInstanceFeaturesResponse]": + """Set Instance Features (with HTTP info) + Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - iam.feature.write + :param feature_service_set_instance_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_set_instance_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_instance_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/SetInstanceFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2.FeatureService/SetInstanceFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_set_instance_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceSetInstanceFeaturesResponse", + None, + ) - @validate_call - def set_organization_features( self, feature_service_set_organization_features_request: FeatureServiceSetOrganizationFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceSetOrganizationFeaturesResponse: + async def set_organization_features( + self, + feature_service_set_organization_features_request: FeatureServiceSetOrganizationFeaturesRequest, + ) -> FeatureServiceSetOrganizationFeaturesResponse: """Set Organization Features - Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write + :param feature_service_set_organization_features_request: (required) + + :return: FeatureServiceSetOrganizationFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_set_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_organization_features_request'" + ) - :param feature_service_set_organization_features_request: (required) - :type feature_service_set_organization_features_request: FeatureServiceSetOrganizationFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_organization_features_serialize( - feature_service_set_organization_features_request=feature_service_set_organization_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetOrganizationFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_organization_features_with_http_info( + feature_service_set_organization_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_organization_features_serialize( - self, - feature_service_set_organization_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_set_organization_features_request is not None: - _body_params = feature_service_set_organization_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_organization_features_with_http_info( + self, + feature_service_set_organization_features_request: FeatureServiceSetOrganizationFeaturesRequest, + ) -> "ApiResult[FeatureServiceSetOrganizationFeaturesResponse]": + """Set Organization Features (with HTTP info) + Configure and set features that apply to a complete instance. Only fields present in the request are set or unset. Required permissions: - org.feature.write + :param feature_service_set_organization_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_set_organization_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_organization_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/SetOrganizationFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2.FeatureService/SetOrganizationFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_set_organization_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceSetOrganizationFeaturesResponse", + None, + ) - @validate_call - def set_system_features( self, feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceSetSystemFeaturesResponse: + async def set_system_features( + self, + feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, + ) -> FeatureServiceSetSystemFeaturesResponse: """Set System Features - Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write + :param feature_service_set_system_features_request: (required) + + :return: FeatureServiceSetSystemFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_set_system_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_system_features_request'" + ) - :param feature_service_set_system_features_request: (required) - :type feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_system_features_serialize( - feature_service_set_system_features_request=feature_service_set_system_features_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetSystemFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_system_features_with_http_info( + feature_service_set_system_features_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_system_features_serialize( - self, - feature_service_set_system_features_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_set_system_features_request is not None: - _body_params = feature_service_set_system_features_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def set_system_features_with_http_info( + self, + feature_service_set_system_features_request: FeatureServiceSetSystemFeaturesRequest, + ) -> "ApiResult[FeatureServiceSetSystemFeaturesResponse]": + """Set System Features (with HTTP info) + Configure and set features that apply to the complete system. Only fields present in the request are set or unset. Required permissions: - system.feature.write + :param feature_service_set_system_features_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_set_system_features_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_system_features_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/SetSystemFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.feature.v2.FeatureService/SetSystemFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_set_system_features_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceSetSystemFeaturesResponse", + None, + ) - @validate_call - def set_user_features( self, feature_service_set_user_feature_request: FeatureServiceSetUserFeatureRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> FeatureServiceSetUserFeaturesResponse: + async def set_user_features( + self, + feature_service_set_user_feature_request: FeatureServiceSetUserFeatureRequest, + ) -> FeatureServiceSetUserFeaturesResponse: """Set User Features - Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write + :param feature_service_set_user_feature_request: (required) + + :return: FeatureServiceSetUserFeaturesResponse + :raises ApiException: if fails to make API call + """ + if feature_service_set_user_feature_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_user_feature_request'" + ) - :param feature_service_set_user_feature_request: (required) - :type feature_service_set_user_feature_request: FeatureServiceSetUserFeatureRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_user_features_serialize( - feature_service_set_user_feature_request=feature_service_set_user_feature_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_user_features_with_http_info( + feature_service_set_user_feature_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "FeatureServiceSetUserFeaturesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_user_features_serialize( + async def set_user_features_with_http_info( self, - feature_service_set_user_feature_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if feature_service_set_user_feature_request is not None: - _body_params = feature_service_set_user_feature_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + feature_service_set_user_feature_request: FeatureServiceSetUserFeatureRequest, + ) -> "ApiResult[FeatureServiceSetUserFeaturesResponse]": + """Set User Features (with HTTP info) + Configure and set features that apply to an user. Only fields present in the request are set or unset. Required permissions: - user.feature.write + :param feature_service_set_user_feature_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if feature_service_set_user_feature_request is None: + raise ValueError( + "Missing the required parameter 'feature_service_set_user_feature_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.feature.v2.FeatureService/SetUserFeatures', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.feature.v2.FeatureService/SetUserFeatures" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = feature_service_set_user_feature_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "FeatureServiceSetUserFeaturesResponse", + None, ) - - diff --git a/zitadel_client/api/identity_provider_service_api.py b/zitadel_client/api/identity_provider_service_api.py index 818410b8..4ec5e662 100644 --- a/zitadel_client/api/identity_provider_service_api.py +++ b/zitadel_client/api/identity_provider_service_api.py @@ -1,165 +1,102 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK +from __future__ import annotations - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +from typing import Any, Dict, Optional - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +from zitadel_client.models.identity_provider_service_get_idpby_id_request import ( + IdentityProviderServiceGetIDPByIDRequest, +) +from zitadel_client.models.identity_provider_service_get_idpby_id_response import ( + IdentityProviderServiceGetIDPByIDResponse, +) - Do not edit the class manually. -""" # noqa: E501 +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated -from zitadel_client.models.identity_provider_service_get_idpby_id_request import IdentityProviderServiceGetIDPByIDRequest -from zitadel_client.models.identity_provider_service_get_idpby_id_response import IdentityProviderServiceGetIDPByIDResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class IdentityProviderServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client +class IdentityProviderServiceApi(BaseApi): + """IdentityProviderServiceApi provides methods for the IdentityProviderService API group.""" + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def get_idpby_id( self, identity_provider_service_get_idpby_id_request: IdentityProviderServiceGetIDPByIDRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> IdentityProviderServiceGetIDPByIDResponse: + async def get_idpby_id( + self, + identity_provider_service_get_idpby_id_request: IdentityProviderServiceGetIDPByIDRequest, + ) -> IdentityProviderServiceGetIDPByIDResponse: """Get identity provider (IdP) by ID - Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. + :param identity_provider_service_get_idpby_id_request: (required) + + :return: IdentityProviderServiceGetIDPByIDResponse + :raises ApiException: if fails to make API call + """ + if identity_provider_service_get_idpby_id_request is None: + raise ValueError( + "Missing the required parameter 'identity_provider_service_get_idpby_id_request'" + ) - :param identity_provider_service_get_idpby_id_request: (required) - :type identity_provider_service_get_idpby_id_request: IdentityProviderServiceGetIDPByIDRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_idpby_id_serialize( - identity_provider_service_get_idpby_id_request=identity_provider_service_get_idpby_id_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "IdentityProviderServiceGetIDPByIDResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_idpby_id_with_http_info( + identity_provider_service_get_idpby_id_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_idpby_id_serialize( - self, - identity_provider_service_get_idpby_id_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if identity_provider_service_get_idpby_id_request is not None: - _body_params = identity_provider_service_get_idpby_id_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_idpby_id_with_http_info( + self, + identity_provider_service_get_idpby_id_request: IdentityProviderServiceGetIDPByIDRequest, + ) -> "ApiResult[IdentityProviderServiceGetIDPByIDResponse]": + """Get identity provider (IdP) by ID (with HTTP info) + Returns an identity provider (social/enterprise login) by its ID, which can be of the type Google, AzureAD, etc. + :param identity_provider_service_get_idpby_id_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if identity_provider_service_get_idpby_id_request is None: + raise ValueError( + "Missing the required parameter 'identity_provider_service_get_idpby_id_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.idp.v2.IdentityProviderService/GetIDPByID', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.idp.v2.IdentityProviderService/GetIDPByID" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = identity_provider_service_get_idpby_id_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "IdentityProviderServiceGetIDPByIDResponse", + None, ) - - diff --git a/zitadel_client/api/instance_service_api.py b/zitadel_client/api/instance_service_api.py index 360ee974..c330185d 100644 --- a/zitadel_client/api/instance_service_api.py +++ b/zitadel_client/api/instance_service_api.py @@ -1,1335 +1,750 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.instance_service_add_custom_domain_request import InstanceServiceAddCustomDomainRequest -from zitadel_client.models.instance_service_add_custom_domain_response import InstanceServiceAddCustomDomainResponse -from zitadel_client.models.instance_service_add_trusted_domain_request import InstanceServiceAddTrustedDomainRequest -from zitadel_client.models.instance_service_add_trusted_domain_response import InstanceServiceAddTrustedDomainResponse -from zitadel_client.models.instance_service_delete_instance_request import InstanceServiceDeleteInstanceRequest -from zitadel_client.models.instance_service_delete_instance_response import InstanceServiceDeleteInstanceResponse -from zitadel_client.models.instance_service_get_instance_request import InstanceServiceGetInstanceRequest -from zitadel_client.models.instance_service_get_instance_response import InstanceServiceGetInstanceResponse -from zitadel_client.models.instance_service_list_custom_domains_request import InstanceServiceListCustomDomainsRequest -from zitadel_client.models.instance_service_list_custom_domains_response import InstanceServiceListCustomDomainsResponse -from zitadel_client.models.instance_service_list_instances_request import InstanceServiceListInstancesRequest -from zitadel_client.models.instance_service_list_instances_response import InstanceServiceListInstancesResponse -from zitadel_client.models.instance_service_list_trusted_domains_request import InstanceServiceListTrustedDomainsRequest -from zitadel_client.models.instance_service_list_trusted_domains_response import InstanceServiceListTrustedDomainsResponse -from zitadel_client.models.instance_service_remove_custom_domain_request import InstanceServiceRemoveCustomDomainRequest -from zitadel_client.models.instance_service_remove_custom_domain_response import InstanceServiceRemoveCustomDomainResponse -from zitadel_client.models.instance_service_remove_trusted_domain_request import InstanceServiceRemoveTrustedDomainRequest -from zitadel_client.models.instance_service_remove_trusted_domain_response import InstanceServiceRemoveTrustedDomainResponse -from zitadel_client.models.instance_service_update_instance_request import InstanceServiceUpdateInstanceRequest -from zitadel_client.models.instance_service_update_instance_response import InstanceServiceUpdateInstanceResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class InstanceServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def add_custom_domain( self, instance_service_add_custom_domain_request: InstanceServiceAddCustomDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceAddCustomDomainResponse: - """Add Custom Domain +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.instance_service_add_custom_domain_request import ( + InstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.instance_service_add_custom_domain_response import ( + InstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.instance_service_add_trusted_domain_request import ( + InstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.instance_service_add_trusted_domain_response import ( + InstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.instance_service_delete_instance_request import ( + InstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.instance_service_delete_instance_response import ( + InstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.instance_service_get_instance_request import ( + InstanceServiceGetInstanceRequest, +) +from zitadel_client.models.instance_service_get_instance_response import ( + InstanceServiceGetInstanceResponse, +) +from zitadel_client.models.instance_service_list_custom_domains_request import ( + InstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.instance_service_list_custom_domains_response import ( + InstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.instance_service_list_instances_request import ( + InstanceServiceListInstancesRequest, +) +from zitadel_client.models.instance_service_list_instances_response import ( + InstanceServiceListInstancesResponse, +) +from zitadel_client.models.instance_service_list_trusted_domains_request import ( + InstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.instance_service_list_trusted_domains_response import ( + InstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.instance_service_remove_custom_domain_request import ( + InstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.instance_service_remove_custom_domain_response import ( + InstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.instance_service_remove_trusted_domain_request import ( + InstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.instance_service_remove_trusted_domain_response import ( + InstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.instance_service_update_instance_request import ( + InstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.instance_service_update_instance_response import ( + InstanceServiceUpdateInstanceResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class InstanceServiceApi(BaseApi): + """InstanceServiceApi provides methods for the InstanceService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def add_custom_domain( + self, + instance_service_add_custom_domain_request: InstanceServiceAddCustomDomainRequest, + ) -> InstanceServiceAddCustomDomainResponse: + """Add Custom Domain Adds a custom domain to the instance. The custom domain must be unique across all instances. Once the domain is added, it will be used to route requests to this instance. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + :param instance_service_add_custom_domain_request: (required) + + :return: InstanceServiceAddCustomDomainResponse + :raises ApiException: if fails to make API call + """ + if instance_service_add_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_add_custom_domain_request'" + ) - :param instance_service_add_custom_domain_request: (required) - :type instance_service_add_custom_domain_request: InstanceServiceAddCustomDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_custom_domain_serialize( - instance_service_add_custom_domain_request=instance_service_add_custom_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_custom_domain_with_http_info( + instance_service_add_custom_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceAddCustomDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_custom_domain_serialize( + async def add_custom_domain_with_http_info( self, - instance_service_add_custom_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_add_custom_domain_request is not None: - _body_params = instance_service_add_custom_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_add_custom_domain_request: InstanceServiceAddCustomDomainRequest, + ) -> "ApiResult[InstanceServiceAddCustomDomainResponse]": + """Add Custom Domain (with HTTP info) + Adds a custom domain to the instance. The custom domain must be unique across all instances. Once the domain is added, it will be used to route requests to this instance. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + :param instance_service_add_custom_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_add_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_add_custom_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/AddCustomDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/AddCustomDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_add_custom_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceAddCustomDomainResponse", + None, ) - - - - @validate_call - def add_trusted_domain( self, instance_service_add_trusted_domain_request: InstanceServiceAddTrustedDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceAddTrustedDomainResponse: + async def add_trusted_domain( + self, + instance_service_add_trusted_domain_request: InstanceServiceAddTrustedDomainRequest, + ) -> InstanceServiceAddTrustedDomainResponse: """Add Trusted Domain - Adds a trusted domain to the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. It must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domain, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_add_trusted_domain_request: (required) + + :return: InstanceServiceAddTrustedDomainResponse + :raises ApiException: if fails to make API call + """ + if instance_service_add_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_add_trusted_domain_request'" + ) - :param instance_service_add_trusted_domain_request: (required) - :type instance_service_add_trusted_domain_request: InstanceServiceAddTrustedDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_trusted_domain_serialize( - instance_service_add_trusted_domain_request=instance_service_add_trusted_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_trusted_domain_with_http_info( + instance_service_add_trusted_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceAddTrustedDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_trusted_domain_serialize( + async def add_trusted_domain_with_http_info( self, - instance_service_add_trusted_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_add_trusted_domain_request is not None: - _body_params = instance_service_add_trusted_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_add_trusted_domain_request: InstanceServiceAddTrustedDomainRequest, + ) -> "ApiResult[InstanceServiceAddTrustedDomainResponse]": + """Add Trusted Domain (with HTTP info) + Adds a trusted domain to the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. It must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domain, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_add_trusted_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_add_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_add_trusted_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/AddTrustedDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/AddTrustedDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_add_trusted_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceAddTrustedDomainResponse", + None, ) - - - - @validate_call - def delete_instance( self, instance_service_delete_instance_request: InstanceServiceDeleteInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceDeleteInstanceResponse: + async def delete_instance( + self, + instance_service_delete_instance_request: InstanceServiceDeleteInstanceRequest, + ) -> InstanceServiceDeleteInstanceResponse: """Delete Instance - Deletes an instance with the given ID. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.delete` + :param instance_service_delete_instance_request: (required) + + :return: InstanceServiceDeleteInstanceResponse + :raises ApiException: if fails to make API call + """ + if instance_service_delete_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_delete_instance_request'" + ) - :param instance_service_delete_instance_request: (required) - :type instance_service_delete_instance_request: InstanceServiceDeleteInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_instance_serialize( - instance_service_delete_instance_request=instance_service_delete_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_instance_with_http_info( + instance_service_delete_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceDeleteInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_instance_serialize( + async def delete_instance_with_http_info( self, - instance_service_delete_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_delete_instance_request is not None: - _body_params = instance_service_delete_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_delete_instance_request: InstanceServiceDeleteInstanceRequest, + ) -> "ApiResult[InstanceServiceDeleteInstanceResponse]": + """Delete Instance (with HTTP info) + Deletes an instance with the given ID. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.delete` + :param instance_service_delete_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_delete_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_delete_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/DeleteInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/DeleteInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_delete_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceDeleteInstanceResponse", + None, ) - - - - @validate_call - def get_instance( self, instance_service_get_instance_request: InstanceServiceGetInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceGetInstanceResponse: + async def get_instance( + self, + instance_service_get_instance_request: InstanceServiceGetInstanceRequest, + ) -> InstanceServiceGetInstanceResponse: """Get Instance - Returns the instance in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to retrieve a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_get_instance_request: (required) + + :return: InstanceServiceGetInstanceResponse + :raises ApiException: if fails to make API call + """ + if instance_service_get_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_get_instance_request'" + ) - :param instance_service_get_instance_request: (required) - :type instance_service_get_instance_request: InstanceServiceGetInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_instance_serialize( - instance_service_get_instance_request=instance_service_get_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_instance_with_http_info( + instance_service_get_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceGetInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_instance_serialize( + async def get_instance_with_http_info( self, - instance_service_get_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_get_instance_request is not None: - _body_params = instance_service_get_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_get_instance_request: InstanceServiceGetInstanceRequest, + ) -> "ApiResult[InstanceServiceGetInstanceResponse]": + """Get Instance (with HTTP info) + Returns the instance in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to retrieve a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_get_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_get_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_get_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/GetInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/GetInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_get_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceGetInstanceResponse", + None, ) - - - - @validate_call - def list_custom_domains( self, instance_service_list_custom_domains_request: InstanceServiceListCustomDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceListCustomDomainsResponse: + async def list_custom_domains( + self, + instance_service_list_custom_domains_request: InstanceServiceListCustomDomainsRequest, + ) -> InstanceServiceListCustomDomainsResponse: """List Custom Domains - Lists custom domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_list_custom_domains_request: (required) + + :return: InstanceServiceListCustomDomainsResponse + :raises ApiException: if fails to make API call + """ + if instance_service_list_custom_domains_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_custom_domains_request'" + ) - :param instance_service_list_custom_domains_request: (required) - :type instance_service_list_custom_domains_request: InstanceServiceListCustomDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_custom_domains_serialize( - instance_service_list_custom_domains_request=instance_service_list_custom_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_custom_domains_with_http_info( + instance_service_list_custom_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceListCustomDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_custom_domains_serialize( + async def list_custom_domains_with_http_info( self, - instance_service_list_custom_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_list_custom_domains_request is not None: - _body_params = instance_service_list_custom_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_list_custom_domains_request: InstanceServiceListCustomDomainsRequest, + ) -> "ApiResult[InstanceServiceListCustomDomainsResponse]": + """List Custom Domains (with HTTP info) + Lists custom domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_list_custom_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_list_custom_domains_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_custom_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/ListCustomDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/ListCustomDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_list_custom_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceListCustomDomainsResponse", + None, ) - - - - @validate_call - def list_instances( self, instance_service_list_instances_request: InstanceServiceListInstancesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceListInstancesResponse: + async def list_instances( + self, + instance_service_list_instances_request: InstanceServiceListInstancesRequest, + ) -> InstanceServiceListInstancesResponse: """List Instances - Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.read` + :param instance_service_list_instances_request: (required) + + :return: InstanceServiceListInstancesResponse + :raises ApiException: if fails to make API call + """ + if instance_service_list_instances_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_instances_request'" + ) - :param instance_service_list_instances_request: (required) - :type instance_service_list_instances_request: InstanceServiceListInstancesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_instances_serialize( - instance_service_list_instances_request=instance_service_list_instances_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_instances_with_http_info( + instance_service_list_instances_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceListInstancesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_instances_serialize( + async def list_instances_with_http_info( self, - instance_service_list_instances_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_list_instances_request is not None: - _body_params = instance_service_list_instances_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_list_instances_request: InstanceServiceListInstancesRequest, + ) -> "ApiResult[InstanceServiceListInstancesResponse]": + """List Instances (with HTTP info) + Lists instances matching the given query. The query can be used to filter either by instance ID or domain. The request is paginated and returns 100 results by default. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.instance.read` + :param instance_service_list_instances_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_list_instances_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_instances_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/ListInstances', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/ListInstances" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_list_instances_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceListInstancesResponse", + None, ) - - - - @validate_call - def list_trusted_domains( self, instance_service_list_trusted_domains_request: InstanceServiceListTrustedDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceListTrustedDomainsResponse: + async def list_trusted_domains( + self, + instance_service_list_trusted_domains_request: InstanceServiceListTrustedDomainsRequest, + ) -> InstanceServiceListTrustedDomainsResponse: """List Trusted Domains - Lists trusted domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_list_trusted_domains_request: (required) + + :return: InstanceServiceListTrustedDomainsResponse + :raises ApiException: if fails to make API call + """ + if instance_service_list_trusted_domains_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_trusted_domains_request'" + ) - :param instance_service_list_trusted_domains_request: (required) - :type instance_service_list_trusted_domains_request: InstanceServiceListTrustedDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_trusted_domains_serialize( - instance_service_list_trusted_domains_request=instance_service_list_trusted_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_trusted_domains_with_http_info( + instance_service_list_trusted_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceListTrustedDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_trusted_domains_serialize( + async def list_trusted_domains_with_http_info( self, - instance_service_list_trusted_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_list_trusted_domains_request is not None: - _body_params = instance_service_list_trusted_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_list_trusted_domains_request: InstanceServiceListTrustedDomainsRequest, + ) -> "ApiResult[InstanceServiceListTrustedDomainsResponse]": + """List Trusted Domains (with HTTP info) + Lists trusted domains of the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.read` - `system.instance.read` (if InstanceID is set) + :param instance_service_list_trusted_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_list_trusted_domains_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_list_trusted_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/ListTrustedDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/ListTrustedDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_list_trusted_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceListTrustedDomainsResponse", + None, ) - - - - @validate_call - def remove_custom_domain( self, instance_service_remove_custom_domain_request: InstanceServiceRemoveCustomDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceRemoveCustomDomainResponse: + async def remove_custom_domain( + self, + instance_service_remove_custom_domain_request: InstanceServiceRemoveCustomDomainRequest, + ) -> InstanceServiceRemoveCustomDomainResponse: """Remove Custom Domain - Removes a custom domain from the instance. Be aware that this will stop routing requests from this domain to the instance and might break existing setups or integrations. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + :param instance_service_remove_custom_domain_request: (required) + + :return: InstanceServiceRemoveCustomDomainResponse + :raises ApiException: if fails to make API call + """ + if instance_service_remove_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_remove_custom_domain_request'" + ) - :param instance_service_remove_custom_domain_request: (required) - :type instance_service_remove_custom_domain_request: InstanceServiceRemoveCustomDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_custom_domain_serialize( - instance_service_remove_custom_domain_request=instance_service_remove_custom_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_custom_domain_with_http_info( + instance_service_remove_custom_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceRemoveCustomDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_custom_domain_serialize( + async def remove_custom_domain_with_http_info( self, - instance_service_remove_custom_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_remove_custom_domain_request is not None: - _body_params = instance_service_remove_custom_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_remove_custom_domain_request: InstanceServiceRemoveCustomDomainRequest, + ) -> "ApiResult[InstanceServiceRemoveCustomDomainResponse]": + """Remove Custom Domain (with HTTP info) + Removes a custom domain from the instance. Be aware that this will stop routing requests from this domain to the instance and might break existing setups or integrations. This method requires system level permissions and cannot be called from an instance context. Required permissions: - `system.domain.write` + :param instance_service_remove_custom_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_remove_custom_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_remove_custom_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/RemoveCustomDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/RemoveCustomDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_remove_custom_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceRemoveCustomDomainResponse", + None, ) - - - - @validate_call - def remove_trusted_domain( self, instance_service_remove_trusted_domain_request: InstanceServiceRemoveTrustedDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceRemoveTrustedDomainResponse: + async def remove_trusted_domain( + self, + instance_service_remove_trusted_domain_request: InstanceServiceRemoveTrustedDomainRequest, + ) -> InstanceServiceRemoveTrustedDomainResponse: """Remove Trusted Domain - Removes a trusted domain from the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_remove_trusted_domain_request: (required) + + :return: InstanceServiceRemoveTrustedDomainResponse + :raises ApiException: if fails to make API call + """ + if instance_service_remove_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_remove_trusted_domain_request'" + ) - :param instance_service_remove_trusted_domain_request: (required) - :type instance_service_remove_trusted_domain_request: InstanceServiceRemoveTrustedDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_trusted_domain_serialize( - instance_service_remove_trusted_domain_request=instance_service_remove_trusted_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_trusted_domain_with_http_info( + instance_service_remove_trusted_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceRemoveTrustedDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_trusted_domain_serialize( + async def remove_trusted_domain_with_http_info( self, - instance_service_remove_trusted_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_remove_trusted_domain_request is not None: - _body_params = instance_service_remove_trusted_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_remove_trusted_domain_request: InstanceServiceRemoveTrustedDomainRequest, + ) -> "ApiResult[InstanceServiceRemoveTrustedDomainResponse]": + """Remove Trusted Domain (with HTTP info) + Removes a trusted domain from the instance. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to list the domains of a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_remove_trusted_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_remove_trusted_domain_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_remove_trusted_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/RemoveTrustedDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/RemoveTrustedDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_remove_trusted_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceRemoveTrustedDomainResponse", + None, ) - - - - @validate_call - def update_instance( self, instance_service_update_instance_request: InstanceServiceUpdateInstanceRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InstanceServiceUpdateInstanceResponse: + async def update_instance( + self, + instance_service_update_instance_request: InstanceServiceUpdateInstanceRequest, + ) -> InstanceServiceUpdateInstanceResponse: """Update Instance - Updates instance's name in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to update a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_update_instance_request: (required) + + :return: InstanceServiceUpdateInstanceResponse + :raises ApiException: if fails to make API call + """ + if instance_service_update_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_update_instance_request'" + ) - :param instance_service_update_instance_request: (required) - :type instance_service_update_instance_request: InstanceServiceUpdateInstanceRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_instance_serialize( - instance_service_update_instance_request=instance_service_update_instance_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_instance_with_http_info( + instance_service_update_instance_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InstanceServiceUpdateInstanceResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_instance_serialize( + async def update_instance_with_http_info( self, - instance_service_update_instance_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if instance_service_update_instance_request is not None: - _body_params = instance_service_update_instance_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + instance_service_update_instance_request: InstanceServiceUpdateInstanceRequest, + ) -> "ApiResult[InstanceServiceUpdateInstanceResponse]": + """Update Instance (with HTTP info) + Updates instance's name in the current context or by its ID. By default the instance will be determined by the context of the request, e.g. the host header. You can optionally pass an InstanceID to update a specific instance. This requires additional permissions. Required permissions: - `iam.write` - `system.instance.write` (if InstanceID is set) + :param instance_service_update_instance_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if instance_service_update_instance_request is None: + raise ValueError( + "Missing the required parameter 'instance_service_update_instance_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.instance.v2.InstanceService/UpdateInstance', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.instance.v2.InstanceService/UpdateInstance" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = instance_service_update_instance_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InstanceServiceUpdateInstanceResponse", + None, ) - - diff --git a/zitadel_client/api/internal_permission_service_api.py b/zitadel_client/api/internal_permission_service_api.py index 5848dc8b..3b29bcd4 100644 --- a/zitadel_client/api/internal_permission_service_api.py +++ b/zitadel_client/api/internal_permission_service_api.py @@ -1,555 +1,318 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.internal_permission_service_create_administrator_request import InternalPermissionServiceCreateAdministratorRequest -from zitadel_client.models.internal_permission_service_create_administrator_response import InternalPermissionServiceCreateAdministratorResponse -from zitadel_client.models.internal_permission_service_delete_administrator_request import InternalPermissionServiceDeleteAdministratorRequest -from zitadel_client.models.internal_permission_service_delete_administrator_response import InternalPermissionServiceDeleteAdministratorResponse -from zitadel_client.models.internal_permission_service_list_administrators_request import InternalPermissionServiceListAdministratorsRequest -from zitadel_client.models.internal_permission_service_list_administrators_response import InternalPermissionServiceListAdministratorsResponse -from zitadel_client.models.internal_permission_service_update_administrator_request import InternalPermissionServiceUpdateAdministratorRequest -from zitadel_client.models.internal_permission_service_update_administrator_response import InternalPermissionServiceUpdateAdministratorResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class InternalPermissionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.internal_permission_service_create_administrator_request import ( + InternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_create_administrator_response import ( + InternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_delete_administrator_request import ( + InternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_delete_administrator_response import ( + InternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_list_administrators_request import ( + InternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.internal_permission_service_list_administrators_response import ( + InternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.internal_permission_service_update_administrator_request import ( + InternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_update_administrator_response import ( + InternalPermissionServiceUpdateAdministratorResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class InternalPermissionServiceApi(BaseApi): + """InternalPermissionServiceApi provides methods for the InternalPermissionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_administrator( self, internal_permission_service_create_administrator_request: InternalPermissionServiceCreateAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InternalPermissionServiceCreateAdministratorResponse: + async def create_administrator( + self, + internal_permission_service_create_administrator_request: InternalPermissionServiceCreateAdministratorRequest, + ) -> InternalPermissionServiceCreateAdministratorResponse: """Create Administrator - CreateAdministrator grants an administrator role to a user for a specific resource. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param internal_permission_service_create_administrator_request: (required) + + :return: InternalPermissionServiceCreateAdministratorResponse + :raises ApiException: if fails to make API call + """ + if internal_permission_service_create_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_create_administrator_request'" + ) - :param internal_permission_service_create_administrator_request: (required) - :type internal_permission_service_create_administrator_request: InternalPermissionServiceCreateAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_administrator_serialize( - internal_permission_service_create_administrator_request=internal_permission_service_create_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_administrator_with_http_info( + internal_permission_service_create_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InternalPermissionServiceCreateAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_administrator_serialize( + async def create_administrator_with_http_info( self, - internal_permission_service_create_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if internal_permission_service_create_administrator_request is not None: - _body_params = internal_permission_service_create_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + internal_permission_service_create_administrator_request: InternalPermissionServiceCreateAdministratorRequest, + ) -> "ApiResult[InternalPermissionServiceCreateAdministratorResponse]": + """Create Administrator (with HTTP info) + CreateAdministrator grants an administrator role to a user for a specific resource. Note that the roles are specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param internal_permission_service_create_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if internal_permission_service_create_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_create_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2.InternalPermissionService/CreateAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2.InternalPermissionService/CreateAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = internal_permission_service_create_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InternalPermissionServiceCreateAdministratorResponse", + None, ) - - - - @validate_call - def delete_administrator( self, internal_permission_service_delete_administrator_request: InternalPermissionServiceDeleteAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InternalPermissionServiceDeleteAdministratorResponse: + async def delete_administrator( + self, + internal_permission_service_delete_administrator_request: InternalPermissionServiceDeleteAdministratorRequest, + ) -> InternalPermissionServiceDeleteAdministratorResponse: """Delete Administrator - DeleteAdministrator revokes an administrator role from a user. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + :param internal_permission_service_delete_administrator_request: (required) + + :return: InternalPermissionServiceDeleteAdministratorResponse + :raises ApiException: if fails to make API call + """ + if internal_permission_service_delete_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_delete_administrator_request'" + ) - :param internal_permission_service_delete_administrator_request: (required) - :type internal_permission_service_delete_administrator_request: InternalPermissionServiceDeleteAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_administrator_serialize( - internal_permission_service_delete_administrator_request=internal_permission_service_delete_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_administrator_with_http_info( + internal_permission_service_delete_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InternalPermissionServiceDeleteAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_administrator_serialize( + async def delete_administrator_with_http_info( self, - internal_permission_service_delete_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if internal_permission_service_delete_administrator_request is not None: - _body_params = internal_permission_service_delete_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + internal_permission_service_delete_administrator_request: InternalPermissionServiceDeleteAdministratorRequest, + ) -> "ApiResult[InternalPermissionServiceDeleteAdministratorResponse]": + """Delete Administrator (with HTTP info) + DeleteAdministrator revokes an administrator role from a user. In case the administrator role is not found, the request will return a successful response as the desired state is already achieved. You can check the deletion date in the response to verify if the administrator role was deleted during the request. Required permissions depend on the resource type: - \"iam.member.delete\" for instance administrators - \"org.member.delete\" for organization administrators - \"project.member.delete\" for project administrators - \"project.grant.member.delete\" for project grant administrators + :param internal_permission_service_delete_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if internal_permission_service_delete_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_delete_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2.InternalPermissionService/DeleteAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2.InternalPermissionService/DeleteAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = internal_permission_service_delete_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InternalPermissionServiceDeleteAdministratorResponse", + None, ) - - - - @validate_call - def list_administrators( self, internal_permission_service_list_administrators_request: InternalPermissionServiceListAdministratorsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InternalPermissionServiceListAdministratorsResponse: + async def list_administrators( + self, + internal_permission_service_list_administrators_request: InternalPermissionServiceListAdministratorsRequest, + ) -> InternalPermissionServiceListAdministratorsResponse: """List Administrators - ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + :param internal_permission_service_list_administrators_request: (required) + + :return: InternalPermissionServiceListAdministratorsResponse + :raises ApiException: if fails to make API call + """ + if internal_permission_service_list_administrators_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_list_administrators_request'" + ) - :param internal_permission_service_list_administrators_request: (required) - :type internal_permission_service_list_administrators_request: InternalPermissionServiceListAdministratorsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_administrators_serialize( - internal_permission_service_list_administrators_request=internal_permission_service_list_administrators_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_administrators_with_http_info( + internal_permission_service_list_administrators_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InternalPermissionServiceListAdministratorsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_administrators_serialize( + async def list_administrators_with_http_info( self, - internal_permission_service_list_administrators_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if internal_permission_service_list_administrators_request is not None: - _body_params = internal_permission_service_list_administrators_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + internal_permission_service_list_administrators_request: InternalPermissionServiceListAdministratorsRequest, + ) -> "ApiResult[InternalPermissionServiceListAdministratorsResponse]": + """List Administrators (with HTTP info) + ListAdministrators returns all administrators and their roles matching the request and the caller's permissions to retrieve. Required permissions depend on the resource type: - \"iam.member.read\" for instance administrators - \"org.member.read\" for organization administrators - \"project.member.read\" for project administrators - \"project.grant.member.read\" for project grant administrators - no permissions required for listing own administrator roles + :param internal_permission_service_list_administrators_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if internal_permission_service_list_administrators_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_list_administrators_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2.InternalPermissionService/ListAdministrators', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2.InternalPermissionService/ListAdministrators" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = internal_permission_service_list_administrators_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InternalPermissionServiceListAdministratorsResponse", + None, ) - - - - @validate_call - def update_administrator( self, internal_permission_service_update_administrator_request: InternalPermissionServiceUpdateAdministratorRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> InternalPermissionServiceUpdateAdministratorResponse: + async def update_administrator( + self, + internal_permission_service_update_administrator_request: InternalPermissionServiceUpdateAdministratorRequest, + ) -> InternalPermissionServiceUpdateAdministratorResponse: """Update Administrator - UpdateAdministrator updates the specific administrator role. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param internal_permission_service_update_administrator_request: (required) + + :return: InternalPermissionServiceUpdateAdministratorResponse + :raises ApiException: if fails to make API call + """ + if internal_permission_service_update_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_update_administrator_request'" + ) - :param internal_permission_service_update_administrator_request: (required) - :type internal_permission_service_update_administrator_request: InternalPermissionServiceUpdateAdministratorRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_administrator_serialize( - internal_permission_service_update_administrator_request=internal_permission_service_update_administrator_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_administrator_with_http_info( + internal_permission_service_update_administrator_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "InternalPermissionServiceUpdateAdministratorResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_administrator_serialize( + async def update_administrator_with_http_info( self, - internal_permission_service_update_administrator_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if internal_permission_service_update_administrator_request is not None: - _body_params = internal_permission_service_update_administrator_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + internal_permission_service_update_administrator_request: InternalPermissionServiceUpdateAdministratorRequest, + ) -> "ApiResult[InternalPermissionServiceUpdateAdministratorResponse]": + """Update Administrator (with HTTP info) + UpdateAdministrator updates the specific administrator role. Note that any role previously granted to the user and not present in the request will be revoked. Required permissions depend on the resource type: - \"iam.member.write\" for instance administrators - \"org.member.write\" for organization administrators - \"project.member.write\" for project administrators - \"project.grant.member.write\" for project grant administrators + :param internal_permission_service_update_administrator_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if internal_permission_service_update_administrator_request is None: + raise ValueError( + "Missing the required parameter 'internal_permission_service_update_administrator_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.internal_permission.v2.InternalPermissionService/UpdateAdministrator', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.internal_permission.v2.InternalPermissionService/UpdateAdministrator" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = internal_permission_service_update_administrator_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "InternalPermissionServiceUpdateAdministratorResponse", + None, ) - - diff --git a/zitadel_client/api/oidc_service_api.py b/zitadel_client/api/oidc_service_api.py index d974fe57..1778cba4 100644 --- a/zitadel_client/api/oidc_service_api.py +++ b/zitadel_client/api/oidc_service_api.py @@ -1,559 +1,315 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest -from zitadel_client.models.oidc_service_create_callback_request import OIDCServiceCreateCallbackRequest -from zitadel_client.models.oidc_service_create_callback_response import OIDCServiceCreateCallbackResponse -from zitadel_client.models.oidc_service_get_auth_request_request import OIDCServiceGetAuthRequestRequest -from zitadel_client.models.oidc_service_get_auth_request_response import OIDCServiceGetAuthRequestResponse -from zitadel_client.models.oidc_service_get_device_authorization_request_request import OIDCServiceGetDeviceAuthorizationRequestRequest -from zitadel_client.models.oidc_service_get_device_authorization_request_response import OIDCServiceGetDeviceAuthorizationRequestResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class OIDCServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import ( + OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, +) +from zitadel_client.models.oidc_service_create_callback_request import ( + OIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.oidc_service_create_callback_response import ( + OIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.oidc_service_get_auth_request_request import ( + OIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.oidc_service_get_auth_request_response import ( + OIDCServiceGetAuthRequestResponse, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_request import ( + OIDCServiceGetDeviceAuthorizationRequestRequest, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_response import ( + OIDCServiceGetDeviceAuthorizationRequestResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class OIDCServiceApi(BaseApi): + """OIDCServiceApi provides methods for the OIDCService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def authorize_or_deny_device_authorization( self, oidc_service_authorize_or_deny_device_authorization_request: Optional[OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> object: - if oidc_service_authorize_or_deny_device_authorization_request is None: - oidc_service_authorize_or_deny_device_authorization_request = {} + async def authorize_or_deny_device_authorization( + self, + oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, + ) -> object: """Authorize or Deny Device Authorization - Authorize or deny the device authorization request based on the provided device authorization id. Required permissions: - `session.link` + :param oidc_service_authorize_or_deny_device_authorization_request: (required) - :param oidc_service_authorize_or_deny_device_authorization_request: (required) - :type oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._authorize_or_deny_device_authorization_serialize( - oidc_service_authorize_or_deny_device_authorization_request=oidc_service_authorize_or_deny_device_authorization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: object + :raises ApiException: if fails to make API call + """ + if oidc_service_authorize_or_deny_device_authorization_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "object", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.authorize_or_deny_device_authorization_with_http_info( + oidc_service_authorize_or_deny_device_authorization_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _authorize_or_deny_device_authorization_serialize( - self, - oidc_service_authorize_or_deny_device_authorization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_authorize_or_deny_device_authorization_request is not None: - _body_params = oidc_service_authorize_or_deny_device_authorization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2.OIDCService/AuthorizeOrDenyDeviceAuthorization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + return result.data + async def authorize_or_deny_device_authorization_with_http_info( + self, + oidc_service_authorize_or_deny_device_authorization_request: OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, + ) -> "ApiResult[object]": + """Authorize or Deny Device Authorization (with HTTP info) + Authorize or deny the device authorization request based on the provided device authorization id. Required permissions: - `session.link` + :param oidc_service_authorize_or_deny_device_authorization_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if oidc_service_authorize_or_deny_device_authorization_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_authorize_or_deny_device_authorization_request'" + ) + path = "/zitadel.oidc.v2.OIDCService/AuthorizeOrDenyDeviceAuthorization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = oidc_service_authorize_or_deny_device_authorization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "object", + None, + ) - @validate_call - def create_callback( self, oidc_service_create_callback_request: Optional[OIDCServiceCreateCallbackRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceCreateCallbackResponse: - if oidc_service_create_callback_request is None: - oidc_service_create_callback_request = {} + async def create_callback( + self, + oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest, + ) -> OIDCServiceCreateCallbackResponse: """Create Callback - Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. Required permissions: - `session.link` + :param oidc_service_create_callback_request: (required) - :param oidc_service_create_callback_request: (required) - :type oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_callback_serialize( - oidc_service_create_callback_request=oidc_service_create_callback_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: OIDCServiceCreateCallbackResponse + :raises ApiException: if fails to make API call + """ + if oidc_service_create_callback_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_create_callback_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceCreateCallbackResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_callback_with_http_info( + oidc_service_create_callback_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _create_callback_serialize( - self, - oidc_service_create_callback_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_create_callback_request is not None: - _body_params = oidc_service_create_callback_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2.OIDCService/CreateCallback', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + return result.data + async def create_callback_with_http_info( + self, + oidc_service_create_callback_request: OIDCServiceCreateCallbackRequest, + ) -> "ApiResult[OIDCServiceCreateCallbackResponse]": + """Create Callback (with HTTP info) + Finalize an Auth Request and get the callback URL for success or failure. The user must be redirected to the URL in order to inform the application about the success or failure. On success, the URL contains details for the application to obtain the tokens. This method can only be called once for an Auth request. Required permissions: - `session.link` + :param oidc_service_create_callback_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if oidc_service_create_callback_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_create_callback_request'" + ) + path = "/zitadel.oidc.v2.OIDCService/CreateCallback" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = oidc_service_create_callback_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OIDCServiceCreateCallbackResponse", + None, + ) - @validate_call - def get_auth_request( self, oidc_service_get_auth_request_request: OIDCServiceGetAuthRequestRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceGetAuthRequestResponse: + async def get_auth_request( + self, + oidc_service_get_auth_request_request: OIDCServiceGetAuthRequestRequest, + ) -> OIDCServiceGetAuthRequestResponse: """Get Auth Request - Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. Required permissions: - `session.read` + :param oidc_service_get_auth_request_request: (required) + + :return: OIDCServiceGetAuthRequestResponse + :raises ApiException: if fails to make API call + """ + if oidc_service_get_auth_request_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_get_auth_request_request'" + ) - :param oidc_service_get_auth_request_request: (required) - :type oidc_service_get_auth_request_request: OIDCServiceGetAuthRequestRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_auth_request_serialize( - oidc_service_get_auth_request_request=oidc_service_get_auth_request_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_auth_request_with_http_info( + oidc_service_get_auth_request_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetAuthRequestResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_auth_request_serialize( + async def get_auth_request_with_http_info( self, - oidc_service_get_auth_request_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_get_auth_request_request is not None: - _body_params = oidc_service_get_auth_request_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + oidc_service_get_auth_request_request: OIDCServiceGetAuthRequestRequest, + ) -> "ApiResult[OIDCServiceGetAuthRequestResponse]": + """Get Auth Request (with HTTP info) + Get OIDC Auth Request details by ID, obtained from the redirect URL. Returns details that are parsed from the application's Auth Request. Required permissions: - `session.read` + :param oidc_service_get_auth_request_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if oidc_service_get_auth_request_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_get_auth_request_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2.OIDCService/GetAuthRequest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.oidc.v2.OIDCService/GetAuthRequest" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = oidc_service_get_auth_request_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OIDCServiceGetAuthRequestResponse", + None, ) - - - - @validate_call - def get_device_authorization_request( self, oidc_service_get_device_authorization_request_request: OIDCServiceGetDeviceAuthorizationRequestRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OIDCServiceGetDeviceAuthorizationRequestResponse: + async def get_device_authorization_request( + self, + oidc_service_get_device_authorization_request_request: OIDCServiceGetDeviceAuthorizationRequestRequest, + ) -> OIDCServiceGetDeviceAuthorizationRequestResponse: """Get Device Authorization Request - Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. Required permissions: - `session.read` + :param oidc_service_get_device_authorization_request_request: (required) + + :return: OIDCServiceGetDeviceAuthorizationRequestResponse + :raises ApiException: if fails to make API call + """ + if oidc_service_get_device_authorization_request_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_get_device_authorization_request_request'" + ) - :param oidc_service_get_device_authorization_request_request: (required) - :type oidc_service_get_device_authorization_request_request: OIDCServiceGetDeviceAuthorizationRequestRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_device_authorization_request_serialize( - oidc_service_get_device_authorization_request_request=oidc_service_get_device_authorization_request_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_device_authorization_request_with_http_info( + oidc_service_get_device_authorization_request_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OIDCServiceGetDeviceAuthorizationRequestResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_device_authorization_request_serialize( + async def get_device_authorization_request_with_http_info( self, - oidc_service_get_device_authorization_request_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if oidc_service_get_device_authorization_request_request is not None: - _body_params = oidc_service_get_device_authorization_request_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + oidc_service_get_device_authorization_request_request: OIDCServiceGetDeviceAuthorizationRequestRequest, + ) -> "ApiResult[OIDCServiceGetDeviceAuthorizationRequestResponse]": + """Get Device Authorization Request (with HTTP info) + Get the device authorization based on the provided \"user code\". This will return the device authorization request, which contains the device authorization id that is required to authorize the request once the user signed in or to deny it. Required permissions: - `session.read` + :param oidc_service_get_device_authorization_request_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if oidc_service_get_device_authorization_request_request is None: + raise ValueError( + "Missing the required parameter 'oidc_service_get_device_authorization_request_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.oidc.v2.OIDCService/GetDeviceAuthorizationRequest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.oidc.v2.OIDCService/GetDeviceAuthorizationRequest" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = oidc_service_get_device_authorization_request_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OIDCServiceGetDeviceAuthorizationRequestResponse", + None, ) - - diff --git a/zitadel_client/api/organization_service_api.py b/zitadel_client/api/organization_service_api.py index d16b8fb4..7700f08c 100644 --- a/zitadel_client/api/organization_service_api.py +++ b/zitadel_client/api/organization_service_api.py @@ -1,1855 +1,1040 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.organization_service_activate_organization_request import OrganizationServiceActivateOrganizationRequest -from zitadel_client.models.organization_service_activate_organization_response import OrganizationServiceActivateOrganizationResponse -from zitadel_client.models.organization_service_add_organization_domain_request import OrganizationServiceAddOrganizationDomainRequest -from zitadel_client.models.organization_service_add_organization_domain_response import OrganizationServiceAddOrganizationDomainResponse -from zitadel_client.models.organization_service_add_organization_request import OrganizationServiceAddOrganizationRequest -from zitadel_client.models.organization_service_add_organization_response import OrganizationServiceAddOrganizationResponse -from zitadel_client.models.organization_service_deactivate_organization_request import OrganizationServiceDeactivateOrganizationRequest -from zitadel_client.models.organization_service_deactivate_organization_response import OrganizationServiceDeactivateOrganizationResponse -from zitadel_client.models.organization_service_delete_organization_domain_request import OrganizationServiceDeleteOrganizationDomainRequest -from zitadel_client.models.organization_service_delete_organization_domain_response import OrganizationServiceDeleteOrganizationDomainResponse -from zitadel_client.models.organization_service_delete_organization_metadata_request import OrganizationServiceDeleteOrganizationMetadataRequest -from zitadel_client.models.organization_service_delete_organization_metadata_response import OrganizationServiceDeleteOrganizationMetadataResponse -from zitadel_client.models.organization_service_delete_organization_request import OrganizationServiceDeleteOrganizationRequest -from zitadel_client.models.organization_service_delete_organization_response import OrganizationServiceDeleteOrganizationResponse -from zitadel_client.models.organization_service_generate_organization_domain_validation_request import OrganizationServiceGenerateOrganizationDomainValidationRequest -from zitadel_client.models.organization_service_generate_organization_domain_validation_response import OrganizationServiceGenerateOrganizationDomainValidationResponse -from zitadel_client.models.organization_service_list_organization_domains_request import OrganizationServiceListOrganizationDomainsRequest -from zitadel_client.models.organization_service_list_organization_domains_response import OrganizationServiceListOrganizationDomainsResponse -from zitadel_client.models.organization_service_list_organization_metadata_request import OrganizationServiceListOrganizationMetadataRequest -from zitadel_client.models.organization_service_list_organization_metadata_response import OrganizationServiceListOrganizationMetadataResponse -from zitadel_client.models.organization_service_list_organizations_request import OrganizationServiceListOrganizationsRequest -from zitadel_client.models.organization_service_list_organizations_response import OrganizationServiceListOrganizationsResponse -from zitadel_client.models.organization_service_set_organization_metadata_request import OrganizationServiceSetOrganizationMetadataRequest -from zitadel_client.models.organization_service_set_organization_metadata_response import OrganizationServiceSetOrganizationMetadataResponse -from zitadel_client.models.organization_service_update_organization_request import OrganizationServiceUpdateOrganizationRequest -from zitadel_client.models.organization_service_update_organization_response import OrganizationServiceUpdateOrganizationResponse -from zitadel_client.models.organization_service_verify_organization_domain_request import OrganizationServiceVerifyOrganizationDomainRequest -from zitadel_client.models.organization_service_verify_organization_domain_response import OrganizationServiceVerifyOrganizationDomainResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class OrganizationServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def activate_organization( self, organization_service_activate_organization_request: OrganizationServiceActivateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceActivateOrganizationResponse: - """Activate Organization +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.organization_service_activate_organization_request import ( + OrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.organization_service_activate_organization_response import ( + OrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.organization_service_add_organization_domain_request import ( + OrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_add_organization_domain_response import ( + OrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_add_organization_request import ( + OrganizationServiceAddOrganizationRequest, +) +from zitadel_client.models.organization_service_add_organization_response import ( + OrganizationServiceAddOrganizationResponse, +) +from zitadel_client.models.organization_service_deactivate_organization_request import ( + OrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.organization_service_deactivate_organization_response import ( + OrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.organization_service_delete_organization_domain_request import ( + OrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_delete_organization_domain_response import ( + OrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_delete_organization_metadata_request import ( + OrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_delete_organization_metadata_response import ( + OrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_delete_organization_request import ( + OrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.organization_service_delete_organization_response import ( + OrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_request import ( + OrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_response import ( + OrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.organization_service_list_organization_domains_request import ( + OrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.organization_service_list_organization_domains_response import ( + OrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.organization_service_list_organization_metadata_request import ( + OrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_list_organization_metadata_response import ( + OrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_list_organizations_request import ( + OrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.organization_service_list_organizations_response import ( + OrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.organization_service_set_organization_metadata_request import ( + OrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_set_organization_metadata_response import ( + OrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_update_organization_request import ( + OrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.organization_service_update_organization_response import ( + OrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.organization_service_verify_organization_domain_request import ( + OrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_verify_organization_domain_response import ( + OrganizationServiceVerifyOrganizationDomainResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class OrganizationServiceApi(BaseApi): + """OrganizationServiceApi provides methods for the OrganizationService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def activate_organization( + self, + organization_service_activate_organization_request: OrganizationServiceActivateOrganizationRequest, + ) -> OrganizationServiceActivateOrganizationResponse: + """Activate Organization Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + :param organization_service_activate_organization_request: (required) + + :return: OrganizationServiceActivateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_activate_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_activate_organization_request'" + ) - :param organization_service_activate_organization_request: (required) - :type organization_service_activate_organization_request: OrganizationServiceActivateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_organization_serialize( - organization_service_activate_organization_request=organization_service_activate_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_organization_with_http_info( + organization_service_activate_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceActivateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_organization_serialize( + async def activate_organization_with_http_info( self, - organization_service_activate_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_activate_organization_request is not None: - _body_params = organization_service_activate_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_activate_organization_request: OrganizationServiceActivateOrganizationRequest, + ) -> "ApiResult[OrganizationServiceActivateOrganizationResponse]": + """Activate Organization (with HTTP info) + Set the state of my organization to active. The state of the organization has to be deactivated to perform the request. Users of this organization will be able to log in again. Required permission: - `org.write` + :param organization_service_activate_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_activate_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_activate_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/ActivateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/ActivateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_activate_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceActivateOrganizationResponse", + None, ) - - - - @validate_call - def add_organization( self, organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceAddOrganizationResponse: + async def add_organization( + self, + organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest, + ) -> OrganizationServiceAddOrganizationResponse: """Add Organization - Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` + :param organization_service_add_organization_request: (required) + + :return: OrganizationServiceAddOrganizationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_add_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_add_organization_request'" + ) - :param organization_service_add_organization_request: (required) - :type organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_organization_serialize( - organization_service_add_organization_request=organization_service_add_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_organization_with_http_info( + organization_service_add_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceAddOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_organization_serialize( + async def add_organization_with_http_info( self, - organization_service_add_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_add_organization_request is not None: - _body_params = organization_service_add_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_add_organization_request: OrganizationServiceAddOrganizationRequest, + ) -> "ApiResult[OrganizationServiceAddOrganizationResponse]": + """Add Organization (with HTTP info) + Create a new organization with an administrative user. If no specific roles are sent for the users, they will be granted the role ORG_OWNER. Required permission: - `org.create` + :param organization_service_add_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_add_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_add_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/AddOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/AddOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_add_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceAddOrganizationResponse", + None, ) - - - - @validate_call - def add_organization_domain( self, organization_service_add_organization_domain_request: OrganizationServiceAddOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceAddOrganizationDomainResponse: + async def add_organization_domain( + self, + organization_service_add_organization_domain_request: OrganizationServiceAddOrganizationDomainRequest, + ) -> OrganizationServiceAddOrganizationDomainResponse: """Add Organization Domain - Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + :param organization_service_add_organization_domain_request: (required) + + :return: OrganizationServiceAddOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if organization_service_add_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_add_organization_domain_request'" + ) - :param organization_service_add_organization_domain_request: (required) - :type organization_service_add_organization_domain_request: OrganizationServiceAddOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_organization_domain_serialize( - organization_service_add_organization_domain_request=organization_service_add_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_organization_domain_with_http_info( + organization_service_add_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceAddOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_organization_domain_serialize( + async def add_organization_domain_with_http_info( self, - organization_service_add_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_add_organization_domain_request is not None: - _body_params = organization_service_add_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_add_organization_domain_request: OrganizationServiceAddOrganizationDomainRequest, + ) -> "ApiResult[OrganizationServiceAddOrganizationDomainResponse]": + """Add Organization Domain (with HTTP info) + Add a new domain to an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.write` + :param organization_service_add_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_add_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_add_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/AddOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/AddOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_add_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceAddOrganizationDomainResponse", + None, ) - - - - @validate_call - def deactivate_organization( self, organization_service_deactivate_organization_request: OrganizationServiceDeactivateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceDeactivateOrganizationResponse: + async def deactivate_organization( + self, + organization_service_deactivate_organization_request: OrganizationServiceDeactivateOrganizationRequest, + ) -> OrganizationServiceDeactivateOrganizationResponse: """Deactivate Organization - Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + :param organization_service_deactivate_organization_request: (required) + + :return: OrganizationServiceDeactivateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_deactivate_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_deactivate_organization_request'" + ) - :param organization_service_deactivate_organization_request: (required) - :type organization_service_deactivate_organization_request: OrganizationServiceDeactivateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_organization_serialize( - organization_service_deactivate_organization_request=organization_service_deactivate_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_organization_with_http_info( + organization_service_deactivate_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceDeactivateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_organization_serialize( + async def deactivate_organization_with_http_info( self, - organization_service_deactivate_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_deactivate_organization_request is not None: - _body_params = organization_service_deactivate_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_deactivate_organization_request: OrganizationServiceDeactivateOrganizationRequest, + ) -> "ApiResult[OrganizationServiceDeactivateOrganizationResponse]": + """Deactivate Organization (with HTTP info) + Sets the state of my organization to deactivated. Users of this organization will not be able to log in. Required permission: - `org.write` + :param organization_service_deactivate_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_deactivate_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_deactivate_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/DeactivateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/DeactivateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_deactivate_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceDeactivateOrganizationResponse", + None, ) - - - - @validate_call - def delete_organization( self, organization_service_delete_organization_request: OrganizationServiceDeleteOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceDeleteOrganizationResponse: + async def delete_organization( + self, + organization_service_delete_organization_request: OrganizationServiceDeleteOrganizationRequest, + ) -> OrganizationServiceDeleteOrganizationResponse: """Delete Organization - Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + :param organization_service_delete_organization_request: (required) + + :return: OrganizationServiceDeleteOrganizationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_request'" + ) - :param organization_service_delete_organization_request: (required) - :type organization_service_delete_organization_request: OrganizationServiceDeleteOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_serialize( - organization_service_delete_organization_request=organization_service_delete_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_with_http_info( + organization_service_delete_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceDeleteOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_serialize( + async def delete_organization_with_http_info( self, - organization_service_delete_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_delete_organization_request is not None: - _body_params = organization_service_delete_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_delete_organization_request: OrganizationServiceDeleteOrganizationRequest, + ) -> "ApiResult[OrganizationServiceDeleteOrganizationResponse]": + """Delete Organization (with HTTP info) + Deletes the organization and all its resources (Users, Projects, Grants to and from the org). Users of this organization will not be able to log in. Required permission: - `org.delete` + :param organization_service_delete_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/DeleteOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/DeleteOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_delete_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceDeleteOrganizationResponse", + None, ) - - - - @validate_call - def delete_organization_domain( self, organization_service_delete_organization_domain_request: OrganizationServiceDeleteOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceDeleteOrganizationDomainResponse: + async def delete_organization_domain( + self, + organization_service_delete_organization_domain_request: OrganizationServiceDeleteOrganizationDomainRequest, + ) -> OrganizationServiceDeleteOrganizationDomainResponse: """Delete Organization Domain - Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + :param organization_service_delete_organization_domain_request: (required) + + :return: OrganizationServiceDeleteOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_domain_request'" + ) - :param organization_service_delete_organization_domain_request: (required) - :type organization_service_delete_organization_domain_request: OrganizationServiceDeleteOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_domain_serialize( - organization_service_delete_organization_domain_request=organization_service_delete_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_domain_with_http_info( + organization_service_delete_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceDeleteOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_domain_serialize( + async def delete_organization_domain_with_http_info( self, - organization_service_delete_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_delete_organization_domain_request is not None: - _body_params = organization_service_delete_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_delete_organization_domain_request: OrganizationServiceDeleteOrganizationDomainRequest, + ) -> "ApiResult[OrganizationServiceDeleteOrganizationDomainResponse]": + """Delete Organization Domain (with HTTP info) + Delete a new domain from an organization. The domains are used to identify to which organization a user belongs. If the uses use the domain for login, this will not be possible afterwards. They have to use another domain instead. Required permission: - `org.write` + :param organization_service_delete_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/DeleteOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/DeleteOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_delete_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceDeleteOrganizationDomainResponse", + None, ) - - - - @validate_call - def delete_organization_metadata( self, organization_service_delete_organization_metadata_request: OrganizationServiceDeleteOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceDeleteOrganizationMetadataResponse: + async def delete_organization_metadata( + self, + organization_service_delete_organization_metadata_request: OrganizationServiceDeleteOrganizationMetadataRequest, + ) -> OrganizationServiceDeleteOrganizationMetadataResponse: """Delete Organization Metadata - Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + :param organization_service_delete_organization_metadata_request: (required) + + :return: OrganizationServiceDeleteOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_metadata_request'" + ) - :param organization_service_delete_organization_metadata_request: (required) - :type organization_service_delete_organization_metadata_request: OrganizationServiceDeleteOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_organization_metadata_serialize( - organization_service_delete_organization_metadata_request=organization_service_delete_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_organization_metadata_with_http_info( + organization_service_delete_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceDeleteOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_organization_metadata_serialize( + async def delete_organization_metadata_with_http_info( self, - organization_service_delete_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_delete_organization_metadata_request is not None: - _body_params = organization_service_delete_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_delete_organization_metadata_request: OrganizationServiceDeleteOrganizationMetadataRequest, + ) -> "ApiResult[OrganizationServiceDeleteOrganizationMetadataResponse]": + """Delete Organization Metadata (with HTTP info) + Delete metadata objects from an organization with a specific key. Required permission: - `org.write` + :param organization_service_delete_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_delete_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_delete_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/DeleteOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/DeleteOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_delete_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceDeleteOrganizationMetadataResponse", + None, ) - - - - @validate_call - def generate_organization_domain_validation( self, organization_service_generate_organization_domain_validation_request: OrganizationServiceGenerateOrganizationDomainValidationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceGenerateOrganizationDomainValidationResponse: + async def generate_organization_domain_validation( + self, + organization_service_generate_organization_domain_validation_request: OrganizationServiceGenerateOrganizationDomainValidationRequest, + ) -> OrganizationServiceGenerateOrganizationDomainValidationResponse: """Generate Organization Domain Validation - Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + :param organization_service_generate_organization_domain_validation_request: (required) + + :return: OrganizationServiceGenerateOrganizationDomainValidationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_generate_organization_domain_validation_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_generate_organization_domain_validation_request'" + ) - :param organization_service_generate_organization_domain_validation_request: (required) - :type organization_service_generate_organization_domain_validation_request: OrganizationServiceGenerateOrganizationDomainValidationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._generate_organization_domain_validation_serialize( - organization_service_generate_organization_domain_validation_request=organization_service_generate_organization_domain_validation_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.generate_organization_domain_validation_with_http_info( + organization_service_generate_organization_domain_validation_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceGenerateOrganizationDomainValidationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _generate_organization_domain_validation_serialize( + async def generate_organization_domain_validation_with_http_info( self, - organization_service_generate_organization_domain_validation_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_generate_organization_domain_validation_request is not None: - _body_params = organization_service_generate_organization_domain_validation_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_generate_organization_domain_validation_request: OrganizationServiceGenerateOrganizationDomainValidationRequest, + ) -> "ApiResult[OrganizationServiceGenerateOrganizationDomainValidationResponse]": + """Generate Organization Domain Validation (with HTTP info) + Generate a new file to be able to verify your domain with DNS or HTTP challenge. Required permission: - `org.write` + :param organization_service_generate_organization_domain_validation_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_generate_organization_domain_validation_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_generate_organization_domain_validation_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/GenerateOrganizationDomainValidation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = ( + "/zitadel.org.v2.OrganizationService/GenerateOrganizationDomainValidation" + ) + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_generate_organization_domain_validation_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceGenerateOrganizationDomainValidationResponse", + None, ) - - - - @validate_call - def list_organization_domains( self, organization_service_list_organization_domains_request: OrganizationServiceListOrganizationDomainsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceListOrganizationDomainsResponse: + async def list_organization_domains( + self, + organization_service_list_organization_domains_request: OrganizationServiceListOrganizationDomainsRequest, + ) -> OrganizationServiceListOrganizationDomainsResponse: """List Organization Domains - Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + :param organization_service_list_organization_domains_request: (required) + + :return: OrganizationServiceListOrganizationDomainsResponse + :raises ApiException: if fails to make API call + """ + if organization_service_list_organization_domains_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organization_domains_request'" + ) - :param organization_service_list_organization_domains_request: (required) - :type organization_service_list_organization_domains_request: OrganizationServiceListOrganizationDomainsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organization_domains_serialize( - organization_service_list_organization_domains_request=organization_service_list_organization_domains_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organization_domains_with_http_info( + organization_service_list_organization_domains_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceListOrganizationDomainsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organization_domains_serialize( + async def list_organization_domains_with_http_info( self, - organization_service_list_organization_domains_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_list_organization_domains_request is not None: - _body_params = organization_service_list_organization_domains_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_list_organization_domains_request: OrganizationServiceListOrganizationDomainsRequest, + ) -> "ApiResult[OrganizationServiceListOrganizationDomainsResponse]": + """List Organization Domains (with HTTP info) + Returns the list of registered domains of an organization. The domains are used to identify to which organization a user belongs. Required permission: - `org.read` + :param organization_service_list_organization_domains_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_list_organization_domains_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organization_domains_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/ListOrganizationDomains', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/ListOrganizationDomains" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_list_organization_domains_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceListOrganizationDomainsResponse", + None, ) - - - - @validate_call - def list_organization_metadata( self, organization_service_list_organization_metadata_request: OrganizationServiceListOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceListOrganizationMetadataResponse: + async def list_organization_metadata( + self, + organization_service_list_organization_metadata_request: OrganizationServiceListOrganizationMetadataRequest, + ) -> OrganizationServiceListOrganizationMetadataResponse: """List Organization Metadata - List metadata of an organization filtered by query. Required permission: - `org.read` + :param organization_service_list_organization_metadata_request: (required) + + :return: OrganizationServiceListOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if organization_service_list_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organization_metadata_request'" + ) - :param organization_service_list_organization_metadata_request: (required) - :type organization_service_list_organization_metadata_request: OrganizationServiceListOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organization_metadata_serialize( - organization_service_list_organization_metadata_request=organization_service_list_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organization_metadata_with_http_info( + organization_service_list_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceListOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organization_metadata_serialize( + async def list_organization_metadata_with_http_info( self, - organization_service_list_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_list_organization_metadata_request is not None: - _body_params = organization_service_list_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_list_organization_metadata_request: OrganizationServiceListOrganizationMetadataRequest, + ) -> "ApiResult[OrganizationServiceListOrganizationMetadataResponse]": + """List Organization Metadata (with HTTP info) + List metadata of an organization filtered by query. Required permission: - `org.read` + :param organization_service_list_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_list_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/ListOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/ListOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_list_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceListOrganizationMetadataResponse", + None, ) - - - - @validate_call - def list_organizations( self, organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceListOrganizationsResponse: + async def list_organizations( + self, + organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest, + ) -> OrganizationServiceListOrganizationsResponse: """List Organizations - Search for Organizations. By default, we will return all organization of the instance that you have permission to read. Make sure to include a limit and sorting for pagination. Required permission: - `org.read` + :param organization_service_list_organizations_request: (required) + + :return: OrganizationServiceListOrganizationsResponse + :raises ApiException: if fails to make API call + """ + if organization_service_list_organizations_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organizations_request'" + ) - :param organization_service_list_organizations_request: (required) - :type organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_organizations_serialize( - organization_service_list_organizations_request=organization_service_list_organizations_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_organizations_with_http_info( + organization_service_list_organizations_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceListOrganizationsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_organizations_serialize( + async def list_organizations_with_http_info( self, - organization_service_list_organizations_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_list_organizations_request is not None: - _body_params = organization_service_list_organizations_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_list_organizations_request: OrganizationServiceListOrganizationsRequest, + ) -> "ApiResult[OrganizationServiceListOrganizationsResponse]": + """List Organizations (with HTTP info) + Search for Organizations. By default, we will return all organization of the instance that you have permission to read. Make sure to include a limit and sorting for pagination. Required permission: - `org.read` + :param organization_service_list_organizations_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_list_organizations_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_list_organizations_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/ListOrganizations', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/ListOrganizations" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_list_organizations_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceListOrganizationsResponse", + None, ) - - - - @validate_call - def set_organization_metadata( self, organization_service_set_organization_metadata_request: OrganizationServiceSetOrganizationMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceSetOrganizationMetadataResponse: + async def set_organization_metadata( + self, + organization_service_set_organization_metadata_request: OrganizationServiceSetOrganizationMetadataRequest, + ) -> OrganizationServiceSetOrganizationMetadataResponse: """Set Organization Metadata - Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + :param organization_service_set_organization_metadata_request: (required) + + :return: OrganizationServiceSetOrganizationMetadataResponse + :raises ApiException: if fails to make API call + """ + if organization_service_set_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_set_organization_metadata_request'" + ) - :param organization_service_set_organization_metadata_request: (required) - :type organization_service_set_organization_metadata_request: OrganizationServiceSetOrganizationMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_organization_metadata_serialize( - organization_service_set_organization_metadata_request=organization_service_set_organization_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_organization_metadata_with_http_info( + organization_service_set_organization_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceSetOrganizationMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_organization_metadata_serialize( + async def set_organization_metadata_with_http_info( self, - organization_service_set_organization_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_set_organization_metadata_request is not None: - _body_params = organization_service_set_organization_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_set_organization_metadata_request: OrganizationServiceSetOrganizationMetadataRequest, + ) -> "ApiResult[OrganizationServiceSetOrganizationMetadataResponse]": + """Set Organization Metadata (with HTTP info) + Adds or updates a metadata value for the requested key. Make sure the value is base64 encoded. Required permission: - `org.write` + :param organization_service_set_organization_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_set_organization_metadata_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_set_organization_metadata_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/SetOrganizationMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/SetOrganizationMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_set_organization_metadata_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceSetOrganizationMetadataResponse", + None, ) - - - - @validate_call - def update_organization( self, organization_service_update_organization_request: OrganizationServiceUpdateOrganizationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceUpdateOrganizationResponse: + async def update_organization( + self, + organization_service_update_organization_request: OrganizationServiceUpdateOrganizationRequest, + ) -> OrganizationServiceUpdateOrganizationResponse: """Update Organization - Change the name of the organization. Required permission: - `org.write` + :param organization_service_update_organization_request: (required) + + :return: OrganizationServiceUpdateOrganizationResponse + :raises ApiException: if fails to make API call + """ + if organization_service_update_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_update_organization_request'" + ) - :param organization_service_update_organization_request: (required) - :type organization_service_update_organization_request: OrganizationServiceUpdateOrganizationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_organization_serialize( - organization_service_update_organization_request=organization_service_update_organization_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_organization_with_http_info( + organization_service_update_organization_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceUpdateOrganizationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_organization_serialize( + async def update_organization_with_http_info( self, - organization_service_update_organization_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_update_organization_request is not None: - _body_params = organization_service_update_organization_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_update_organization_request: OrganizationServiceUpdateOrganizationRequest, + ) -> "ApiResult[OrganizationServiceUpdateOrganizationResponse]": + """Update Organization (with HTTP info) + Change the name of the organization. Required permission: - `org.write` + :param organization_service_update_organization_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_update_organization_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_update_organization_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/UpdateOrganization', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/UpdateOrganization" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_update_organization_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceUpdateOrganizationResponse", + None, ) - - - - @validate_call - def verify_organization_domain( self, organization_service_verify_organization_domain_request: OrganizationServiceVerifyOrganizationDomainRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> OrganizationServiceVerifyOrganizationDomainResponse: + async def verify_organization_domain( + self, + organization_service_verify_organization_domain_request: OrganizationServiceVerifyOrganizationDomainRequest, + ) -> OrganizationServiceVerifyOrganizationDomainResponse: """Verify Organization Domain - Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + :param organization_service_verify_organization_domain_request: (required) + + :return: OrganizationServiceVerifyOrganizationDomainResponse + :raises ApiException: if fails to make API call + """ + if organization_service_verify_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_verify_organization_domain_request'" + ) - :param organization_service_verify_organization_domain_request: (required) - :type organization_service_verify_organization_domain_request: OrganizationServiceVerifyOrganizationDomainRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_organization_domain_serialize( - organization_service_verify_organization_domain_request=organization_service_verify_organization_domain_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_organization_domain_with_http_info( + organization_service_verify_organization_domain_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "OrganizationServiceVerifyOrganizationDomainResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_organization_domain_serialize( + async def verify_organization_domain_with_http_info( self, - organization_service_verify_organization_domain_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if organization_service_verify_organization_domain_request is not None: - _body_params = organization_service_verify_organization_domain_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + organization_service_verify_organization_domain_request: OrganizationServiceVerifyOrganizationDomainRequest, + ) -> "ApiResult[OrganizationServiceVerifyOrganizationDomainResponse]": + """Verify Organization Domain (with HTTP info) + Make sure you have added the required verification to your domain, depending on the method you have chosen (HTTP or DNS challenge). ZITADEL will check it and set the domain as verified if it was successful. A verify domain has to be unique. Required permission: - `org.write` + :param organization_service_verify_organization_domain_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if organization_service_verify_organization_domain_request is None: + raise ValueError( + "Missing the required parameter 'organization_service_verify_organization_domain_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.org.v2.OrganizationService/VerifyOrganizationDomain', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.org.v2.OrganizationService/VerifyOrganizationDomain" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = organization_service_verify_organization_domain_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "OrganizationServiceVerifyOrganizationDomainResponse", + None, ) - - diff --git a/zitadel_client/api/project_service_api.py b/zitadel_client/api/project_service_api.py index 2d3709b3..1fb8a90d 100644 --- a/zitadel_client/api/project_service_api.py +++ b/zitadel_client/api/project_service_api.py @@ -1,2245 +1,1254 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.project_service_activate_project_grant_request import ProjectServiceActivateProjectGrantRequest -from zitadel_client.models.project_service_activate_project_grant_response import ProjectServiceActivateProjectGrantResponse -from zitadel_client.models.project_service_activate_project_request import ProjectServiceActivateProjectRequest -from zitadel_client.models.project_service_activate_project_response import ProjectServiceActivateProjectResponse -from zitadel_client.models.project_service_add_project_role_request import ProjectServiceAddProjectRoleRequest -from zitadel_client.models.project_service_add_project_role_response import ProjectServiceAddProjectRoleResponse -from zitadel_client.models.project_service_create_project_grant_request import ProjectServiceCreateProjectGrantRequest -from zitadel_client.models.project_service_create_project_grant_response import ProjectServiceCreateProjectGrantResponse -from zitadel_client.models.project_service_create_project_request import ProjectServiceCreateProjectRequest -from zitadel_client.models.project_service_create_project_response import ProjectServiceCreateProjectResponse -from zitadel_client.models.project_service_deactivate_project_grant_request import ProjectServiceDeactivateProjectGrantRequest -from zitadel_client.models.project_service_deactivate_project_grant_response import ProjectServiceDeactivateProjectGrantResponse -from zitadel_client.models.project_service_deactivate_project_request import ProjectServiceDeactivateProjectRequest -from zitadel_client.models.project_service_deactivate_project_response import ProjectServiceDeactivateProjectResponse -from zitadel_client.models.project_service_delete_project_grant_request import ProjectServiceDeleteProjectGrantRequest -from zitadel_client.models.project_service_delete_project_grant_response import ProjectServiceDeleteProjectGrantResponse -from zitadel_client.models.project_service_delete_project_request import ProjectServiceDeleteProjectRequest -from zitadel_client.models.project_service_delete_project_response import ProjectServiceDeleteProjectResponse -from zitadel_client.models.project_service_get_project_request import ProjectServiceGetProjectRequest -from zitadel_client.models.project_service_get_project_response import ProjectServiceGetProjectResponse -from zitadel_client.models.project_service_list_project_grants_request import ProjectServiceListProjectGrantsRequest -from zitadel_client.models.project_service_list_project_grants_response import ProjectServiceListProjectGrantsResponse -from zitadel_client.models.project_service_list_project_roles_request import ProjectServiceListProjectRolesRequest -from zitadel_client.models.project_service_list_project_roles_response import ProjectServiceListProjectRolesResponse -from zitadel_client.models.project_service_list_projects_request import ProjectServiceListProjectsRequest -from zitadel_client.models.project_service_list_projects_response import ProjectServiceListProjectsResponse -from zitadel_client.models.project_service_remove_project_role_request import ProjectServiceRemoveProjectRoleRequest -from zitadel_client.models.project_service_remove_project_role_response import ProjectServiceRemoveProjectRoleResponse -from zitadel_client.models.project_service_update_project_grant_request import ProjectServiceUpdateProjectGrantRequest -from zitadel_client.models.project_service_update_project_grant_response import ProjectServiceUpdateProjectGrantResponse -from zitadel_client.models.project_service_update_project_request import ProjectServiceUpdateProjectRequest -from zitadel_client.models.project_service_update_project_response import ProjectServiceUpdateProjectResponse -from zitadel_client.models.project_service_update_project_role_request import ProjectServiceUpdateProjectRoleRequest -from zitadel_client.models.project_service_update_project_role_response import ProjectServiceUpdateProjectRoleResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class ProjectServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def activate_project( self, project_service_activate_project_request: ProjectServiceActivateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceActivateProjectResponse: - """Activate Project +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.project_service_activate_project_grant_request import ( + ProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.project_service_activate_project_grant_response import ( + ProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.project_service_activate_project_request import ( + ProjectServiceActivateProjectRequest, +) +from zitadel_client.models.project_service_activate_project_response import ( + ProjectServiceActivateProjectResponse, +) +from zitadel_client.models.project_service_add_project_role_request import ( + ProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.project_service_add_project_role_response import ( + ProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.project_service_create_project_grant_request import ( + ProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.project_service_create_project_grant_response import ( + ProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.project_service_create_project_request import ( + ProjectServiceCreateProjectRequest, +) +from zitadel_client.models.project_service_create_project_response import ( + ProjectServiceCreateProjectResponse, +) +from zitadel_client.models.project_service_deactivate_project_grant_request import ( + ProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.project_service_deactivate_project_grant_response import ( + ProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.project_service_deactivate_project_request import ( + ProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.project_service_deactivate_project_response import ( + ProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.project_service_delete_project_grant_request import ( + ProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.project_service_delete_project_grant_response import ( + ProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.project_service_delete_project_request import ( + ProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.project_service_delete_project_response import ( + ProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.project_service_get_project_request import ( + ProjectServiceGetProjectRequest, +) +from zitadel_client.models.project_service_get_project_response import ( + ProjectServiceGetProjectResponse, +) +from zitadel_client.models.project_service_list_project_grants_request import ( + ProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.project_service_list_project_grants_response import ( + ProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.project_service_list_project_roles_request import ( + ProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.project_service_list_project_roles_response import ( + ProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.project_service_list_projects_request import ( + ProjectServiceListProjectsRequest, +) +from zitadel_client.models.project_service_list_projects_response import ( + ProjectServiceListProjectsResponse, +) +from zitadel_client.models.project_service_remove_project_role_request import ( + ProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.project_service_remove_project_role_response import ( + ProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.project_service_update_project_grant_request import ( + ProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.project_service_update_project_grant_response import ( + ProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.project_service_update_project_request import ( + ProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.project_service_update_project_response import ( + ProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.project_service_update_project_role_request import ( + ProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.project_service_update_project_role_response import ( + ProjectServiceUpdateProjectRoleResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class ProjectServiceApi(BaseApi): + """ProjectServiceApi provides methods for the ProjectService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def activate_project( + self, + project_service_activate_project_request: ProjectServiceActivateProjectRequest, + ) -> ProjectServiceActivateProjectResponse: + """Activate Project Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + :param project_service_activate_project_request: (required) + + :return: ProjectServiceActivateProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_activate_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_activate_project_request'" + ) - :param project_service_activate_project_request: (required) - :type project_service_activate_project_request: ProjectServiceActivateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_project_serialize( - project_service_activate_project_request=project_service_activate_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_project_with_http_info( + project_service_activate_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceActivateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_project_serialize( + async def activate_project_with_http_info( self, - project_service_activate_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_activate_project_request is not None: - _body_params = project_service_activate_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_activate_project_request: ProjectServiceActivateProjectRequest, + ) -> "ApiResult[ProjectServiceActivateProjectResponse]": + """Activate Project (with HTTP info) + Set the state of a project to active. Request returns no error if the project is already activated. Required permission: - `project.write` + :param project_service_activate_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_activate_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_activate_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/ActivateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/ActivateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_activate_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceActivateProjectResponse", + None, ) - - - - @validate_call - def activate_project_grant( self, project_service_activate_project_grant_request: ProjectServiceActivateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceActivateProjectGrantResponse: + async def activate_project_grant( + self, + project_service_activate_project_grant_request: ProjectServiceActivateProjectGrantRequest, + ) -> ProjectServiceActivateProjectGrantResponse: """Activate Project Grant - Set the state of the project grant to activated. Required permission: - `project.grant.write` + :param project_service_activate_project_grant_request: (required) + + :return: ProjectServiceActivateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if project_service_activate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_activate_project_grant_request'" + ) - :param project_service_activate_project_grant_request: (required) - :type project_service_activate_project_grant_request: ProjectServiceActivateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_project_grant_serialize( - project_service_activate_project_grant_request=project_service_activate_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_project_grant_with_http_info( + project_service_activate_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceActivateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_project_grant_serialize( + async def activate_project_grant_with_http_info( self, - project_service_activate_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_activate_project_grant_request is not None: - _body_params = project_service_activate_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_activate_project_grant_request: ProjectServiceActivateProjectGrantRequest, + ) -> "ApiResult[ProjectServiceActivateProjectGrantResponse]": + """Activate Project Grant (with HTTP info) + Set the state of the project grant to activated. Required permission: - `project.grant.write` + :param project_service_activate_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_activate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_activate_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/ActivateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/ActivateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_activate_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceActivateProjectGrantResponse", + None, ) - - - - @validate_call - def add_project_role( self, project_service_add_project_role_request: ProjectServiceAddProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceAddProjectRoleResponse: + async def add_project_role( + self, + project_service_add_project_role_request: ProjectServiceAddProjectRoleRequest, + ) -> ProjectServiceAddProjectRoleResponse: """Add Project Role - Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + :param project_service_add_project_role_request: (required) + + :return: ProjectServiceAddProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if project_service_add_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_add_project_role_request'" + ) - :param project_service_add_project_role_request: (required) - :type project_service_add_project_role_request: ProjectServiceAddProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_project_role_serialize( - project_service_add_project_role_request=project_service_add_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_project_role_with_http_info( + project_service_add_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceAddProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_project_role_serialize( + async def add_project_role_with_http_info( self, - project_service_add_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_add_project_role_request is not None: - _body_params = project_service_add_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_add_project_role_request: ProjectServiceAddProjectRoleRequest, + ) -> "ApiResult[ProjectServiceAddProjectRoleResponse]": + """Add Project Role (with HTTP info) + Add a new project role to a project. The key must be unique within the project. Required permission: - `project.role.write` + :param project_service_add_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_add_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_add_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/AddProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/AddProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_add_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceAddProjectRoleResponse", + None, ) - - - - @validate_call - def create_project( self, project_service_create_project_request: ProjectServiceCreateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceCreateProjectResponse: + async def create_project( + self, + project_service_create_project_request: ProjectServiceCreateProjectRequest, + ) -> ProjectServiceCreateProjectResponse: """Create Project - Create a new project. A project is a vessel to group applications, roles and authorizations. Every project belongs to exactly one organization, but can be granted to other organizations for self-management of their authorizations. Required permission: - `project.create` + :param project_service_create_project_request: (required) + + :return: ProjectServiceCreateProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_create_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_create_project_request'" + ) - :param project_service_create_project_request: (required) - :type project_service_create_project_request: ProjectServiceCreateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_project_serialize( - project_service_create_project_request=project_service_create_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_project_with_http_info( + project_service_create_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceCreateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_project_serialize( + async def create_project_with_http_info( self, - project_service_create_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_create_project_request is not None: - _body_params = project_service_create_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_create_project_request: ProjectServiceCreateProjectRequest, + ) -> "ApiResult[ProjectServiceCreateProjectResponse]": + """Create Project (with HTTP info) + Create a new project. A project is a vessel to group applications, roles and authorizations. Every project belongs to exactly one organization, but can be granted to other organizations for self-management of their authorizations. Required permission: - `project.create` + :param project_service_create_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_create_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_create_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/CreateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/CreateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_create_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceCreateProjectResponse", + None, ) - - - - @validate_call - def create_project_grant( self, project_service_create_project_grant_request: ProjectServiceCreateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceCreateProjectGrantResponse: + async def create_project_grant( + self, + project_service_create_project_grant_request: ProjectServiceCreateProjectGrantRequest, + ) -> ProjectServiceCreateProjectGrantResponse: """Create Project Grant - Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + :param project_service_create_project_grant_request: (required) + + :return: ProjectServiceCreateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if project_service_create_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_create_project_grant_request'" + ) - :param project_service_create_project_grant_request: (required) - :type project_service_create_project_grant_request: ProjectServiceCreateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_project_grant_serialize( - project_service_create_project_grant_request=project_service_create_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_project_grant_with_http_info( + project_service_create_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceCreateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_project_grant_serialize( + async def create_project_grant_with_http_info( self, - project_service_create_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_create_project_grant_request is not None: - _body_params = project_service_create_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_create_project_grant_request: ProjectServiceCreateProjectGrantRequest, + ) -> "ApiResult[ProjectServiceCreateProjectGrantResponse]": + """Create Project Grant (with HTTP info) + Grant a project to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.create` + :param project_service_create_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_create_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_create_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/CreateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/CreateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_create_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceCreateProjectGrantResponse", + None, ) - - - - @validate_call - def deactivate_project( self, project_service_deactivate_project_request: ProjectServiceDeactivateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceDeactivateProjectResponse: + async def deactivate_project( + self, + project_service_deactivate_project_request: ProjectServiceDeactivateProjectRequest, + ) -> ProjectServiceDeactivateProjectResponse: """Deactivate Project - Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + :param project_service_deactivate_project_request: (required) + + :return: ProjectServiceDeactivateProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_deactivate_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_deactivate_project_request'" + ) - :param project_service_deactivate_project_request: (required) - :type project_service_deactivate_project_request: ProjectServiceDeactivateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_project_serialize( - project_service_deactivate_project_request=project_service_deactivate_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_project_with_http_info( + project_service_deactivate_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceDeactivateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_project_serialize( + async def deactivate_project_with_http_info( self, - project_service_deactivate_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_deactivate_project_request is not None: - _body_params = project_service_deactivate_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_deactivate_project_request: ProjectServiceDeactivateProjectRequest, + ) -> "ApiResult[ProjectServiceDeactivateProjectResponse]": + """Deactivate Project (with HTTP info) + Set the state of a project to deactivated. Request returns no error if the project is already deactivated. Applications under deactivated projects are not able to login anymore. Required permission: - `project.write` + :param project_service_deactivate_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_deactivate_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_deactivate_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/DeactivateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/DeactivateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_deactivate_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceDeactivateProjectResponse", + None, ) - - - - @validate_call - def deactivate_project_grant( self, project_service_deactivate_project_grant_request: ProjectServiceDeactivateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceDeactivateProjectGrantResponse: + async def deactivate_project_grant( + self, + project_service_deactivate_project_grant_request: ProjectServiceDeactivateProjectGrantRequest, + ) -> ProjectServiceDeactivateProjectGrantResponse: """Deactivate Project Grant - Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + :param project_service_deactivate_project_grant_request: (required) + + :return: ProjectServiceDeactivateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if project_service_deactivate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_deactivate_project_grant_request'" + ) - :param project_service_deactivate_project_grant_request: (required) - :type project_service_deactivate_project_grant_request: ProjectServiceDeactivateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_project_grant_serialize( - project_service_deactivate_project_grant_request=project_service_deactivate_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_project_grant_with_http_info( + project_service_deactivate_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceDeactivateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_project_grant_serialize( + async def deactivate_project_grant_with_http_info( self, - project_service_deactivate_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_deactivate_project_grant_request is not None: - _body_params = project_service_deactivate_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_deactivate_project_grant_request: ProjectServiceDeactivateProjectGrantRequest, + ) -> "ApiResult[ProjectServiceDeactivateProjectGrantResponse]": + """Deactivate Project Grant (with HTTP info) + Set the state of the project grant to deactivated. Applications under deactivated projects grants are not able to login anymore. Required permission: - `project.grant.write` + :param project_service_deactivate_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_deactivate_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_deactivate_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/DeactivateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/DeactivateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_deactivate_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceDeactivateProjectGrantResponse", + None, ) - - - - @validate_call - def delete_project( self, project_service_delete_project_request: ProjectServiceDeleteProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceDeleteProjectResponse: + async def delete_project( + self, + project_service_delete_project_request: ProjectServiceDeleteProjectRequest, + ) -> ProjectServiceDeleteProjectResponse: """Delete Project - Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + :param project_service_delete_project_request: (required) + + :return: ProjectServiceDeleteProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_delete_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_delete_project_request'" + ) - :param project_service_delete_project_request: (required) - :type project_service_delete_project_request: ProjectServiceDeleteProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_project_serialize( - project_service_delete_project_request=project_service_delete_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_project_with_http_info( + project_service_delete_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceDeleteProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_project_serialize( + async def delete_project_with_http_info( self, - project_service_delete_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_delete_project_request is not None: - _body_params = project_service_delete_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_delete_project_request: ProjectServiceDeleteProjectRequest, + ) -> "ApiResult[ProjectServiceDeleteProjectResponse]": + """Delete Project (with HTTP info) + Delete an existing project. In case the project is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.delete` + :param project_service_delete_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_delete_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_delete_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/DeleteProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/DeleteProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_delete_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceDeleteProjectResponse", + None, ) - - - - @validate_call - def delete_project_grant( self, project_service_delete_project_grant_request: ProjectServiceDeleteProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceDeleteProjectGrantResponse: + async def delete_project_grant( + self, + project_service_delete_project_grant_request: ProjectServiceDeleteProjectGrantRequest, + ) -> ProjectServiceDeleteProjectGrantResponse: """Delete Project Grant - Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + :param project_service_delete_project_grant_request: (required) + + :return: ProjectServiceDeleteProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if project_service_delete_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_delete_project_grant_request'" + ) - :param project_service_delete_project_grant_request: (required) - :type project_service_delete_project_grant_request: ProjectServiceDeleteProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_project_grant_serialize( - project_service_delete_project_grant_request=project_service_delete_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_project_grant_with_http_info( + project_service_delete_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceDeleteProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_project_grant_serialize( + async def delete_project_grant_with_http_info( self, - project_service_delete_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_delete_project_grant_request is not None: - _body_params = project_service_delete_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_delete_project_grant_request: ProjectServiceDeleteProjectGrantRequest, + ) -> "ApiResult[ProjectServiceDeleteProjectGrantResponse]": + """Delete Project Grant (with HTTP info) + Delete a project grant. All user grants for this project grant will also be removed. A user will not have access to the project afterward (if permissions are checked). In case the project grant is not found, the request will return a successful response as the desired state is already achieved. Required permission: - `project.grant.delete` + :param project_service_delete_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_delete_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_delete_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/DeleteProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/DeleteProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_delete_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceDeleteProjectGrantResponse", + None, ) - - - - @validate_call - def get_project( self, project_service_get_project_request: ProjectServiceGetProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceGetProjectResponse: + async def get_project( + self, + project_service_get_project_request: ProjectServiceGetProjectRequest, + ) -> ProjectServiceGetProjectResponse: """Get Project - Returns the project identified by the requested ID. Required permission: - `project.read` + :param project_service_get_project_request: (required) + + :return: ProjectServiceGetProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_get_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_get_project_request'" + ) - :param project_service_get_project_request: (required) - :type project_service_get_project_request: ProjectServiceGetProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_project_serialize( - project_service_get_project_request=project_service_get_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_project_with_http_info( + project_service_get_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceGetProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_project_serialize( + async def get_project_with_http_info( self, - project_service_get_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_get_project_request is not None: - _body_params = project_service_get_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_get_project_request: ProjectServiceGetProjectRequest, + ) -> "ApiResult[ProjectServiceGetProjectResponse]": + """Get Project (with HTTP info) + Returns the project identified by the requested ID. Required permission: - `project.read` + :param project_service_get_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_get_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_get_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/GetProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/GetProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_get_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceGetProjectResponse", + None, ) - - - - @validate_call - def list_project_grants( self, project_service_list_project_grants_request: ProjectServiceListProjectGrantsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceListProjectGrantsResponse: + async def list_project_grants( + self, + project_service_list_project_grants_request: ProjectServiceListProjectGrantsRequest, + ) -> ProjectServiceListProjectGrantsResponse: """List Project Grants - Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.read` + :param project_service_list_project_grants_request: (required) + + :return: ProjectServiceListProjectGrantsResponse + :raises ApiException: if fails to make API call + """ + if project_service_list_project_grants_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_project_grants_request'" + ) - :param project_service_list_project_grants_request: (required) - :type project_service_list_project_grants_request: ProjectServiceListProjectGrantsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_project_grants_serialize( - project_service_list_project_grants_request=project_service_list_project_grants_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_project_grants_with_http_info( + project_service_list_project_grants_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceListProjectGrantsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_project_grants_serialize( + async def list_project_grants_with_http_info( self, - project_service_list_project_grants_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_list_project_grants_request is not None: - _body_params = project_service_list_project_grants_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_list_project_grants_request: ProjectServiceListProjectGrantsRequest, + ) -> "ApiResult[ProjectServiceListProjectGrantsResponse]": + """List Project Grants (with HTTP info) + Returns a list of project grants. A project grant is when the organization grants its project to another organization. Required permission: - `project.grant.read` + :param project_service_list_project_grants_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_list_project_grants_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_project_grants_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/ListProjectGrants', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/ListProjectGrants" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_list_project_grants_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceListProjectGrantsResponse", + None, ) - - - - @validate_call - def list_project_roles( self, project_service_list_project_roles_request: ProjectServiceListProjectRolesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceListProjectRolesResponse: + async def list_project_roles( + self, + project_service_list_project_roles_request: ProjectServiceListProjectRolesRequest, + ) -> ProjectServiceListProjectRolesResponse: """List Project Roles - Returns all roles of a project matching the search query. Required permission: - `project.role.read` + :param project_service_list_project_roles_request: (required) + + :return: ProjectServiceListProjectRolesResponse + :raises ApiException: if fails to make API call + """ + if project_service_list_project_roles_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_project_roles_request'" + ) - :param project_service_list_project_roles_request: (required) - :type project_service_list_project_roles_request: ProjectServiceListProjectRolesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_project_roles_serialize( - project_service_list_project_roles_request=project_service_list_project_roles_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_project_roles_with_http_info( + project_service_list_project_roles_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceListProjectRolesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_project_roles_serialize( + async def list_project_roles_with_http_info( self, - project_service_list_project_roles_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_list_project_roles_request is not None: - _body_params = project_service_list_project_roles_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_list_project_roles_request: ProjectServiceListProjectRolesRequest, + ) -> "ApiResult[ProjectServiceListProjectRolesResponse]": + """List Project Roles (with HTTP info) + Returns all roles of a project matching the search query. Required permission: - `project.role.read` + :param project_service_list_project_roles_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_list_project_roles_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_project_roles_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/ListProjectRoles', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/ListProjectRoles" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_list_project_roles_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceListProjectRolesResponse", + None, ) - - - - @validate_call - def list_projects( self, project_service_list_projects_request: ProjectServiceListProjectsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceListProjectsResponse: + async def list_projects( + self, + project_service_list_projects_request: ProjectServiceListProjectsRequest, + ) -> ProjectServiceListProjectsResponse: """List Projects - List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + :param project_service_list_projects_request: (required) + + :return: ProjectServiceListProjectsResponse + :raises ApiException: if fails to make API call + """ + if project_service_list_projects_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_projects_request'" + ) - :param project_service_list_projects_request: (required) - :type project_service_list_projects_request: ProjectServiceListProjectsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_projects_serialize( - project_service_list_projects_request=project_service_list_projects_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_projects_with_http_info( + project_service_list_projects_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceListProjectsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_projects_serialize( + async def list_projects_with_http_info( self, - project_service_list_projects_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_list_projects_request is not None: - _body_params = project_service_list_projects_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_list_projects_request: ProjectServiceListProjectsRequest, + ) -> "ApiResult[ProjectServiceListProjectsResponse]": + """List Projects (with HTTP info) + List all matching projects. By default all projects of the instance that the caller has permission to read are returned. Make sure to include a limit and sorting for pagination. Required permission: - `project.read` + :param project_service_list_projects_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_list_projects_request is None: + raise ValueError( + "Missing the required parameter 'project_service_list_projects_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/ListProjects', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/ListProjects" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_list_projects_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceListProjectsResponse", + None, ) - - - - @validate_call - def remove_project_role( self, project_service_remove_project_role_request: ProjectServiceRemoveProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceRemoveProjectRoleResponse: + async def remove_project_role( + self, + project_service_remove_project_role_request: ProjectServiceRemoveProjectRoleRequest, + ) -> ProjectServiceRemoveProjectRoleResponse: """Remove Project Role - Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + :param project_service_remove_project_role_request: (required) + + :return: ProjectServiceRemoveProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if project_service_remove_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_remove_project_role_request'" + ) - :param project_service_remove_project_role_request: (required) - :type project_service_remove_project_role_request: ProjectServiceRemoveProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_project_role_serialize( - project_service_remove_project_role_request=project_service_remove_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_project_role_with_http_info( + project_service_remove_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceRemoveProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_project_role_serialize( + async def remove_project_role_with_http_info( self, - project_service_remove_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_remove_project_role_request is not None: - _body_params = project_service_remove_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_remove_project_role_request: ProjectServiceRemoveProjectRoleRequest, + ) -> "ApiResult[ProjectServiceRemoveProjectRoleResponse]": + """Remove Project Role (with HTTP info) + Removes the role from the project and on every resource it has a dependency. This includes project grants and user grants. Required permission: - `project.role.write` + :param project_service_remove_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_remove_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_remove_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/RemoveProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/RemoveProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_remove_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceRemoveProjectRoleResponse", + None, ) - - - - @validate_call - def update_project( self, project_service_update_project_request: ProjectServiceUpdateProjectRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceUpdateProjectResponse: + async def update_project( + self, + project_service_update_project_request: ProjectServiceUpdateProjectRequest, + ) -> ProjectServiceUpdateProjectResponse: """Update Project - Update an existing project. Required permission: - `project.write` + :param project_service_update_project_request: (required) + + :return: ProjectServiceUpdateProjectResponse + :raises ApiException: if fails to make API call + """ + if project_service_update_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_request'" + ) - :param project_service_update_project_request: (required) - :type project_service_update_project_request: ProjectServiceUpdateProjectRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_serialize( - project_service_update_project_request=project_service_update_project_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_with_http_info( + project_service_update_project_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceUpdateProjectResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_serialize( + async def update_project_with_http_info( self, - project_service_update_project_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_update_project_request is not None: - _body_params = project_service_update_project_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_update_project_request: ProjectServiceUpdateProjectRequest, + ) -> "ApiResult[ProjectServiceUpdateProjectResponse]": + """Update Project (with HTTP info) + Update an existing project. Required permission: - `project.write` + :param project_service_update_project_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_update_project_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/UpdateProject', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/UpdateProject" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_update_project_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceUpdateProjectResponse", + None, ) - - - - @validate_call - def update_project_grant( self, project_service_update_project_grant_request: ProjectServiceUpdateProjectGrantRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceUpdateProjectGrantResponse: + async def update_project_grant( + self, + project_service_update_project_grant_request: ProjectServiceUpdateProjectGrantRequest, + ) -> ProjectServiceUpdateProjectGrantResponse: """Update Project Grant - Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + :param project_service_update_project_grant_request: (required) + + :return: ProjectServiceUpdateProjectGrantResponse + :raises ApiException: if fails to make API call + """ + if project_service_update_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_grant_request'" + ) - :param project_service_update_project_grant_request: (required) - :type project_service_update_project_grant_request: ProjectServiceUpdateProjectGrantRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_grant_serialize( - project_service_update_project_grant_request=project_service_update_project_grant_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_grant_with_http_info( + project_service_update_project_grant_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceUpdateProjectGrantResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_grant_serialize( + async def update_project_grant_with_http_info( self, - project_service_update_project_grant_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_update_project_grant_request is not None: - _body_params = project_service_update_project_grant_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_update_project_grant_request: ProjectServiceUpdateProjectGrantRequest, + ) -> "ApiResult[ProjectServiceUpdateProjectGrantResponse]": + """Update Project Grant (with HTTP info) + Change the roles of the project that is granted to another organization. The project grant will allow the granted organization to access the project and manage the authorizations for its users. Required permission: - `project.grant.write` + :param project_service_update_project_grant_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_update_project_grant_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_grant_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/UpdateProjectGrant', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/UpdateProjectGrant" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_update_project_grant_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceUpdateProjectGrantResponse", + None, ) - - - - @validate_call - def update_project_role( self, project_service_update_project_role_request: ProjectServiceUpdateProjectRoleRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ProjectServiceUpdateProjectRoleResponse: + async def update_project_role( + self, + project_service_update_project_role_request: ProjectServiceUpdateProjectRoleRequest, + ) -> ProjectServiceUpdateProjectRoleResponse: """Update Project Role - Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + :param project_service_update_project_role_request: (required) + + :return: ProjectServiceUpdateProjectRoleResponse + :raises ApiException: if fails to make API call + """ + if project_service_update_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_role_request'" + ) - :param project_service_update_project_role_request: (required) - :type project_service_update_project_role_request: ProjectServiceUpdateProjectRoleRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_project_role_serialize( - project_service_update_project_role_request=project_service_update_project_role_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_project_role_with_http_info( + project_service_update_project_role_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "ProjectServiceUpdateProjectRoleResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_project_role_serialize( + async def update_project_role_with_http_info( self, - project_service_update_project_role_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if project_service_update_project_role_request is not None: - _body_params = project_service_update_project_role_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + project_service_update_project_role_request: ProjectServiceUpdateProjectRoleRequest, + ) -> "ApiResult[ProjectServiceUpdateProjectRoleResponse]": + """Update Project Role (with HTTP info) + Change a project role. The key is not editable. If a key should change, remove the role and create a new one. Required permission: - `project.role.write` + :param project_service_update_project_role_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if project_service_update_project_role_request is None: + raise ValueError( + "Missing the required parameter 'project_service_update_project_role_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.project.v2.ProjectService/UpdateProjectRole', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.project.v2.ProjectService/UpdateProjectRole" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = project_service_update_project_role_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "ProjectServiceUpdateProjectRoleResponse", + None, ) - - diff --git a/zitadel_client/api/saml_service_api.py b/zitadel_client/api/saml_service_api.py index ce70c7e7..cc7b92de 100644 --- a/zitadel_client/api/saml_service_api.py +++ b/zitadel_client/api/saml_service_api.py @@ -1,297 +1,174 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.saml_service_create_response_request import SAMLServiceCreateResponseRequest -from zitadel_client.models.saml_service_create_response_response import SAMLServiceCreateResponseResponse -from zitadel_client.models.saml_service_get_saml_request_request import SAMLServiceGetSAMLRequestRequest -from zitadel_client.models.saml_service_get_saml_request_response import SAMLServiceGetSAMLRequestResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class SAMLServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.saml_service_create_response_request import ( + SAMLServiceCreateResponseRequest, +) +from zitadel_client.models.saml_service_create_response_response import ( + SAMLServiceCreateResponseResponse, +) +from zitadel_client.models.saml_service_get_saml_request_request import ( + SAMLServiceGetSAMLRequestRequest, +) +from zitadel_client.models.saml_service_get_saml_request_response import ( + SAMLServiceGetSAMLRequestResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class SAMLServiceApi(BaseApi): + """SAMLServiceApi provides methods for the SAMLService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_response( self, saml_service_create_response_request: Optional[SAMLServiceCreateResponseRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SAMLServiceCreateResponseResponse: - if saml_service_create_response_request is None: - saml_service_create_response_request = {} + async def create_response( + self, + saml_service_create_response_request: SAMLServiceCreateResponseRequest, + ) -> SAMLServiceCreateResponseResponse: """Create Response - Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. Required permissions: - `session.link` + :param saml_service_create_response_request: (required) - :param saml_service_create_response_request: (required) - :type saml_service_create_response_request: SAMLServiceCreateResponseRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 + :return: SAMLServiceCreateResponseResponse + :raises ApiException: if fails to make API call + """ + if saml_service_create_response_request is None: + raise ValueError( + "Missing the required parameter 'saml_service_create_response_request'" + ) - _param = self._create_response_serialize( - saml_service_create_response_request=saml_service_create_response_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_response_with_http_info( + saml_service_create_response_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceCreateResponseResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_response_serialize( + async def create_response_with_http_info( self, - saml_service_create_response_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if saml_service_create_response_request is not None: - _body_params = saml_service_create_response_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + saml_service_create_response_request: SAMLServiceCreateResponseRequest, + ) -> "ApiResult[SAMLServiceCreateResponseResponse]": + """Create Response (with HTTP info) + Finalize a SAML Request and get the response definition for success or failure. The response must be handled as per the SAML definition to inform the application about the success or failure. On success, the response contains details for the application to obtain the SAMLResponse. This method can only be called once for an SAML request. Required permissions: - `session.link` + :param saml_service_create_response_request: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if saml_service_create_response_request is None: + raise ValueError( + "Missing the required parameter 'saml_service_create_response_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.saml.v2.SAMLService/CreateResponse', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.saml.v2.SAMLService/CreateResponse" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = saml_service_create_response_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SAMLServiceCreateResponseResponse", + None, ) - - - - @validate_call - def get_saml_request( self, saml_service_get_saml_request_request: SAMLServiceGetSAMLRequestRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SAMLServiceGetSAMLRequestResponse: + async def get_saml_request( + self, + saml_service_get_saml_request_request: SAMLServiceGetSAMLRequestRequest, + ) -> SAMLServiceGetSAMLRequestResponse: """Get SAML Request - Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. Required permissions: - `session.read` + :param saml_service_get_saml_request_request: (required) + + :return: SAMLServiceGetSAMLRequestResponse + :raises ApiException: if fails to make API call + """ + if saml_service_get_saml_request_request is None: + raise ValueError( + "Missing the required parameter 'saml_service_get_saml_request_request'" + ) - :param saml_service_get_saml_request_request: (required) - :type saml_service_get_saml_request_request: SAMLServiceGetSAMLRequestRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_saml_request_serialize( - saml_service_get_saml_request_request=saml_service_get_saml_request_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SAMLServiceGetSAMLRequestResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_saml_request_with_http_info( + saml_service_get_saml_request_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_saml_request_serialize( - self, - saml_service_get_saml_request_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if saml_service_get_saml_request_request is not None: - _body_params = saml_service_get_saml_request_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_saml_request_with_http_info( + self, + saml_service_get_saml_request_request: SAMLServiceGetSAMLRequestRequest, + ) -> "ApiResult[SAMLServiceGetSAMLRequestResponse]": + """Get SAML Request (with HTTP info) + Get SAML Request details by ID. Returns details that are parsed from the application's SAML Request. Required permissions: - `session.read` + :param saml_service_get_saml_request_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if saml_service_get_saml_request_request is None: + raise ValueError( + "Missing the required parameter 'saml_service_get_saml_request_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.saml.v2.SAMLService/GetSAMLRequest', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.saml.v2.SAMLService/GetSAMLRequest" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = saml_service_get_saml_request_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SAMLServiceGetSAMLRequestResponse", + None, ) - - diff --git a/zitadel_client/api/session_service_api.py b/zitadel_client/api/session_service_api.py index 3a7240c2..6724f408 100644 --- a/zitadel_client/api/session_service_api.py +++ b/zitadel_client/api/session_service_api.py @@ -1,685 +1,390 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.session_service_create_session_request import SessionServiceCreateSessionRequest -from zitadel_client.models.session_service_create_session_response import SessionServiceCreateSessionResponse -from zitadel_client.models.session_service_delete_session_request import SessionServiceDeleteSessionRequest -from zitadel_client.models.session_service_delete_session_response import SessionServiceDeleteSessionResponse -from zitadel_client.models.session_service_get_session_request import SessionServiceGetSessionRequest -from zitadel_client.models.session_service_get_session_response import SessionServiceGetSessionResponse -from zitadel_client.models.session_service_list_sessions_request import SessionServiceListSessionsRequest -from zitadel_client.models.session_service_list_sessions_response import SessionServiceListSessionsResponse -from zitadel_client.models.session_service_set_session_request import SessionServiceSetSessionRequest -from zitadel_client.models.session_service_set_session_response import SessionServiceSetSessionResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class SessionServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.session_service_create_session_request import ( + SessionServiceCreateSessionRequest, +) +from zitadel_client.models.session_service_create_session_response import ( + SessionServiceCreateSessionResponse, +) +from zitadel_client.models.session_service_delete_session_request import ( + SessionServiceDeleteSessionRequest, +) +from zitadel_client.models.session_service_delete_session_response import ( + SessionServiceDeleteSessionResponse, +) +from zitadel_client.models.session_service_get_session_request import ( + SessionServiceGetSessionRequest, +) +from zitadel_client.models.session_service_get_session_response import ( + SessionServiceGetSessionResponse, +) +from zitadel_client.models.session_service_list_sessions_request import ( + SessionServiceListSessionsRequest, +) +from zitadel_client.models.session_service_list_sessions_response import ( + SessionServiceListSessionsResponse, +) +from zitadel_client.models.session_service_set_session_request import ( + SessionServiceSetSessionRequest, +) +from zitadel_client.models.session_service_set_session_response import ( + SessionServiceSetSessionResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class SessionServiceApi(BaseApi): + """SessionServiceApi provides methods for the SessionService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def create_session( self, session_service_create_session_request: SessionServiceCreateSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceCreateSessionResponse: + async def create_session( + self, + session_service_create_session_request: SessionServiceCreateSessionRequest, + ) -> SessionServiceCreateSessionResponse: """Create Session - Create a new session with initial checks, metadata and challenges for further verification. A token will be returned, which is required for using the session as authentication, e.g. when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. Required permissions: - `session.write` + :param session_service_create_session_request: (required) + + :return: SessionServiceCreateSessionResponse + :raises ApiException: if fails to make API call + """ + if session_service_create_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_create_session_request'" + ) - :param session_service_create_session_request: (required) - :type session_service_create_session_request: SessionServiceCreateSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_session_serialize( - session_service_create_session_request=session_service_create_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_session_with_http_info( + session_service_create_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceCreateSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_session_serialize( + async def create_session_with_http_info( self, - session_service_create_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_create_session_request is not None: - _body_params = session_service_create_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + session_service_create_session_request: SessionServiceCreateSessionRequest, + ) -> "ApiResult[SessionServiceCreateSessionResponse]": + """Create Session (with HTTP info) + Create a new session with initial checks, metadata and challenges for further verification. A token will be returned, which is required for using the session as authentication, e.g. when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. Required permissions: - `session.write` + :param session_service_create_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if session_service_create_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_create_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2.SessionService/CreateSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2.SessionService/CreateSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = session_service_create_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SessionServiceCreateSessionResponse", + None, ) - - - - @validate_call - def delete_session( self, session_service_delete_session_request: SessionServiceDeleteSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceDeleteSessionResponse: + async def delete_session( + self, + session_service_delete_session_request: SessionServiceDeleteSessionRequest, + ) -> SessionServiceDeleteSessionResponse: """DeleteSession - Terminate an existing session. This invalidates the session and its token. The session can no longer be used for the authentication of other resources or to authenticate against the ZITADEL APIs. You can only terminate your own session, unless you are granted the `session.delete` permission. Required permissions: - `session.delete` - no permission required for own sessions or when providing the current session token + :param session_service_delete_session_request: (required) + + :return: SessionServiceDeleteSessionResponse + :raises ApiException: if fails to make API call + """ + if session_service_delete_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_delete_session_request'" + ) - :param session_service_delete_session_request: (required) - :type session_service_delete_session_request: SessionServiceDeleteSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_session_serialize( - session_service_delete_session_request=session_service_delete_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_session_with_http_info( + session_service_delete_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceDeleteSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_session_serialize( + async def delete_session_with_http_info( self, - session_service_delete_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_delete_session_request is not None: - _body_params = session_service_delete_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + session_service_delete_session_request: SessionServiceDeleteSessionRequest, + ) -> "ApiResult[SessionServiceDeleteSessionResponse]": + """DeleteSession (with HTTP info) + Terminate an existing session. This invalidates the session and its token. The session can no longer be used for the authentication of other resources or to authenticate against the ZITADEL APIs. You can only terminate your own session, unless you are granted the `session.delete` permission. Required permissions: - `session.delete` - no permission required for own sessions or when providing the current session token + :param session_service_delete_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if session_service_delete_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_delete_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2.SessionService/DeleteSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2.SessionService/DeleteSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = session_service_delete_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SessionServiceDeleteSessionResponse", + None, ) - - - - @validate_call - def get_session( self, session_service_get_session_request: SessionServiceGetSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceGetSessionResponse: + async def get_session( + self, + session_service_get_session_request: SessionServiceGetSessionRequest, + ) -> SessionServiceGetSessionResponse: """Get Session - Retrieve a session by its ID. Returns all information about the session, including the factors that were verified, the metadata, user agent information and possible expiration date. The session token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization Required permissions: - `session.read` - no permission required to get own sessions (see above) or when providing the current session token + :param session_service_get_session_request: (required) + + :return: SessionServiceGetSessionResponse + :raises ApiException: if fails to make API call + """ + if session_service_get_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_get_session_request'" + ) - :param session_service_get_session_request: (required) - :type session_service_get_session_request: SessionServiceGetSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_session_serialize( - session_service_get_session_request=session_service_get_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_session_with_http_info( + session_service_get_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceGetSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_session_serialize( + async def get_session_with_http_info( self, - session_service_get_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_get_session_request is not None: - _body_params = session_service_get_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + session_service_get_session_request: SessionServiceGetSessionRequest, + ) -> "ApiResult[SessionServiceGetSessionResponse]": + """Get Session (with HTTP info) + Retrieve a session by its ID. Returns all information about the session, including the factors that were verified, the metadata, user agent information and possible expiration date. The session token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization Required permissions: - `session.read` - no permission required to get own sessions (see above) or when providing the current session token + :param session_service_get_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if session_service_get_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_get_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2.SessionService/GetSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2.SessionService/GetSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = session_service_get_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SessionServiceGetSessionResponse", + None, ) - - - - @validate_call - def list_sessions( self, session_service_list_sessions_request: SessionServiceListSessionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceListSessionsResponse: + async def list_sessions( + self, + session_service_list_sessions_request: SessionServiceListSessionsRequest, + ) -> SessionServiceListSessionsResponse: """List sessions - Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent or expiration date. Required permissions: - `session.read` - no permission required to search for own sessions + :param session_service_list_sessions_request: (required) + + :return: SessionServiceListSessionsResponse + :raises ApiException: if fails to make API call + """ + if session_service_list_sessions_request is None: + raise ValueError( + "Missing the required parameter 'session_service_list_sessions_request'" + ) - :param session_service_list_sessions_request: (required) - :type session_service_list_sessions_request: SessionServiceListSessionsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_sessions_serialize( - session_service_list_sessions_request=session_service_list_sessions_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_sessions_with_http_info( + session_service_list_sessions_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceListSessionsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_sessions_serialize( + async def list_sessions_with_http_info( self, - session_service_list_sessions_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_list_sessions_request is not None: - _body_params = session_service_list_sessions_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + session_service_list_sessions_request: SessionServiceListSessionsRequest, + ) -> "ApiResult[SessionServiceListSessionsResponse]": + """List sessions (with HTTP info) + Searches for sessions matching the given query. You can search by session ID, user ID, creation date, creator, user agent or expiration date. Required permissions: - `session.read` - no permission required to search for own sessions + :param session_service_list_sessions_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if session_service_list_sessions_request is None: + raise ValueError( + "Missing the required parameter 'session_service_list_sessions_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2.SessionService/ListSessions', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2.SessionService/ListSessions" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = session_service_list_sessions_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SessionServiceListSessionsResponse", + None, ) - - - - @validate_call - def set_session( self, session_service_set_session_request: SessionServiceSetSessionRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SessionServiceSetSessionResponse: + async def set_session( + self, + session_service_set_session_request: SessionServiceSetSessionRequest, + ) -> SessionServiceSetSessionResponse: """Set Session - Update an existing session with new information like additional checks or metadata or request additional challenges. A new session token will be returned. Note that the previous token will be invalidated. Required permissions: - `session.write` + :param session_service_set_session_request: (required) + + :return: SessionServiceSetSessionResponse + :raises ApiException: if fails to make API call + """ + if session_service_set_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_set_session_request'" + ) - :param session_service_set_session_request: (required) - :type session_service_set_session_request: SessionServiceSetSessionRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_session_serialize( - session_service_set_session_request=session_service_set_session_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_session_with_http_info( + session_service_set_session_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SessionServiceSetSessionResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_session_serialize( + async def set_session_with_http_info( self, - session_service_set_session_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if session_service_set_session_request is not None: - _body_params = session_service_set_session_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + session_service_set_session_request: SessionServiceSetSessionRequest, + ) -> "ApiResult[SessionServiceSetSessionResponse]": + """Set Session (with HTTP info) + Update an existing session with new information like additional checks or metadata or request additional challenges. A new session token will be returned. Note that the previous token will be invalidated. Required permissions: - `session.write` + :param session_service_set_session_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if session_service_set_session_request is None: + raise ValueError( + "Missing the required parameter 'session_service_set_session_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.session.v2.SessionService/SetSession', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.session.v2.SessionService/SetSession" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = session_service_set_session_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SessionServiceSetSessionResponse", + None, ) - - diff --git a/zitadel_client/api/settings_service_api.py b/zitadel_client/api/settings_service_api.py index 33be8d5a..6b6463e6 100644 --- a/zitadel_client/api/settings_service_api.py +++ b/zitadel_client/api/settings_service_api.py @@ -1,1732 +1,948 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.settings_service_get_active_identity_providers_request import SettingsServiceGetActiveIdentityProvidersRequest -from zitadel_client.models.settings_service_get_active_identity_providers_response import SettingsServiceGetActiveIdentityProvidersResponse -from zitadel_client.models.settings_service_get_branding_settings_request import SettingsServiceGetBrandingSettingsRequest -from zitadel_client.models.settings_service_get_branding_settings_response import SettingsServiceGetBrandingSettingsResponse -from zitadel_client.models.settings_service_get_domain_settings_request import SettingsServiceGetDomainSettingsRequest -from zitadel_client.models.settings_service_get_domain_settings_response import SettingsServiceGetDomainSettingsResponse -from zitadel_client.models.settings_service_get_general_settings_response import SettingsServiceGetGeneralSettingsResponse -from zitadel_client.models.settings_service_get_hosted_login_translation_request import SettingsServiceGetHostedLoginTranslationRequest -from zitadel_client.models.settings_service_get_hosted_login_translation_response import SettingsServiceGetHostedLoginTranslationResponse -from zitadel_client.models.settings_service_get_legal_and_support_settings_request import SettingsServiceGetLegalAndSupportSettingsRequest -from zitadel_client.models.settings_service_get_legal_and_support_settings_response import SettingsServiceGetLegalAndSupportSettingsResponse -from zitadel_client.models.settings_service_get_lockout_settings_request import SettingsServiceGetLockoutSettingsRequest -from zitadel_client.models.settings_service_get_lockout_settings_response import SettingsServiceGetLockoutSettingsResponse -from zitadel_client.models.settings_service_get_login_settings_request import SettingsServiceGetLoginSettingsRequest -from zitadel_client.models.settings_service_get_login_settings_response import SettingsServiceGetLoginSettingsResponse -from zitadel_client.models.settings_service_get_password_complexity_settings_request import SettingsServiceGetPasswordComplexitySettingsRequest -from zitadel_client.models.settings_service_get_password_complexity_settings_response import SettingsServiceGetPasswordComplexitySettingsResponse -from zitadel_client.models.settings_service_get_password_expiry_settings_request import SettingsServiceGetPasswordExpirySettingsRequest -from zitadel_client.models.settings_service_get_password_expiry_settings_response import SettingsServiceGetPasswordExpirySettingsResponse -from zitadel_client.models.settings_service_get_security_settings_response import SettingsServiceGetSecuritySettingsResponse -from zitadel_client.models.settings_service_set_hosted_login_translation_request import SettingsServiceSetHostedLoginTranslationRequest -from zitadel_client.models.settings_service_set_hosted_login_translation_response import SettingsServiceSetHostedLoginTranslationResponse -from zitadel_client.models.settings_service_set_security_settings_request import SettingsServiceSetSecuritySettingsRequest -from zitadel_client.models.settings_service_set_security_settings_response import SettingsServiceSetSecuritySettingsResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class SettingsServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def get_active_identity_providers( self, settings_service_get_active_identity_providers_request: SettingsServiceGetActiveIdentityProvidersRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetActiveIdentityProvidersResponse: - """Get Active Identity Providers +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.settings_service_get_active_identity_providers_request import ( + SettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.settings_service_get_active_identity_providers_response import ( + SettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.settings_service_get_branding_settings_request import ( + SettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.settings_service_get_branding_settings_response import ( + SettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.settings_service_get_domain_settings_request import ( + SettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.settings_service_get_domain_settings_response import ( + SettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.settings_service_get_general_settings_response import ( + SettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_request import ( + SettingsServiceGetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_response import ( + SettingsServiceGetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_request import ( + SettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_response import ( + SettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.settings_service_get_lockout_settings_request import ( + SettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.settings_service_get_lockout_settings_response import ( + SettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.settings_service_get_login_settings_request import ( + SettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.settings_service_get_login_settings_response import ( + SettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_request import ( + SettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_response import ( + SettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_request import ( + SettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_response import ( + SettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.settings_service_get_security_settings_response import ( + SettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_request import ( + SettingsServiceSetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_response import ( + SettingsServiceSetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_set_security_settings_request import ( + SettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.settings_service_set_security_settings_response import ( + SettingsServiceSetSecuritySettingsResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class SettingsServiceApi(BaseApi): + """SettingsServiceApi provides methods for the SettingsService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def get_active_identity_providers( + self, + settings_service_get_active_identity_providers_request: SettingsServiceGetActiveIdentityProvidersRequest, + ) -> SettingsServiceGetActiveIdentityProvidersResponse: + """Get Active Identity Providers Get the current active identity providers for the requested context. This can be the instance or an organization. In case of an organization, the returned identity providers will fall back to the active instance identity providers if not explicitly set on the organization. Optionally, filter the identity providers by their allowed actions: - creation_allowed: only return identity providers that are allowed for user creation - linking_allowed: only return identity providers that are allowed for linking to existing users - auto_creation: only return identity providers that are allowed for automatic user creation - auto_linking: only return identity providers that are allowed for automatic linking to existing users Required permissions: - `policy.read` + :param settings_service_get_active_identity_providers_request: (required) + + :return: SettingsServiceGetActiveIdentityProvidersResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_active_identity_providers_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_active_identity_providers_request'" + ) - :param settings_service_get_active_identity_providers_request: (required) - :type settings_service_get_active_identity_providers_request: SettingsServiceGetActiveIdentityProvidersRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_active_identity_providers_serialize( - settings_service_get_active_identity_providers_request=settings_service_get_active_identity_providers_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetActiveIdentityProvidersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_active_identity_providers_with_http_info( + settings_service_get_active_identity_providers_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_active_identity_providers_serialize( - self, - settings_service_get_active_identity_providers_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_active_identity_providers_request is not None: - _body_params = settings_service_get_active_identity_providers_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_active_identity_providers_with_http_info( + self, + settings_service_get_active_identity_providers_request: SettingsServiceGetActiveIdentityProvidersRequest, + ) -> "ApiResult[SettingsServiceGetActiveIdentityProvidersResponse]": + """Get Active Identity Providers (with HTTP info) + Get the current active identity providers for the requested context. This can be the instance or an organization. In case of an organization, the returned identity providers will fall back to the active instance identity providers if not explicitly set on the organization. Optionally, filter the identity providers by their allowed actions: - creation_allowed: only return identity providers that are allowed for user creation - linking_allowed: only return identity providers that are allowed for linking to existing users - auto_creation: only return identity providers that are allowed for automatic user creation - auto_linking: only return identity providers that are allowed for automatic linking to existing users Required permissions: - `policy.read` + :param settings_service_get_active_identity_providers_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_active_identity_providers_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_active_identity_providers_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetActiveIdentityProviders', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.settings.v2.SettingsService/GetActiveIdentityProviders" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_active_identity_providers_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetActiveIdentityProvidersResponse", + None, + ) - @validate_call - def get_branding_settings( self, settings_service_get_branding_settings_request: SettingsServiceGetBrandingSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetBrandingSettingsResponse: + async def get_branding_settings( + self, + settings_service_get_branding_settings_request: SettingsServiceGetBrandingSettingsRequest, + ) -> SettingsServiceGetBrandingSettingsResponse: """Get Branding Settings - Get the current active branding settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_branding_settings_request: (required) + + :return: SettingsServiceGetBrandingSettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_branding_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_branding_settings_request'" + ) - :param settings_service_get_branding_settings_request: (required) - :type settings_service_get_branding_settings_request: SettingsServiceGetBrandingSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_branding_settings_serialize( - settings_service_get_branding_settings_request=settings_service_get_branding_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_branding_settings_with_http_info( + settings_service_get_branding_settings_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetBrandingSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_branding_settings_serialize( + async def get_branding_settings_with_http_info( self, - settings_service_get_branding_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_branding_settings_request is not None: - _body_params = settings_service_get_branding_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + settings_service_get_branding_settings_request: SettingsServiceGetBrandingSettingsRequest, + ) -> "ApiResult[SettingsServiceGetBrandingSettingsResponse]": + """Get Branding Settings (with HTTP info) + Get the current active branding settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_branding_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_branding_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_branding_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetBrandingSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.settings.v2.SettingsService/GetBrandingSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_branding_settings_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetBrandingSettingsResponse", + None, + ) - @validate_call - def get_domain_settings( self, settings_service_get_domain_settings_request: SettingsServiceGetDomainSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetDomainSettingsResponse: + async def get_domain_settings( + self, + settings_service_get_domain_settings_request: SettingsServiceGetDomainSettingsRequest, + ) -> SettingsServiceGetDomainSettingsResponse: """Get Domain Settings - Get the domain settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_domain_settings_request: (required) + + :return: SettingsServiceGetDomainSettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_domain_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_domain_settings_request'" + ) - :param settings_service_get_domain_settings_request: (required) - :type settings_service_get_domain_settings_request: SettingsServiceGetDomainSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_domain_settings_serialize( - settings_service_get_domain_settings_request=settings_service_get_domain_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetDomainSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_domain_settings_with_http_info( + settings_service_get_domain_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_domain_settings_serialize( - self, - settings_service_get_domain_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_domain_settings_request is not None: - _body_params = settings_service_get_domain_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_domain_settings_with_http_info( + self, + settings_service_get_domain_settings_request: SettingsServiceGetDomainSettingsRequest, + ) -> "ApiResult[SettingsServiceGetDomainSettingsResponse]": + """Get Domain Settings (with HTTP info) + Get the domain settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_domain_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_domain_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_domain_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetDomainSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call - def get_general_settings( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetGeneralSettingsResponse: - if body is None: - body = {} - """Get General Settings + path = "/zitadel.settings.v2.SettingsService/GetDomainSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_domain_settings_request - Get basic information of the instance like the default organization, default language and supported languages. Required permissions: - `policy.read` - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_general_settings_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetDomainSettingsResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetGeneralSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _get_general_settings_serialize( + async def get_general_settings( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> SettingsServiceGetGeneralSettingsResponse: + """Get General Settings + Get basic information of the instance like the default organization, default language and supported languages. Required permissions: - `policy.read` + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: SettingsServiceGetGeneralSettingsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_general_settings_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetGeneralSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def get_general_settings_with_http_info( + self, + body: object, + ) -> "ApiResult[SettingsServiceGetGeneralSettingsResponse]": + """Get General Settings (with HTTP info) + Get basic information of the instance like the default organization, default language and supported languages. Required permissions: - `policy.read` + :param body: (required) - @validate_call - def get_hosted_login_translation( self, settings_service_get_hosted_login_translation_request: Optional[SettingsServiceGetHostedLoginTranslationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetHostedLoginTranslationResponse: - if settings_service_get_hosted_login_translation_request is None: - settings_service_get_hosted_login_translation_request = {} + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.settings.v2.SettingsService/GetGeneralSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetGeneralSettingsResponse", + None, + ) + + async def get_hosted_login_translation( + self, + settings_service_get_hosted_login_translation_request: SettingsServiceGetHostedLoginTranslationRequest, + ) -> SettingsServiceGetHostedLoginTranslationResponse: """Get Hosted Login Translation - Returns the translations in the requested locale for the hosted login. The translations returned are based on the input level specified (system, instance or organization). If the requested level doesn't contain all translations, and ignore_inheritance is set to false, a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation, which could be in the default language if the one of the locale is missing on all levels. The etag returned in the response represents the hash of the translations as they are stored on DB and its reliable only if ignore_inheritance = true. Required permissions: - `iam.policy.read` + :param settings_service_get_hosted_login_translation_request: (required) - :param settings_service_get_hosted_login_translation_request: (required) - :type settings_service_get_hosted_login_translation_request: SettingsServiceGetHostedLoginTranslationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_hosted_login_translation_serialize( - settings_service_get_hosted_login_translation_request=settings_service_get_hosted_login_translation_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: SettingsServiceGetHostedLoginTranslationResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_hosted_login_translation_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_hosted_login_translation_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetHostedLoginTranslationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_hosted_login_translation_with_http_info( + settings_service_get_hosted_login_translation_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_hosted_login_translation_serialize( - self, - settings_service_get_hosted_login_translation_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_hosted_login_translation_request is not None: - _body_params = settings_service_get_hosted_login_translation_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetHostedLoginTranslation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def get_hosted_login_translation_with_http_info( + self, + settings_service_get_hosted_login_translation_request: SettingsServiceGetHostedLoginTranslationRequest, + ) -> "ApiResult[SettingsServiceGetHostedLoginTranslationResponse]": + """Get Hosted Login Translation (with HTTP info) + Returns the translations in the requested locale for the hosted login. The translations returned are based on the input level specified (system, instance or organization). If the requested level doesn't contain all translations, and ignore_inheritance is set to false, a merging process fallbacks onto the higher levels ensuring all keys in the file have a translation, which could be in the default language if the one of the locale is missing on all levels. The etag returned in the response represents the hash of the translations as they are stored on DB and its reliable only if ignore_inheritance = true. Required permissions: - `iam.policy.read` + :param settings_service_get_hosted_login_translation_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_hosted_login_translation_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_hosted_login_translation_request'" + ) + path = "/zitadel.settings.v2.SettingsService/GetHostedLoginTranslation" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_hosted_login_translation_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetHostedLoginTranslationResponse", + None, + ) - @validate_call - def get_legal_and_support_settings( self, settings_service_get_legal_and_support_settings_request: SettingsServiceGetLegalAndSupportSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetLegalAndSupportSettingsResponse: + async def get_legal_and_support_settings( + self, + settings_service_get_legal_and_support_settings_request: SettingsServiceGetLegalAndSupportSettingsRequest, + ) -> SettingsServiceGetLegalAndSupportSettingsResponse: """Get Legal and Support Settings - Get the legal and support settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_legal_and_support_settings_request: (required) + + :return: SettingsServiceGetLegalAndSupportSettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_legal_and_support_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_legal_and_support_settings_request'" + ) - :param settings_service_get_legal_and_support_settings_request: (required) - :type settings_service_get_legal_and_support_settings_request: SettingsServiceGetLegalAndSupportSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_legal_and_support_settings_serialize( - settings_service_get_legal_and_support_settings_request=settings_service_get_legal_and_support_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLegalAndSupportSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_legal_and_support_settings_with_http_info( + settings_service_get_legal_and_support_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_legal_and_support_settings_serialize( - self, - settings_service_get_legal_and_support_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_legal_and_support_settings_request is not None: - _body_params = settings_service_get_legal_and_support_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_legal_and_support_settings_with_http_info( + self, + settings_service_get_legal_and_support_settings_request: SettingsServiceGetLegalAndSupportSettingsRequest, + ) -> "ApiResult[SettingsServiceGetLegalAndSupportSettingsResponse]": + """Get Legal and Support Settings (with HTTP info) + Get the legal and support settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_legal_and_support_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_legal_and_support_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_legal_and_support_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetLegalAndSupportSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.settings.v2.SettingsService/GetLegalAndSupportSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_legal_and_support_settings_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetLegalAndSupportSettingsResponse", + None, + ) - @validate_call - def get_lockout_settings( self, settings_service_get_lockout_settings_request: SettingsServiceGetLockoutSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetLockoutSettingsResponse: + async def get_lockout_settings( + self, + settings_service_get_lockout_settings_request: SettingsServiceGetLockoutSettingsRequest, + ) -> SettingsServiceGetLockoutSettingsResponse: """Get Lockout Settings - Get the lockout settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Lockout settings define how many failed attempts are allowed before a user is locked out. Required permissions: - `policy.read` + :param settings_service_get_lockout_settings_request: (required) + + :return: SettingsServiceGetLockoutSettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_lockout_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_lockout_settings_request'" + ) - :param settings_service_get_lockout_settings_request: (required) - :type settings_service_get_lockout_settings_request: SettingsServiceGetLockoutSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_lockout_settings_serialize( - settings_service_get_lockout_settings_request=settings_service_get_lockout_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLockoutSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_lockout_settings_with_http_info( + settings_service_get_lockout_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_lockout_settings_serialize( - self, - settings_service_get_lockout_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_lockout_settings_request is not None: - _body_params = settings_service_get_lockout_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_lockout_settings_with_http_info( + self, + settings_service_get_lockout_settings_request: SettingsServiceGetLockoutSettingsRequest, + ) -> "ApiResult[SettingsServiceGetLockoutSettingsResponse]": + """Get Lockout Settings (with HTTP info) + Get the lockout settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Lockout settings define how many failed attempts are allowed before a user is locked out. Required permissions: - `policy.read` + :param settings_service_get_lockout_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_lockout_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_lockout_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetLockoutSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.settings.v2.SettingsService/GetLockoutSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_lockout_settings_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetLockoutSettingsResponse", + None, + ) - @validate_call - def get_login_settings( self, settings_service_get_login_settings_request: SettingsServiceGetLoginSettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetLoginSettingsResponse: + async def get_login_settings( + self, + settings_service_get_login_settings_request: SettingsServiceGetLoginSettingsRequest, + ) -> SettingsServiceGetLoginSettingsResponse: """Get Login Settings - Get the login settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_login_settings_request: (required) + + :return: SettingsServiceGetLoginSettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_login_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_login_settings_request'" + ) - :param settings_service_get_login_settings_request: (required) - :type settings_service_get_login_settings_request: SettingsServiceGetLoginSettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_login_settings_serialize( - settings_service_get_login_settings_request=settings_service_get_login_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetLoginSettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_login_settings_with_http_info( + settings_service_get_login_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_login_settings_serialize( - self, - settings_service_get_login_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_login_settings_request is not None: - _body_params = settings_service_get_login_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_login_settings_with_http_info( + self, + settings_service_get_login_settings_request: SettingsServiceGetLoginSettingsRequest, + ) -> "ApiResult[SettingsServiceGetLoginSettingsResponse]": + """Get Login Settings (with HTTP info) + Get the login settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_login_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_login_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_login_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetLoginSettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.settings.v2.SettingsService/GetLoginSettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_login_settings_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetLoginSettingsResponse", + None, + ) - @validate_call - def get_password_complexity_settings( self, settings_service_get_password_complexity_settings_request: SettingsServiceGetPasswordComplexitySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetPasswordComplexitySettingsResponse: + async def get_password_complexity_settings( + self, + settings_service_get_password_complexity_settings_request: SettingsServiceGetPasswordComplexitySettingsRequest, + ) -> SettingsServiceGetPasswordComplexitySettingsResponse: """Get Password Complexity Settings - Get the password complexity settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_password_complexity_settings_request: (required) + + :return: SettingsServiceGetPasswordComplexitySettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_password_complexity_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_password_complexity_settings_request'" + ) - :param settings_service_get_password_complexity_settings_request: (required) - :type settings_service_get_password_complexity_settings_request: SettingsServiceGetPasswordComplexitySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_password_complexity_settings_serialize( - settings_service_get_password_complexity_settings_request=settings_service_get_password_complexity_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordComplexitySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_password_complexity_settings_with_http_info( + settings_service_get_password_complexity_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_password_complexity_settings_serialize( - self, - settings_service_get_password_complexity_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_password_complexity_settings_request is not None: - _body_params = settings_service_get_password_complexity_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_password_complexity_settings_with_http_info( + self, + settings_service_get_password_complexity_settings_request: SettingsServiceGetPasswordComplexitySettingsRequest, + ) -> "ApiResult[SettingsServiceGetPasswordComplexitySettingsResponse]": + """Get Password Complexity Settings (with HTTP info) + Get the password complexity settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_password_complexity_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_password_complexity_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_password_complexity_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetPasswordComplexitySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + path = "/zitadel.settings.v2.SettingsService/GetPasswordComplexitySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_password_complexity_settings_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetPasswordComplexitySettingsResponse", + None, + ) - @validate_call - def get_password_expiry_settings( self, settings_service_get_password_expiry_settings_request: SettingsServiceGetPasswordExpirySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetPasswordExpirySettingsResponse: + async def get_password_expiry_settings( + self, + settings_service_get_password_expiry_settings_request: SettingsServiceGetPasswordExpirySettingsRequest, + ) -> SettingsServiceGetPasswordExpirySettingsResponse: """Get Password Expiry Settings - Get the password expiry settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_password_expiry_settings_request: (required) + + :return: SettingsServiceGetPasswordExpirySettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_get_password_expiry_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_password_expiry_settings_request'" + ) - :param settings_service_get_password_expiry_settings_request: (required) - :type settings_service_get_password_expiry_settings_request: SettingsServiceGetPasswordExpirySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_password_expiry_settings_serialize( - settings_service_get_password_expiry_settings_request=settings_service_get_password_expiry_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetPasswordExpirySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.get_password_expiry_settings_with_http_info( + settings_service_get_password_expiry_settings_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _get_password_expiry_settings_serialize( - self, - settings_service_get_password_expiry_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_get_password_expiry_settings_request is not None: - _body_params = settings_service_get_password_expiry_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + async def get_password_expiry_settings_with_http_info( + self, + settings_service_get_password_expiry_settings_request: SettingsServiceGetPasswordExpirySettingsRequest, + ) -> "ApiResult[SettingsServiceGetPasswordExpirySettingsResponse]": + """Get Password Expiry Settings (with HTTP info) + Get the password expiry settings for the requested context. This can be the instance or an organization. In case of an organization, the returned settings will fall back to the instance settings if not explicitly set on the organization. Required permissions: - `policy.read` + :param settings_service_get_password_expiry_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_get_password_expiry_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_get_password_expiry_settings_request'" ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetPasswordExpirySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + path = "/zitadel.settings.v2.SettingsService/GetPasswordExpirySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_get_password_expiry_settings_request - @validate_call - def get_security_settings( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceGetSecuritySettingsResponse: - if body is None: - body = {} - """Get Security Settings - - Get the security settings of the ZITADEL instance. Security settings include settings like enabling impersonation and embedded iframe settings. Required permissions: - `iam.policy.read` - - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_security_settings_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetPasswordExpirySettingsResponse", + None, ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceGetSecuritySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - def _get_security_settings_serialize( + async def get_security_settings( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> SettingsServiceGetSecuritySettingsResponse: + """Get Security Settings + Get the security settings of the ZITADEL instance. Security settings include settings like enabling impersonation and embedded iframe settings. Required permissions: - `iam.policy.read` + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + :return: SettingsServiceGetSecuritySettingsResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.get_security_settings_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/GetSecuritySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - + return result.data + async def get_security_settings_with_http_info( + self, + body: object, + ) -> "ApiResult[SettingsServiceGetSecuritySettingsResponse]": + """Get Security Settings (with HTTP info) + Get the security settings of the ZITADEL instance. Security settings include settings like enabling impersonation and embedded iframe settings. Required permissions: - `iam.policy.read` + :param body: (required) - @validate_call - def set_hosted_login_translation( self, settings_service_set_hosted_login_translation_request: Optional[SettingsServiceSetHostedLoginTranslationRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceSetHostedLoginTranslationResponse: - if settings_service_set_hosted_login_translation_request is None: - settings_service_set_hosted_login_translation_request = {} + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.settings.v2.SettingsService/GetSecuritySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceGetSecuritySettingsResponse", + None, + ) + + async def set_hosted_login_translation( + self, + settings_service_set_hosted_login_translation_request: SettingsServiceSetHostedLoginTranslationRequest, + ) -> SettingsServiceSetHostedLoginTranslationResponse: """Set Hosted Login Translation - Sets the input translations at the specified level (instance or organization) for the input language. Required permissions: - `iam.policy.write` + :param settings_service_set_hosted_login_translation_request: (required) - :param settings_service_set_hosted_login_translation_request: (required) - :type settings_service_set_hosted_login_translation_request: SettingsServiceSetHostedLoginTranslationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_hosted_login_translation_serialize( - settings_service_set_hosted_login_translation_request=settings_service_set_hosted_login_translation_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: SettingsServiceSetHostedLoginTranslationResponse + :raises ApiException: if fails to make API call + """ + if settings_service_set_hosted_login_translation_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_set_hosted_login_translation_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceSetHostedLoginTranslationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_hosted_login_translation_with_http_info( + settings_service_set_hosted_login_translation_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_hosted_login_translation_serialize( - self, - settings_service_set_hosted_login_translation_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_set_hosted_login_translation_request is not None: - _body_params = settings_service_set_hosted_login_translation_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, ) + return result.data - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/SetHostedLoginTranslation', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + async def set_hosted_login_translation_with_http_info( + self, + settings_service_set_hosted_login_translation_request: SettingsServiceSetHostedLoginTranslationRequest, + ) -> "ApiResult[SettingsServiceSetHostedLoginTranslationResponse]": + """Set Hosted Login Translation (with HTTP info) + Sets the input translations at the specified level (instance or organization) for the input language. Required permissions: - `iam.policy.write` + :param settings_service_set_hosted_login_translation_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_set_hosted_login_translation_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_set_hosted_login_translation_request'" + ) + path = "/zitadel.settings.v2.SettingsService/SetHostedLoginTranslation" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_set_hosted_login_translation_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceSetHostedLoginTranslationResponse", + None, + ) - @validate_call - def set_security_settings( self, settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> SettingsServiceSetSecuritySettingsResponse: + async def set_security_settings( + self, + settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, + ) -> SettingsServiceSetSecuritySettingsResponse: """Set Security Settings - Set the security settings of the instance. Required permissions: - `iam.policy.write` + :param settings_service_set_security_settings_request: (required) + + :return: SettingsServiceSetSecuritySettingsResponse + :raises ApiException: if fails to make API call + """ + if settings_service_set_security_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_set_security_settings_request'" + ) - :param settings_service_set_security_settings_request: (required) - :type settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_security_settings_serialize( - settings_service_set_security_settings_request=settings_service_set_security_settings_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_security_settings_with_http_info( + settings_service_set_security_settings_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "SettingsServiceSetSecuritySettingsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_security_settings_serialize( + async def set_security_settings_with_http_info( self, - settings_service_set_security_settings_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if settings_service_set_security_settings_request is not None: - _body_params = settings_service_set_security_settings_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + settings_service_set_security_settings_request: SettingsServiceSetSecuritySettingsRequest, + ) -> "ApiResult[SettingsServiceSetSecuritySettingsResponse]": + """Set Security Settings (with HTTP info) + Set the security settings of the instance. Required permissions: - `iam.policy.write` + :param settings_service_set_security_settings_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if settings_service_set_security_settings_request is None: + raise ValueError( + "Missing the required parameter 'settings_service_set_security_settings_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.settings.v2.SettingsService/SetSecuritySettings', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.settings.v2.SettingsService/SetSecuritySettings" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = settings_service_set_security_settings_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "SettingsServiceSetSecuritySettingsResponse", + None, ) - - diff --git a/zitadel_client/api/user_service_api.py b/zitadel_client/api/user_service_api.py index bfbf8fb2..ed7df932 100644 --- a/zitadel_client/api/user_service_api.py +++ b/zitadel_client/api/user_service_api.py @@ -1,7860 +1,4316 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from zitadel_client.models.user_service_add_human_user_request import UserServiceAddHumanUserRequest -from zitadel_client.models.user_service_add_human_user_response import UserServiceAddHumanUserResponse -from zitadel_client.models.user_service_add_idp_link_request import UserServiceAddIDPLinkRequest -from zitadel_client.models.user_service_add_idp_link_response import UserServiceAddIDPLinkResponse +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.user_service_add_human_user_request import ( + UserServiceAddHumanUserRequest, +) +from zitadel_client.models.user_service_add_human_user_response import ( + UserServiceAddHumanUserResponse, +) +from zitadel_client.models.user_service_add_idp_link_request import ( + UserServiceAddIDPLinkRequest, +) +from zitadel_client.models.user_service_add_idp_link_response import ( + UserServiceAddIDPLinkResponse, +) from zitadel_client.models.user_service_add_key_request import UserServiceAddKeyRequest -from zitadel_client.models.user_service_add_key_response import UserServiceAddKeyResponse -from zitadel_client.models.user_service_add_otp_email_request import UserServiceAddOTPEmailRequest -from zitadel_client.models.user_service_add_otp_email_response import UserServiceAddOTPEmailResponse -from zitadel_client.models.user_service_add_otpsms_request import UserServiceAddOTPSMSRequest -from zitadel_client.models.user_service_add_otpsms_response import UserServiceAddOTPSMSResponse -from zitadel_client.models.user_service_add_personal_access_token_request import UserServiceAddPersonalAccessTokenRequest -from zitadel_client.models.user_service_add_personal_access_token_response import UserServiceAddPersonalAccessTokenResponse -from zitadel_client.models.user_service_add_secret_request import UserServiceAddSecretRequest -from zitadel_client.models.user_service_add_secret_response import UserServiceAddSecretResponse -from zitadel_client.models.user_service_create_invite_code_request import UserServiceCreateInviteCodeRequest -from zitadel_client.models.user_service_create_invite_code_response import UserServiceCreateInviteCodeResponse -from zitadel_client.models.user_service_create_passkey_registration_link_request import UserServiceCreatePasskeyRegistrationLinkRequest -from zitadel_client.models.user_service_create_passkey_registration_link_response import UserServiceCreatePasskeyRegistrationLinkResponse -from zitadel_client.models.user_service_create_user_request import UserServiceCreateUserRequest -from zitadel_client.models.user_service_create_user_response import UserServiceCreateUserResponse -from zitadel_client.models.user_service_deactivate_user_request import UserServiceDeactivateUserRequest -from zitadel_client.models.user_service_deactivate_user_response import UserServiceDeactivateUserResponse -from zitadel_client.models.user_service_delete_user_metadata_request import UserServiceDeleteUserMetadataRequest -from zitadel_client.models.user_service_delete_user_metadata_response import UserServiceDeleteUserMetadataResponse -from zitadel_client.models.user_service_delete_user_request import UserServiceDeleteUserRequest -from zitadel_client.models.user_service_delete_user_response import UserServiceDeleteUserResponse -from zitadel_client.models.user_service_generate_recovery_codes_request import UserServiceGenerateRecoveryCodesRequest -from zitadel_client.models.user_service_generate_recovery_codes_response import UserServiceGenerateRecoveryCodesResponse -from zitadel_client.models.user_service_get_user_by_id_request import UserServiceGetUserByIDRequest -from zitadel_client.models.user_service_get_user_by_id_response import UserServiceGetUserByIDResponse -from zitadel_client.models.user_service_human_mfa_init_skipped_request import UserServiceHumanMFAInitSkippedRequest -from zitadel_client.models.user_service_human_mfa_init_skipped_response import UserServiceHumanMFAInitSkippedResponse -from zitadel_client.models.user_service_list_authentication_factors_request import UserServiceListAuthenticationFactorsRequest -from zitadel_client.models.user_service_list_authentication_factors_response import UserServiceListAuthenticationFactorsResponse -from zitadel_client.models.user_service_list_authentication_method_types_request import UserServiceListAuthenticationMethodTypesRequest -from zitadel_client.models.user_service_list_authentication_method_types_response import UserServiceListAuthenticationMethodTypesResponse -from zitadel_client.models.user_service_list_idp_links_request import UserServiceListIDPLinksRequest -from zitadel_client.models.user_service_list_idp_links_response import UserServiceListIDPLinksResponse -from zitadel_client.models.user_service_list_keys_request import UserServiceListKeysRequest -from zitadel_client.models.user_service_list_keys_response import UserServiceListKeysResponse -from zitadel_client.models.user_service_list_passkeys_request import UserServiceListPasskeysRequest -from zitadel_client.models.user_service_list_passkeys_response import UserServiceListPasskeysResponse -from zitadel_client.models.user_service_list_personal_access_tokens_request import UserServiceListPersonalAccessTokensRequest -from zitadel_client.models.user_service_list_personal_access_tokens_response import UserServiceListPersonalAccessTokensResponse -from zitadel_client.models.user_service_list_user_metadata_request import UserServiceListUserMetadataRequest -from zitadel_client.models.user_service_list_user_metadata_response import UserServiceListUserMetadataResponse -from zitadel_client.models.user_service_list_users_request import UserServiceListUsersRequest -from zitadel_client.models.user_service_list_users_response import UserServiceListUsersResponse -from zitadel_client.models.user_service_lock_user_request import UserServiceLockUserRequest -from zitadel_client.models.user_service_lock_user_response import UserServiceLockUserResponse -from zitadel_client.models.user_service_password_reset_request import UserServicePasswordResetRequest -from zitadel_client.models.user_service_password_reset_response import UserServicePasswordResetResponse -from zitadel_client.models.user_service_reactivate_user_request import UserServiceReactivateUserRequest -from zitadel_client.models.user_service_reactivate_user_response import UserServiceReactivateUserResponse -from zitadel_client.models.user_service_register_passkey_request import UserServiceRegisterPasskeyRequest -from zitadel_client.models.user_service_register_passkey_response import UserServiceRegisterPasskeyResponse -from zitadel_client.models.user_service_register_totp_request import UserServiceRegisterTOTPRequest -from zitadel_client.models.user_service_register_totp_response import UserServiceRegisterTOTPResponse -from zitadel_client.models.user_service_register_u2_f_request import UserServiceRegisterU2FRequest -from zitadel_client.models.user_service_register_u2_f_response import UserServiceRegisterU2FResponse -from zitadel_client.models.user_service_remove_idp_link_request import UserServiceRemoveIDPLinkRequest -from zitadel_client.models.user_service_remove_idp_link_response import UserServiceRemoveIDPLinkResponse -from zitadel_client.models.user_service_remove_key_request import UserServiceRemoveKeyRequest -from zitadel_client.models.user_service_remove_key_response import UserServiceRemoveKeyResponse -from zitadel_client.models.user_service_remove_otp_email_request import UserServiceRemoveOTPEmailRequest -from zitadel_client.models.user_service_remove_otp_email_response import UserServiceRemoveOTPEmailResponse -from zitadel_client.models.user_service_remove_otpsms_request import UserServiceRemoveOTPSMSRequest -from zitadel_client.models.user_service_remove_otpsms_response import UserServiceRemoveOTPSMSResponse -from zitadel_client.models.user_service_remove_passkey_request import UserServiceRemovePasskeyRequest -from zitadel_client.models.user_service_remove_passkey_response import UserServiceRemovePasskeyResponse -from zitadel_client.models.user_service_remove_personal_access_token_request import UserServiceRemovePersonalAccessTokenRequest -from zitadel_client.models.user_service_remove_personal_access_token_response import UserServiceRemovePersonalAccessTokenResponse -from zitadel_client.models.user_service_remove_phone_request import UserServiceRemovePhoneRequest -from zitadel_client.models.user_service_remove_phone_response import UserServiceRemovePhoneResponse -from zitadel_client.models.user_service_remove_recovery_codes_request import UserServiceRemoveRecoveryCodesRequest -from zitadel_client.models.user_service_remove_recovery_codes_response import UserServiceRemoveRecoveryCodesResponse -from zitadel_client.models.user_service_remove_secret_request import UserServiceRemoveSecretRequest -from zitadel_client.models.user_service_remove_secret_response import UserServiceRemoveSecretResponse -from zitadel_client.models.user_service_remove_totp_request import UserServiceRemoveTOTPRequest -from zitadel_client.models.user_service_remove_totp_response import UserServiceRemoveTOTPResponse -from zitadel_client.models.user_service_remove_u2_f_request import UserServiceRemoveU2FRequest -from zitadel_client.models.user_service_remove_u2_f_response import UserServiceRemoveU2FResponse -from zitadel_client.models.user_service_resend_email_code_request import UserServiceResendEmailCodeRequest -from zitadel_client.models.user_service_resend_email_code_response import UserServiceResendEmailCodeResponse -from zitadel_client.models.user_service_resend_invite_code_request import UserServiceResendInviteCodeRequest -from zitadel_client.models.user_service_resend_invite_code_response import UserServiceResendInviteCodeResponse -from zitadel_client.models.user_service_resend_phone_code_request import UserServiceResendPhoneCodeRequest -from zitadel_client.models.user_service_resend_phone_code_response import UserServiceResendPhoneCodeResponse -from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import UserServiceRetrieveIdentityProviderIntentRequest -from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import UserServiceRetrieveIdentityProviderIntentResponse -from zitadel_client.models.user_service_send_email_code_request import UserServiceSendEmailCodeRequest -from zitadel_client.models.user_service_send_email_code_response import UserServiceSendEmailCodeResponse -from zitadel_client.models.user_service_set_email_request import UserServiceSetEmailRequest -from zitadel_client.models.user_service_set_email_response import UserServiceSetEmailResponse -from zitadel_client.models.user_service_set_password_request import UserServiceSetPasswordRequest -from zitadel_client.models.user_service_set_password_response import UserServiceSetPasswordResponse -from zitadel_client.models.user_service_set_phone_request import UserServiceSetPhoneRequest -from zitadel_client.models.user_service_set_phone_response import UserServiceSetPhoneResponse -from zitadel_client.models.user_service_set_user_metadata_request import UserServiceSetUserMetadataRequest -from zitadel_client.models.user_service_set_user_metadata_response import UserServiceSetUserMetadataResponse -from zitadel_client.models.user_service_start_identity_provider_intent_request import UserServiceStartIdentityProviderIntentRequest -from zitadel_client.models.user_service_start_identity_provider_intent_response import UserServiceStartIdentityProviderIntentResponse -from zitadel_client.models.user_service_unlock_user_request import UserServiceUnlockUserRequest -from zitadel_client.models.user_service_unlock_user_response import UserServiceUnlockUserResponse -from zitadel_client.models.user_service_update_human_user_request import UserServiceUpdateHumanUserRequest -from zitadel_client.models.user_service_update_human_user_response import UserServiceUpdateHumanUserResponse -from zitadel_client.models.user_service_update_user_request import UserServiceUpdateUserRequest -from zitadel_client.models.user_service_update_user_response import UserServiceUpdateUserResponse -from zitadel_client.models.user_service_verify_email_request import UserServiceVerifyEmailRequest -from zitadel_client.models.user_service_verify_email_response import UserServiceVerifyEmailResponse -from zitadel_client.models.user_service_verify_invite_code_request import UserServiceVerifyInviteCodeRequest -from zitadel_client.models.user_service_verify_invite_code_response import UserServiceVerifyInviteCodeResponse -from zitadel_client.models.user_service_verify_passkey_registration_request import UserServiceVerifyPasskeyRegistrationRequest -from zitadel_client.models.user_service_verify_passkey_registration_response import UserServiceVerifyPasskeyRegistrationResponse -from zitadel_client.models.user_service_verify_phone_request import UserServiceVerifyPhoneRequest -from zitadel_client.models.user_service_verify_phone_response import UserServiceVerifyPhoneResponse -from zitadel_client.models.user_service_verify_totp_registration_request import UserServiceVerifyTOTPRegistrationRequest -from zitadel_client.models.user_service_verify_totp_registration_response import UserServiceVerifyTOTPRegistrationResponse -from zitadel_client.models.user_service_verify_u2_f_registration_request import UserServiceVerifyU2FRegistrationRequest -from zitadel_client.models.user_service_verify_u2_f_registration_response import UserServiceVerifyU2FRegistrationResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class UserServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def add_human_user( self, user_service_add_human_user_request: Optional[UserServiceAddHumanUserRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddHumanUserResponse: - if user_service_add_human_user_request is None: - user_service_add_human_user_request = {} - """Create a new human user +from zitadel_client.models.user_service_add_key_response import ( + UserServiceAddKeyResponse, +) +from zitadel_client.models.user_service_add_otp_email_request import ( + UserServiceAddOTPEmailRequest, +) +from zitadel_client.models.user_service_add_otp_email_response import ( + UserServiceAddOTPEmailResponse, +) +from zitadel_client.models.user_service_add_otpsms_request import ( + UserServiceAddOTPSMSRequest, +) +from zitadel_client.models.user_service_add_otpsms_response import ( + UserServiceAddOTPSMSResponse, +) +from zitadel_client.models.user_service_add_personal_access_token_request import ( + UserServiceAddPersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_add_personal_access_token_response import ( + UserServiceAddPersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_add_secret_request import ( + UserServiceAddSecretRequest, +) +from zitadel_client.models.user_service_add_secret_response import ( + UserServiceAddSecretResponse, +) +from zitadel_client.models.user_service_create_invite_code_request import ( + UserServiceCreateInviteCodeRequest, +) +from zitadel_client.models.user_service_create_invite_code_response import ( + UserServiceCreateInviteCodeResponse, +) +from zitadel_client.models.user_service_create_passkey_registration_link_request import ( + UserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.user_service_create_passkey_registration_link_response import ( + UserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.user_service_create_user_request import ( + UserServiceCreateUserRequest, +) +from zitadel_client.models.user_service_create_user_response import ( + UserServiceCreateUserResponse, +) +from zitadel_client.models.user_service_deactivate_user_request import ( + UserServiceDeactivateUserRequest, +) +from zitadel_client.models.user_service_deactivate_user_response import ( + UserServiceDeactivateUserResponse, +) +from zitadel_client.models.user_service_delete_user_metadata_request import ( + UserServiceDeleteUserMetadataRequest, +) +from zitadel_client.models.user_service_delete_user_metadata_response import ( + UserServiceDeleteUserMetadataResponse, +) +from zitadel_client.models.user_service_delete_user_request import ( + UserServiceDeleteUserRequest, +) +from zitadel_client.models.user_service_delete_user_response import ( + UserServiceDeleteUserResponse, +) +from zitadel_client.models.user_service_generate_recovery_codes_request import ( + UserServiceGenerateRecoveryCodesRequest, +) +from zitadel_client.models.user_service_generate_recovery_codes_response import ( + UserServiceGenerateRecoveryCodesResponse, +) +from zitadel_client.models.user_service_get_user_by_id_request import ( + UserServiceGetUserByIDRequest, +) +from zitadel_client.models.user_service_get_user_by_id_response import ( + UserServiceGetUserByIDResponse, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_request import ( + UserServiceHumanMFAInitSkippedRequest, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_response import ( + UserServiceHumanMFAInitSkippedResponse, +) +from zitadel_client.models.user_service_list_authentication_factors_request import ( + UserServiceListAuthenticationFactorsRequest, +) +from zitadel_client.models.user_service_list_authentication_factors_response import ( + UserServiceListAuthenticationFactorsResponse, +) +from zitadel_client.models.user_service_list_authentication_method_types_request import ( + UserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.user_service_list_authentication_method_types_response import ( + UserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.user_service_list_idp_links_request import ( + UserServiceListIDPLinksRequest, +) +from zitadel_client.models.user_service_list_idp_links_response import ( + UserServiceListIDPLinksResponse, +) +from zitadel_client.models.user_service_list_keys_request import ( + UserServiceListKeysRequest, +) +from zitadel_client.models.user_service_list_keys_response import ( + UserServiceListKeysResponse, +) +from zitadel_client.models.user_service_list_passkeys_request import ( + UserServiceListPasskeysRequest, +) +from zitadel_client.models.user_service_list_passkeys_response import ( + UserServiceListPasskeysResponse, +) +from zitadel_client.models.user_service_list_personal_access_tokens_request import ( + UserServiceListPersonalAccessTokensRequest, +) +from zitadel_client.models.user_service_list_personal_access_tokens_response import ( + UserServiceListPersonalAccessTokensResponse, +) +from zitadel_client.models.user_service_list_user_metadata_request import ( + UserServiceListUserMetadataRequest, +) +from zitadel_client.models.user_service_list_user_metadata_response import ( + UserServiceListUserMetadataResponse, +) +from zitadel_client.models.user_service_list_users_request import ( + UserServiceListUsersRequest, +) +from zitadel_client.models.user_service_list_users_response import ( + UserServiceListUsersResponse, +) +from zitadel_client.models.user_service_lock_user_request import ( + UserServiceLockUserRequest, +) +from zitadel_client.models.user_service_lock_user_response import ( + UserServiceLockUserResponse, +) +from zitadel_client.models.user_service_password_reset_request import ( + UserServicePasswordResetRequest, +) +from zitadel_client.models.user_service_password_reset_response import ( + UserServicePasswordResetResponse, +) +from zitadel_client.models.user_service_reactivate_user_request import ( + UserServiceReactivateUserRequest, +) +from zitadel_client.models.user_service_reactivate_user_response import ( + UserServiceReactivateUserResponse, +) +from zitadel_client.models.user_service_register_passkey_request import ( + UserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.user_service_register_passkey_response import ( + UserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.user_service_register_totp_request import ( + UserServiceRegisterTOTPRequest, +) +from zitadel_client.models.user_service_register_totp_response import ( + UserServiceRegisterTOTPResponse, +) +from zitadel_client.models.user_service_register_u2_f_request import ( + UserServiceRegisterU2FRequest, +) +from zitadel_client.models.user_service_register_u2_f_response import ( + UserServiceRegisterU2FResponse, +) +from zitadel_client.models.user_service_remove_idp_link_request import ( + UserServiceRemoveIDPLinkRequest, +) +from zitadel_client.models.user_service_remove_idp_link_response import ( + UserServiceRemoveIDPLinkResponse, +) +from zitadel_client.models.user_service_remove_key_request import ( + UserServiceRemoveKeyRequest, +) +from zitadel_client.models.user_service_remove_key_response import ( + UserServiceRemoveKeyResponse, +) +from zitadel_client.models.user_service_remove_otp_email_request import ( + UserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.user_service_remove_otp_email_response import ( + UserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.user_service_remove_otpsms_request import ( + UserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.user_service_remove_otpsms_response import ( + UserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.user_service_remove_passkey_request import ( + UserServiceRemovePasskeyRequest, +) +from zitadel_client.models.user_service_remove_passkey_response import ( + UserServiceRemovePasskeyResponse, +) +from zitadel_client.models.user_service_remove_personal_access_token_request import ( + UserServiceRemovePersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_remove_personal_access_token_response import ( + UserServiceRemovePersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_remove_phone_request import ( + UserServiceRemovePhoneRequest, +) +from zitadel_client.models.user_service_remove_phone_response import ( + UserServiceRemovePhoneResponse, +) +from zitadel_client.models.user_service_remove_recovery_codes_request import ( + UserServiceRemoveRecoveryCodesRequest, +) +from zitadel_client.models.user_service_remove_recovery_codes_response import ( + UserServiceRemoveRecoveryCodesResponse, +) +from zitadel_client.models.user_service_remove_secret_request import ( + UserServiceRemoveSecretRequest, +) +from zitadel_client.models.user_service_remove_secret_response import ( + UserServiceRemoveSecretResponse, +) +from zitadel_client.models.user_service_remove_totp_request import ( + UserServiceRemoveTOTPRequest, +) +from zitadel_client.models.user_service_remove_totp_response import ( + UserServiceRemoveTOTPResponse, +) +from zitadel_client.models.user_service_remove_u2_f_request import ( + UserServiceRemoveU2FRequest, +) +from zitadel_client.models.user_service_remove_u2_f_response import ( + UserServiceRemoveU2FResponse, +) +from zitadel_client.models.user_service_resend_email_code_request import ( + UserServiceResendEmailCodeRequest, +) +from zitadel_client.models.user_service_resend_email_code_response import ( + UserServiceResendEmailCodeResponse, +) +from zitadel_client.models.user_service_resend_invite_code_request import ( + UserServiceResendInviteCodeRequest, +) +from zitadel_client.models.user_service_resend_invite_code_response import ( + UserServiceResendInviteCodeResponse, +) +from zitadel_client.models.user_service_resend_phone_code_request import ( + UserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.user_service_resend_phone_code_response import ( + UserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import ( + UserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import ( + UserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_send_email_code_request import ( + UserServiceSendEmailCodeRequest, +) +from zitadel_client.models.user_service_send_email_code_response import ( + UserServiceSendEmailCodeResponse, +) +from zitadel_client.models.user_service_set_email_request import ( + UserServiceSetEmailRequest, +) +from zitadel_client.models.user_service_set_email_response import ( + UserServiceSetEmailResponse, +) +from zitadel_client.models.user_service_set_password_request import ( + UserServiceSetPasswordRequest, +) +from zitadel_client.models.user_service_set_password_response import ( + UserServiceSetPasswordResponse, +) +from zitadel_client.models.user_service_set_phone_request import ( + UserServiceSetPhoneRequest, +) +from zitadel_client.models.user_service_set_phone_response import ( + UserServiceSetPhoneResponse, +) +from zitadel_client.models.user_service_set_user_metadata_request import ( + UserServiceSetUserMetadataRequest, +) +from zitadel_client.models.user_service_set_user_metadata_response import ( + UserServiceSetUserMetadataResponse, +) +from zitadel_client.models.user_service_start_identity_provider_intent_request import ( + UserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_start_identity_provider_intent_response import ( + UserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_unlock_user_request import ( + UserServiceUnlockUserRequest, +) +from zitadel_client.models.user_service_unlock_user_response import ( + UserServiceUnlockUserResponse, +) +from zitadel_client.models.user_service_update_human_user_request import ( + UserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.user_service_update_human_user_response import ( + UserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.user_service_update_user_request import ( + UserServiceUpdateUserRequest, +) +from zitadel_client.models.user_service_update_user_response import ( + UserServiceUpdateUserResponse, +) +from zitadel_client.models.user_service_verify_email_request import ( + UserServiceVerifyEmailRequest, +) +from zitadel_client.models.user_service_verify_email_response import ( + UserServiceVerifyEmailResponse, +) +from zitadel_client.models.user_service_verify_invite_code_request import ( + UserServiceVerifyInviteCodeRequest, +) +from zitadel_client.models.user_service_verify_invite_code_response import ( + UserServiceVerifyInviteCodeResponse, +) +from zitadel_client.models.user_service_verify_passkey_registration_request import ( + UserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.user_service_verify_passkey_registration_response import ( + UserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.user_service_verify_phone_request import ( + UserServiceVerifyPhoneRequest, +) +from zitadel_client.models.user_service_verify_phone_response import ( + UserServiceVerifyPhoneResponse, +) +from zitadel_client.models.user_service_verify_totp_registration_request import ( + UserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.user_service_verify_totp_registration_response import ( + UserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.user_service_verify_u2_f_registration_request import ( + UserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.user_service_verify_u2_f_registration_response import ( + UserServiceVerifyU2FRegistrationResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class UserServiceApi(BaseApi): + """UserServiceApi provides methods for the UserService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) + async def add_human_user( + self, + user_service_add_human_user_request: UserServiceAddHumanUserRequest, + ) -> UserServiceAddHumanUserResponse: + """Create a new human user Deprecated: Use [CreateUser](apis/resources/user_service_v2/user-service-create-user.api.mdx) to create a new user of type human instead. Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + :param user_service_add_human_user_request: (required) - :param user_service_add_human_user_request: (required) - :type user_service_add_human_user_request: UserServiceAddHumanUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_human_user_serialize( - user_service_add_human_user_request=user_service_add_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceAddHumanUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_human_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_human_user_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddHumanUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.add_human_user_with_http_info( + user_service_add_human_user_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _add_human_user_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def add_human_user_with_http_info( self, - user_service_add_human_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_human_user_request is not None: - _body_params = user_service_add_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddHumanUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_add_human_user_request: UserServiceAddHumanUserRequest, + ) -> "ApiResult[UserServiceAddHumanUserResponse]": + """Create a new human user (with HTTP info) + Deprecated: Use [CreateUser](apis/resources/user_service_v2/user-service-create-user.api.mdx) to create a new user of type human instead. Create/import a new user with the type human. The newly created user will get a verification email if either the email address is not marked as verified and you did not request the verification to be returned. + :param user_service_add_human_user_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_human_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_human_user_request'" + ) + path = "/zitadel.user.v2.UserService/AddHumanUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_human_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddHumanUserResponse", + None, + ) - @validate_call - def add_idp_link( self, user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddIDPLinkResponse: + async def add_idp_link( + self, + user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, + ) -> UserServiceAddIDPLinkResponse: """Add link to an identity provider to an user - Add link to an identity provider to an user.. + :param user_service_add_idp_link_request: (required) + + :return: UserServiceAddIDPLinkResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_idp_link_request'" + ) - :param user_service_add_idp_link_request: (required) - :type user_service_add_idp_link_request: UserServiceAddIDPLinkRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_idp_link_serialize( - user_service_add_idp_link_request=user_service_add_idp_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_idp_link_with_http_info( + user_service_add_idp_link_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddIDPLinkResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_idp_link_serialize( + async def add_idp_link_with_http_info( self, - user_service_add_idp_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_idp_link_request is not None: - _body_params = user_service_add_idp_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddIDPLink', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_idp_link_request: UserServiceAddIDPLinkRequest, + ) -> "ApiResult[UserServiceAddIDPLinkResponse]": + """Add link to an identity provider to an user (with HTTP info) + Add link to an identity provider to an user.. + :param user_service_add_idp_link_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_idp_link_request'" + ) + path = "/zitadel.user.v2.UserService/AddIDPLink" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_idp_link_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddIDPLinkResponse", + None, + ) - @validate_call - def add_key( self, user_service_add_key_request: UserServiceAddKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddKeyResponse: + async def add_key( + self, + user_service_add_key_request: UserServiceAddKeyRequest, + ) -> UserServiceAddKeyResponse: """Add a Key - Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens. Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have keys. Required permission: - user.write + :param user_service_add_key_request: (required) + + :return: UserServiceAddKeyResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_key_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_key_request'" + ) - :param user_service_add_key_request: (required) - :type user_service_add_key_request: UserServiceAddKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_key_serialize( - user_service_add_key_request=user_service_add_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.add_key_with_http_info(user_service_add_key_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_key_serialize( + async def add_key_with_http_info( self, - user_service_add_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_key_request is not None: - _body_params = user_service_add_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_key_request: UserServiceAddKeyRequest, + ) -> "ApiResult[UserServiceAddKeyResponse]": + """Add a Key (with HTTP info) + Add a keys that can be used to securely authenticate at the Zitadel APIs using JWT profile authentication using short-lived tokens. Make sure you store the returned key safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have keys. Required permission: - user.write + :param user_service_add_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_key_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_key_request'" + ) + path = "/zitadel.user.v2.UserService/AddKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddKeyResponse", + None, + ) - @validate_call - def add_otp_email( self, user_service_add_otp_email_request: UserServiceAddOTPEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddOTPEmailResponse: + async def add_otp_email( + self, + user_service_add_otp_email_request: UserServiceAddOTPEmailRequest, + ) -> UserServiceAddOTPEmailResponse: """Add OTP Email for a user - Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + :param user_service_add_otp_email_request: (required) + + :return: UserServiceAddOTPEmailResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_otp_email_request'" + ) - :param user_service_add_otp_email_request: (required) - :type user_service_add_otp_email_request: UserServiceAddOTPEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_otp_email_serialize( - user_service_add_otp_email_request=user_service_add_otp_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_otp_email_with_http_info( + user_service_add_otp_email_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_otp_email_serialize( + async def add_otp_email_with_http_info( self, - user_service_add_otp_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_otp_email_request is not None: - _body_params = user_service_add_otp_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddOTPEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_otp_email_request: UserServiceAddOTPEmailRequest, + ) -> "ApiResult[UserServiceAddOTPEmailResponse]": + """Add OTP Email for a user (with HTTP info) + Add a new One-Time Password (OTP) Email factor to the authenticated user. OTP Email will enable the user to verify a OTP with the latest verified email. The email has to be verified to add the second factor.. + :param user_service_add_otp_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_otp_email_request'" + ) + path = "/zitadel.user.v2.UserService/AddOTPEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_otp_email_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddOTPEmailResponse", + None, + ) - @validate_call - def add_otpsms( self, user_service_add_otpsms_request: UserServiceAddOTPSMSRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddOTPSMSResponse: + async def add_otpsms( + self, + user_service_add_otpsms_request: UserServiceAddOTPSMSRequest, + ) -> UserServiceAddOTPSMSResponse: """Add OTP SMS for a user - Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + :param user_service_add_otpsms_request: (required) + + :return: UserServiceAddOTPSMSResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_otpsms_request'" + ) - :param user_service_add_otpsms_request: (required) - :type user_service_add_otpsms_request: UserServiceAddOTPSMSRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_otpsms_serialize( - user_service_add_otpsms_request=user_service_add_otpsms_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddOTPSMSResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.add_otpsms_with_http_info(user_service_add_otpsms_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_otpsms_serialize( + async def add_otpsms_with_http_info( self, - user_service_add_otpsms_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_otpsms_request is not None: - _body_params = user_service_add_otpsms_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddOTPSMS', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_otpsms_request: UserServiceAddOTPSMSRequest, + ) -> "ApiResult[UserServiceAddOTPSMSResponse]": + """Add OTP SMS for a user (with HTTP info) + Add a new One-Time Password (OTP) SMS factor to the authenticated user. OTP SMS will enable the user to verify a OTP with the latest verified phone number. The phone number has to be verified to add the second factor.. + :param user_service_add_otpsms_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_otpsms_request'" + ) + path = "/zitadel.user.v2.UserService/AddOTPSMS" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_otpsms_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddOTPSMSResponse", + None, + ) - @validate_call - def add_personal_access_token( self, user_service_add_personal_access_token_request: UserServiceAddPersonalAccessTokenRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddPersonalAccessTokenResponse: + async def add_personal_access_token( + self, + user_service_add_personal_access_token_request: UserServiceAddPersonalAccessTokenRequest, + ) -> UserServiceAddPersonalAccessTokenResponse: """Add a Personal Access Token - Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs. Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have personal access tokens. Required permission: - user.write + :param user_service_add_personal_access_token_request: (required) + + :return: UserServiceAddPersonalAccessTokenResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_personal_access_token_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_personal_access_token_request'" + ) - :param user_service_add_personal_access_token_request: (required) - :type user_service_add_personal_access_token_request: UserServiceAddPersonalAccessTokenRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_personal_access_token_serialize( - user_service_add_personal_access_token_request=user_service_add_personal_access_token_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.add_personal_access_token_with_http_info( + user_service_add_personal_access_token_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddPersonalAccessTokenResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_personal_access_token_serialize( + async def add_personal_access_token_with_http_info( self, - user_service_add_personal_access_token_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_personal_access_token_request is not None: - _body_params = user_service_add_personal_access_token_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddPersonalAccessToken', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_personal_access_token_request: UserServiceAddPersonalAccessTokenRequest, + ) -> "ApiResult[UserServiceAddPersonalAccessTokenResponse]": + """Add a Personal Access Token (with HTTP info) + Personal access tokens (PAT) are the easiest way to authenticate to the Zitadel APIs. Make sure you store the returned PAT safely, as you won't be able to read it from the Zitadel API anymore. Only users of type machine can have personal access tokens. Required permission: - user.write + :param user_service_add_personal_access_token_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_personal_access_token_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_personal_access_token_request'" + ) + path = "/zitadel.user.v2.UserService/AddPersonalAccessToken" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_personal_access_token_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddPersonalAccessTokenResponse", + None, + ) - @validate_call - def add_secret( self, user_service_add_secret_request: UserServiceAddSecretRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceAddSecretResponse: + async def add_secret( + self, + user_service_add_secret_request: UserServiceAddSecretRequest, + ) -> UserServiceAddSecretResponse: """Add a Users Secret - Generates a client secret for the user. The client id is the users username. If the user already has a secret, it is overwritten. Only users of type machine can have a secret. Required permission: - user.write + :param user_service_add_secret_request: (required) + + :return: UserServiceAddSecretResponse + :raises ApiException: if fails to make API call + """ + if user_service_add_secret_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_secret_request'" + ) - :param user_service_add_secret_request: (required) - :type user_service_add_secret_request: UserServiceAddSecretRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._add_secret_serialize( - user_service_add_secret_request=user_service_add_secret_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceAddSecretResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.add_secret_with_http_info(user_service_add_secret_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _add_secret_serialize( + async def add_secret_with_http_info( self, - user_service_add_secret_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_add_secret_request is not None: - _body_params = user_service_add_secret_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/AddSecret', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_add_secret_request: UserServiceAddSecretRequest, + ) -> "ApiResult[UserServiceAddSecretResponse]": + """Add a Users Secret (with HTTP info) + Generates a client secret for the user. The client id is the users username. If the user already has a secret, it is overwritten. Only users of type machine can have a secret. Required permission: - user.write + :param user_service_add_secret_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_add_secret_request is None: + raise ValueError( + "Missing the required parameter 'user_service_add_secret_request'" + ) + path = "/zitadel.user.v2.UserService/AddSecret" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_add_secret_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceAddSecretResponse", + None, + ) - @validate_call - def create_invite_code( self, user_service_create_invite_code_request: Optional[UserServiceCreateInviteCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceCreateInviteCodeResponse: - if user_service_create_invite_code_request is None: - user_service_create_invite_code_request = {} + async def create_invite_code( + self, + user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, + ) -> UserServiceCreateInviteCodeResponse: """Create an invite code for a user - Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. Note: It is possible to reissue a new code only when the previous code has expired, or when the user provides a wrong code three or more times during verification. + :param user_service_create_invite_code_request: (required) - :param user_service_create_invite_code_request: (required) - :type user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_invite_code_serialize( - user_service_create_invite_code_request=user_service_create_invite_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceCreateInviteCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_create_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_invite_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreateInviteCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_invite_code_with_http_info( + user_service_create_invite_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_invite_code_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def create_invite_code_with_http_info( self, - user_service_create_invite_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_create_invite_code_request is not None: - _body_params = user_service_create_invite_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/CreateInviteCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_create_invite_code_request: UserServiceCreateInviteCodeRequest, + ) -> "ApiResult[UserServiceCreateInviteCodeResponse]": + """Create an invite code for a user (with HTTP info) + Create an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. If an invite code has been created previously, it's url template and application name will be used as defaults for the new code. The new code will overwrite the previous one and make it invalid. Note: It is possible to reissue a new code only when the previous code has expired, or when the user provides a wrong code three or more times during verification. + :param user_service_create_invite_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_create_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_invite_code_request'" + ) + path = "/zitadel.user.v2.UserService/CreateInviteCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_create_invite_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceCreateInviteCodeResponse", + None, + ) - @validate_call - def create_passkey_registration_link( self, user_service_create_passkey_registration_link_request: Optional[UserServiceCreatePasskeyRegistrationLinkRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceCreatePasskeyRegistrationLinkResponse: - if user_service_create_passkey_registration_link_request is None: - user_service_create_passkey_registration_link_request = {} + async def create_passkey_registration_link( + self, + user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, + ) -> UserServiceCreatePasskeyRegistrationLinkResponse: """Create a passkey registration link for a user - Create a passkey registration link which includes a code and either return it or send it to the user.. + :param user_service_create_passkey_registration_link_request: (required) - :param user_service_create_passkey_registration_link_request: (required) - :type user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_passkey_registration_link_serialize( - user_service_create_passkey_registration_link_request=user_service_create_passkey_registration_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceCreatePasskeyRegistrationLinkResponse + :raises ApiException: if fails to make API call + """ + if user_service_create_passkey_registration_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_passkey_registration_link_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreatePasskeyRegistrationLinkResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.create_passkey_registration_link_with_http_info( + user_service_create_passkey_registration_link_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _create_passkey_registration_link_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def create_passkey_registration_link_with_http_info( self, - user_service_create_passkey_registration_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_create_passkey_registration_link_request is not None: - _body_params = user_service_create_passkey_registration_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/CreatePasskeyRegistrationLink', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_create_passkey_registration_link_request: UserServiceCreatePasskeyRegistrationLinkRequest, + ) -> "ApiResult[UserServiceCreatePasskeyRegistrationLinkResponse]": + """Create a passkey registration link for a user (with HTTP info) + Create a passkey registration link which includes a code and either return it or send it to the user.. + :param user_service_create_passkey_registration_link_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_create_passkey_registration_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_passkey_registration_link_request'" + ) + path = "/zitadel.user.v2.UserService/CreatePasskeyRegistrationLink" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_create_passkey_registration_link_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceCreatePasskeyRegistrationLinkResponse", + None, + ) - @validate_call - def create_user( self, user_service_create_user_request: Optional[UserServiceCreateUserRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceCreateUserResponse: - if user_service_create_user_request is None: - user_service_create_user_request = {} + async def create_user( + self, + user_service_create_user_request: UserServiceCreateUserRequest, + ) -> UserServiceCreateUserResponse: """Create a User - Create a new human or machine user in the specified organization. Required permission: - user.write + :param user_service_create_user_request: (required) - :param user_service_create_user_request: (required) - :type user_service_create_user_request: UserServiceCreateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_user_serialize( - user_service_create_user_request=user_service_create_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceCreateUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_create_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_user_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceCreateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.create_user_with_http_info(user_service_create_user_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_user_serialize( + async def create_user_with_http_info( self, - user_service_create_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_create_user_request is not None: - _body_params = user_service_create_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/CreateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_create_user_request: UserServiceCreateUserRequest, + ) -> "ApiResult[UserServiceCreateUserResponse]": + """Create a User (with HTTP info) + Create a new human or machine user in the specified organization. Required permission: - user.write + :param user_service_create_user_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_create_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_create_user_request'" + ) + path = "/zitadel.user.v2.UserService/CreateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_create_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceCreateUserResponse", + None, + ) - @validate_call - def deactivate_user( self, user_service_deactivate_user_request: UserServiceDeactivateUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceDeactivateUserResponse: + async def deactivate_user( + self, + user_service_deactivate_user_request: UserServiceDeactivateUserRequest, + ) -> UserServiceDeactivateUserResponse: """Deactivate user - The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + :param user_service_deactivate_user_request: (required) + + :return: UserServiceDeactivateUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_deactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_deactivate_user_request'" + ) - :param user_service_deactivate_user_request: (required) - :type user_service_deactivate_user_request: UserServiceDeactivateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._deactivate_user_serialize( - user_service_deactivate_user_request=user_service_deactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.deactivate_user_with_http_info( + user_service_deactivate_user_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeactivateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _deactivate_user_serialize( + async def deactivate_user_with_http_info( self, - user_service_deactivate_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_deactivate_user_request is not None: - _body_params = user_service_deactivate_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/DeactivateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_deactivate_user_request: UserServiceDeactivateUserRequest, + ) -> "ApiResult[UserServiceDeactivateUserResponse]": + """Deactivate user (with HTTP info) + The state of the user will be changed to 'deactivated'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'deactivated'. Use deactivate user when the user should not be able to use the account anymore, but you still need access to the user data.. + :param user_service_deactivate_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_deactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_deactivate_user_request'" + ) + path = "/zitadel.user.v2.UserService/DeactivateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_deactivate_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceDeactivateUserResponse", + None, + ) - @validate_call - def delete_user( self, user_service_delete_user_request: UserServiceDeleteUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceDeleteUserResponse: + async def delete_user( + self, + user_service_delete_user_request: UserServiceDeleteUserRequest, + ) -> UserServiceDeleteUserResponse: """Delete user - The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + :param user_service_delete_user_request: (required) + + :return: UserServiceDeleteUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_delete_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_delete_user_request'" + ) - :param user_service_delete_user_request: (required) - :type user_service_delete_user_request: UserServiceDeleteUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_serialize( - user_service_delete_user_request=user_service_delete_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeleteUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.delete_user_with_http_info(user_service_delete_user_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_user_serialize( + async def delete_user_with_http_info( self, - user_service_delete_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_delete_user_request is not None: - _body_params = user_service_delete_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/DeleteUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_delete_user_request: UserServiceDeleteUserRequest, + ) -> "ApiResult[UserServiceDeleteUserResponse]": + """Delete user (with HTTP info) + The state of the user will be changed to 'deleted'. The user will not be able to log in anymore. Endpoints requesting this user will return an error 'User not found.. + :param user_service_delete_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_delete_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_delete_user_request'" + ) + path = "/zitadel.user.v2.UserService/DeleteUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_delete_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceDeleteUserResponse", + None, + ) - @validate_call - def delete_user_metadata( self, user_service_delete_user_metadata_request: UserServiceDeleteUserMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceDeleteUserMetadataResponse: + async def delete_user_metadata( + self, + user_service_delete_user_metadata_request: UserServiceDeleteUserMetadataRequest, + ) -> UserServiceDeleteUserMetadataResponse: """Delete User Metadata - Delete metadata objects from an user with a specific key. Required permission: - `user.write` + :param user_service_delete_user_metadata_request: (required) + + :return: UserServiceDeleteUserMetadataResponse + :raises ApiException: if fails to make API call + """ + if user_service_delete_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_delete_user_metadata_request'" + ) - :param user_service_delete_user_metadata_request: (required) - :type user_service_delete_user_metadata_request: UserServiceDeleteUserMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_user_metadata_serialize( - user_service_delete_user_metadata_request=user_service_delete_user_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_user_metadata_with_http_info( + user_service_delete_user_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceDeleteUserMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_user_metadata_serialize( + async def delete_user_metadata_with_http_info( self, - user_service_delete_user_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_delete_user_metadata_request is not None: - _body_params = user_service_delete_user_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/DeleteUserMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_delete_user_metadata_request: UserServiceDeleteUserMetadataRequest, + ) -> "ApiResult[UserServiceDeleteUserMetadataResponse]": + """Delete User Metadata (with HTTP info) + Delete metadata objects from an user with a specific key. Required permission: - `user.write` + :param user_service_delete_user_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_delete_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_delete_user_metadata_request'" + ) + path = "/zitadel.user.v2.UserService/DeleteUserMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_delete_user_metadata_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceDeleteUserMetadataResponse", + None, + ) - @validate_call - def generate_recovery_codes( self, user_service_generate_recovery_codes_request: UserServiceGenerateRecoveryCodesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceGenerateRecoveryCodesResponse: + async def generate_recovery_codes( + self, + user_service_generate_recovery_codes_request: UserServiceGenerateRecoveryCodesRequest, + ) -> UserServiceGenerateRecoveryCodesResponse: """Generate single-use recovery codes for a user - Generate new single-use recovery codes for the authenticated user. Recovery codes can be used to recover access to the account if other second factors are not available. + :param user_service_generate_recovery_codes_request: (required) + + :return: UserServiceGenerateRecoveryCodesResponse + :raises ApiException: if fails to make API call + """ + if user_service_generate_recovery_codes_request is None: + raise ValueError( + "Missing the required parameter 'user_service_generate_recovery_codes_request'" + ) - :param user_service_generate_recovery_codes_request: (required) - :type user_service_generate_recovery_codes_request: UserServiceGenerateRecoveryCodesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._generate_recovery_codes_serialize( - user_service_generate_recovery_codes_request=user_service_generate_recovery_codes_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.generate_recovery_codes_with_http_info( + user_service_generate_recovery_codes_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceGenerateRecoveryCodesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _generate_recovery_codes_serialize( + async def generate_recovery_codes_with_http_info( self, - user_service_generate_recovery_codes_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_generate_recovery_codes_request is not None: - _body_params = user_service_generate_recovery_codes_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/GenerateRecoveryCodes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_generate_recovery_codes_request: UserServiceGenerateRecoveryCodesRequest, + ) -> "ApiResult[UserServiceGenerateRecoveryCodesResponse]": + """Generate single-use recovery codes for a user (with HTTP info) + Generate new single-use recovery codes for the authenticated user. Recovery codes can be used to recover access to the account if other second factors are not available. + :param user_service_generate_recovery_codes_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_generate_recovery_codes_request is None: + raise ValueError( + "Missing the required parameter 'user_service_generate_recovery_codes_request'" + ) + path = "/zitadel.user.v2.UserService/GenerateRecoveryCodes" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_generate_recovery_codes_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceGenerateRecoveryCodesResponse", + None, + ) - @validate_call - def get_user_by_id( self, user_service_get_user_by_id_request: UserServiceGetUserByIDRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceGetUserByIDResponse: + async def get_user_by_id( + self, + user_service_get_user_by_id_request: UserServiceGetUserByIDRequest, + ) -> UserServiceGetUserByIDResponse: """User by ID - Returns the full user object (human or machine) including the profile, email, etc.. + :param user_service_get_user_by_id_request: (required) + + :return: UserServiceGetUserByIDResponse + :raises ApiException: if fails to make API call + """ + if user_service_get_user_by_id_request is None: + raise ValueError( + "Missing the required parameter 'user_service_get_user_by_id_request'" + ) - :param user_service_get_user_by_id_request: (required) - :type user_service_get_user_by_id_request: UserServiceGetUserByIDRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_user_by_id_serialize( - user_service_get_user_by_id_request=user_service_get_user_by_id_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.get_user_by_id_with_http_info( + user_service_get_user_by_id_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceGetUserByIDResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _get_user_by_id_serialize( + async def get_user_by_id_with_http_info( self, - user_service_get_user_by_id_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_get_user_by_id_request is not None: - _body_params = user_service_get_user_by_id_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/GetUserByID', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_get_user_by_id_request: UserServiceGetUserByIDRequest, + ) -> "ApiResult[UserServiceGetUserByIDResponse]": + """User by ID (with HTTP info) + Returns the full user object (human or machine) including the profile, email, etc.. + :param user_service_get_user_by_id_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_get_user_by_id_request is None: + raise ValueError( + "Missing the required parameter 'user_service_get_user_by_id_request'" + ) + path = "/zitadel.user.v2.UserService/GetUserByID" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_get_user_by_id_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceGetUserByIDResponse", + None, + ) - @validate_call - def human_mfa_init_skipped( self, user_service_human_mfa_init_skipped_request: UserServiceHumanMFAInitSkippedRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceHumanMFAInitSkippedResponse: + async def human_mfa_init_skipped( + self, + user_service_human_mfa_init_skipped_request: UserServiceHumanMFAInitSkippedRequest, + ) -> UserServiceHumanMFAInitSkippedResponse: """MFA Init Skipped - Update the last time the user has skipped MFA initialization. The server timestamp is used. + :param user_service_human_mfa_init_skipped_request: (required) + + :return: UserServiceHumanMFAInitSkippedResponse + :raises ApiException: if fails to make API call + """ + if user_service_human_mfa_init_skipped_request is None: + raise ValueError( + "Missing the required parameter 'user_service_human_mfa_init_skipped_request'" + ) - :param user_service_human_mfa_init_skipped_request: (required) - :type user_service_human_mfa_init_skipped_request: UserServiceHumanMFAInitSkippedRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._human_mfa_init_skipped_serialize( - user_service_human_mfa_init_skipped_request=user_service_human_mfa_init_skipped_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.human_mfa_init_skipped_with_http_info( + user_service_human_mfa_init_skipped_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceHumanMFAInitSkippedResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _human_mfa_init_skipped_serialize( + async def human_mfa_init_skipped_with_http_info( self, - user_service_human_mfa_init_skipped_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_human_mfa_init_skipped_request is not None: - _body_params = user_service_human_mfa_init_skipped_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/HumanMFAInitSkipped', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_human_mfa_init_skipped_request: UserServiceHumanMFAInitSkippedRequest, + ) -> "ApiResult[UserServiceHumanMFAInitSkippedResponse]": + """MFA Init Skipped (with HTTP info) + Update the last time the user has skipped MFA initialization. The server timestamp is used. + :param user_service_human_mfa_init_skipped_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_human_mfa_init_skipped_request is None: + raise ValueError( + "Missing the required parameter 'user_service_human_mfa_init_skipped_request'" + ) + path = "/zitadel.user.v2.UserService/HumanMFAInitSkipped" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_human_mfa_init_skipped_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceHumanMFAInitSkippedResponse", + None, + ) - @validate_call - def list_authentication_factors( self, user_service_list_authentication_factors_request: UserServiceListAuthenticationFactorsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListAuthenticationFactorsResponse: + async def list_authentication_factors( + self, + user_service_list_authentication_factors_request: UserServiceListAuthenticationFactorsRequest, + ) -> UserServiceListAuthenticationFactorsResponse: """ListAuthenticationFactors + :param user_service_list_authentication_factors_request: (required) + + :return: UserServiceListAuthenticationFactorsResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_authentication_factors_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_authentication_factors_request'" + ) - - :param user_service_list_authentication_factors_request: (required) - :type user_service_list_authentication_factors_request: UserServiceListAuthenticationFactorsRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_authentication_factors_serialize( - user_service_list_authentication_factors_request=user_service_list_authentication_factors_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_authentication_factors_with_http_info( + user_service_list_authentication_factors_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationFactorsResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_authentication_factors_serialize( + async def list_authentication_factors_with_http_info( self, - user_service_list_authentication_factors_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_authentication_factors_request is not None: - _body_params = user_service_list_authentication_factors_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListAuthenticationFactors', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_authentication_factors_request: UserServiceListAuthenticationFactorsRequest, + ) -> "ApiResult[UserServiceListAuthenticationFactorsResponse]": + """ListAuthenticationFactors (with HTTP info) + :param user_service_list_authentication_factors_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_authentication_factors_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_authentication_factors_request'" + ) + path = "/zitadel.user.v2.UserService/ListAuthenticationFactors" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_authentication_factors_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListAuthenticationFactorsResponse", + None, + ) - @validate_call - def list_authentication_method_types( self, user_service_list_authentication_method_types_request: UserServiceListAuthenticationMethodTypesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListAuthenticationMethodTypesResponse: + async def list_authentication_method_types( + self, + user_service_list_authentication_method_types_request: UserServiceListAuthenticationMethodTypesRequest, + ) -> UserServiceListAuthenticationMethodTypesResponse: """List all possible authentication methods of a user - List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. + :param user_service_list_authentication_method_types_request: (required) + + :return: UserServiceListAuthenticationMethodTypesResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_authentication_method_types_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_authentication_method_types_request'" + ) - :param user_service_list_authentication_method_types_request: (required) - :type user_service_list_authentication_method_types_request: UserServiceListAuthenticationMethodTypesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_authentication_method_types_serialize( - user_service_list_authentication_method_types_request=user_service_list_authentication_method_types_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_authentication_method_types_with_http_info( + user_service_list_authentication_method_types_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListAuthenticationMethodTypesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_authentication_method_types_serialize( + async def list_authentication_method_types_with_http_info( self, - user_service_list_authentication_method_types_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_authentication_method_types_request is not None: - _body_params = user_service_list_authentication_method_types_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListAuthenticationMethodTypes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_authentication_method_types_request: UserServiceListAuthenticationMethodTypesRequest, + ) -> "ApiResult[UserServiceListAuthenticationMethodTypesResponse]": + """List all possible authentication methods of a user (with HTTP info) + List all possible authentication methods of a user like password, passwordless, (T)OTP and more.. + :param user_service_list_authentication_method_types_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_authentication_method_types_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_authentication_method_types_request'" + ) + path = "/zitadel.user.v2.UserService/ListAuthenticationMethodTypes" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_authentication_method_types_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListAuthenticationMethodTypesResponse", + None, + ) - @validate_call - def list_idp_links( self, user_service_list_idp_links_request: UserServiceListIDPLinksRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListIDPLinksResponse: + async def list_idp_links( + self, + user_service_list_idp_links_request: UserServiceListIDPLinksRequest, + ) -> UserServiceListIDPLinksResponse: """List links to an identity provider of an user - List links to an identity provider of an user. + :param user_service_list_idp_links_request: (required) + + :return: UserServiceListIDPLinksResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_idp_links_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_idp_links_request'" + ) - :param user_service_list_idp_links_request: (required) - :type user_service_list_idp_links_request: UserServiceListIDPLinksRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_idp_links_serialize( - user_service_list_idp_links_request=user_service_list_idp_links_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_idp_links_with_http_info( + user_service_list_idp_links_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListIDPLinksResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_idp_links_serialize( + async def list_idp_links_with_http_info( self, - user_service_list_idp_links_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_idp_links_request is not None: - _body_params = user_service_list_idp_links_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListIDPLinks', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_idp_links_request: UserServiceListIDPLinksRequest, + ) -> "ApiResult[UserServiceListIDPLinksResponse]": + """List links to an identity provider of an user (with HTTP info) + List links to an identity provider of an user. + :param user_service_list_idp_links_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_idp_links_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_idp_links_request'" + ) + path = "/zitadel.user.v2.UserService/ListIDPLinks" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_idp_links_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListIDPLinksResponse", + None, + ) - @validate_call - def list_keys( self, user_service_list_keys_request: UserServiceListKeysRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListKeysResponse: + async def list_keys( + self, + user_service_list_keys_request: UserServiceListKeysRequest, + ) -> UserServiceListKeysResponse: """Search Keys - List all matching keys. By default all keys of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read + :param user_service_list_keys_request: (required) + + :return: UserServiceListKeysResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_keys_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_keys_request'" + ) - :param user_service_list_keys_request: (required) - :type user_service_list_keys_request: UserServiceListKeysRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_keys_serialize( - user_service_list_keys_request=user_service_list_keys_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.list_keys_with_http_info(user_service_list_keys_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_keys_serialize( + async def list_keys_with_http_info( self, - user_service_list_keys_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_keys_request is not None: - _body_params = user_service_list_keys_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_keys_request: UserServiceListKeysRequest, + ) -> "ApiResult[UserServiceListKeysResponse]": + """Search Keys (with HTTP info) + List all matching keys. By default all keys of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read + :param user_service_list_keys_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_keys_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_keys_request'" + ) + path = "/zitadel.user.v2.UserService/ListKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_keys_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListKeysResponse", + None, + ) - @validate_call - def list_passkeys( self, user_service_list_passkeys_request: UserServiceListPasskeysRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListPasskeysResponse: + async def list_passkeys( + self, + user_service_list_passkeys_request: UserServiceListPasskeysRequest, + ) -> UserServiceListPasskeysResponse: """List passkeys of an user - List passkeys of an user + :param user_service_list_passkeys_request: (required) + + :return: UserServiceListPasskeysResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_passkeys_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_passkeys_request'" + ) - :param user_service_list_passkeys_request: (required) - :type user_service_list_passkeys_request: UserServiceListPasskeysRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_passkeys_serialize( - user_service_list_passkeys_request=user_service_list_passkeys_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_passkeys_with_http_info( + user_service_list_passkeys_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListPasskeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_passkeys_serialize( + async def list_passkeys_with_http_info( self, - user_service_list_passkeys_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_passkeys_request is not None: - _body_params = user_service_list_passkeys_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListPasskeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_passkeys_request: UserServiceListPasskeysRequest, + ) -> "ApiResult[UserServiceListPasskeysResponse]": + """List passkeys of an user (with HTTP info) + List passkeys of an user + :param user_service_list_passkeys_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_passkeys_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_passkeys_request'" + ) + path = "/zitadel.user.v2.UserService/ListPasskeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_passkeys_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListPasskeysResponse", + None, + ) - @validate_call - def list_personal_access_tokens( self, user_service_list_personal_access_tokens_request: UserServiceListPersonalAccessTokensRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListPersonalAccessTokensResponse: + async def list_personal_access_tokens( + self, + user_service_list_personal_access_tokens_request: UserServiceListPersonalAccessTokensRequest, + ) -> UserServiceListPersonalAccessTokensResponse: """Search Personal Access Tokens - List all personal access tokens. By default all personal access tokens of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read + :param user_service_list_personal_access_tokens_request: (required) + + :return: UserServiceListPersonalAccessTokensResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_personal_access_tokens_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_personal_access_tokens_request'" + ) - :param user_service_list_personal_access_tokens_request: (required) - :type user_service_list_personal_access_tokens_request: UserServiceListPersonalAccessTokensRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_personal_access_tokens_serialize( - user_service_list_personal_access_tokens_request=user_service_list_personal_access_tokens_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_personal_access_tokens_with_http_info( + user_service_list_personal_access_tokens_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListPersonalAccessTokensResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_personal_access_tokens_serialize( + async def list_personal_access_tokens_with_http_info( self, - user_service_list_personal_access_tokens_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_personal_access_tokens_request is not None: - _body_params = user_service_list_personal_access_tokens_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListPersonalAccessTokens', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_personal_access_tokens_request: UserServiceListPersonalAccessTokensRequest, + ) -> "ApiResult[UserServiceListPersonalAccessTokensResponse]": + """Search Personal Access Tokens (with HTTP info) + List all personal access tokens. By default all personal access tokens of the instance on which the caller has permission to read the owning users are returned. Make sure to include a limit and sorting for pagination. Required permission: - user.read + :param user_service_list_personal_access_tokens_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_personal_access_tokens_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_personal_access_tokens_request'" + ) + path = "/zitadel.user.v2.UserService/ListPersonalAccessTokens" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_personal_access_tokens_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListPersonalAccessTokensResponse", + None, + ) - @validate_call - def list_user_metadata( self, user_service_list_user_metadata_request: UserServiceListUserMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListUserMetadataResponse: + async def list_user_metadata( + self, + user_service_list_user_metadata_request: UserServiceListUserMetadataRequest, + ) -> UserServiceListUserMetadataResponse: """List User Metadata - List metadata of an user filtered by query. Required permission: - `user.read` + :param user_service_list_user_metadata_request: (required) + + :return: UserServiceListUserMetadataResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_user_metadata_request'" + ) - :param user_service_list_user_metadata_request: (required) - :type user_service_list_user_metadata_request: UserServiceListUserMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_user_metadata_serialize( - user_service_list_user_metadata_request=user_service_list_user_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.list_user_metadata_with_http_info( + user_service_list_user_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListUserMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_user_metadata_serialize( + async def list_user_metadata_with_http_info( self, - user_service_list_user_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_user_metadata_request is not None: - _body_params = user_service_list_user_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListUserMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_user_metadata_request: UserServiceListUserMetadataRequest, + ) -> "ApiResult[UserServiceListUserMetadataResponse]": + """List User Metadata (with HTTP info) + List metadata of an user filtered by query. Required permission: - `user.read` + :param user_service_list_user_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_user_metadata_request'" + ) + path = "/zitadel.user.v2.UserService/ListUserMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_user_metadata_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListUserMetadataResponse", + None, + ) - @validate_call - def list_users( self, user_service_list_users_request: UserServiceListUsersRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceListUsersResponse: + async def list_users( + self, + user_service_list_users_request: UserServiceListUsersRequest, + ) -> UserServiceListUsersResponse: """Search Users - Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. + :param user_service_list_users_request: (required) + + :return: UserServiceListUsersResponse + :raises ApiException: if fails to make API call + """ + if user_service_list_users_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_users_request'" + ) - :param user_service_list_users_request: (required) - :type user_service_list_users_request: UserServiceListUsersRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_users_serialize( - user_service_list_users_request=user_service_list_users_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceListUsersResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.list_users_with_http_info(user_service_list_users_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_users_serialize( + async def list_users_with_http_info( self, - user_service_list_users_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_list_users_request is not None: - _body_params = user_service_list_users_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ListUsers', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_list_users_request: UserServiceListUsersRequest, + ) -> "ApiResult[UserServiceListUsersResponse]": + """Search Users (with HTTP info) + Search for users. By default, we will return all users of your instance that you have permission to read. Make sure to include a limit and sorting for pagination. + :param user_service_list_users_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_list_users_request is None: + raise ValueError( + "Missing the required parameter 'user_service_list_users_request'" + ) + path = "/zitadel.user.v2.UserService/ListUsers" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_list_users_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceListUsersResponse", + None, + ) - @validate_call - def lock_user( self, user_service_lock_user_request: UserServiceLockUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceLockUserResponse: + async def lock_user( + self, + user_service_lock_user_request: UserServiceLockUserRequest, + ) -> UserServiceLockUserResponse: """Lock user - The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + :param user_service_lock_user_request: (required) + + :return: UserServiceLockUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_lock_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_lock_user_request'" + ) - :param user_service_lock_user_request: (required) - :type user_service_lock_user_request: UserServiceLockUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._lock_user_serialize( - user_service_lock_user_request=user_service_lock_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceLockUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.lock_user_with_http_info(user_service_lock_user_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _lock_user_serialize( + async def lock_user_with_http_info( self, - user_service_lock_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_lock_user_request is not None: - _body_params = user_service_lock_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/LockUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_lock_user_request: UserServiceLockUserRequest, + ) -> "ApiResult[UserServiceLockUserResponse]": + """Lock user (with HTTP info) + The state of the user will be changed to 'locked'. The user will not be able to log in anymore. The endpoint returns an error if the user is already in the state 'locked'. Use this endpoint if the user should not be able to log in temporarily because of an event that happened (wrong password, etc.).. + :param user_service_lock_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_lock_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_lock_user_request'" + ) + path = "/zitadel.user.v2.UserService/LockUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_lock_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceLockUserResponse", + None, + ) - @validate_call - def password_reset( self, user_service_password_reset_request: Optional[UserServicePasswordResetRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServicePasswordResetResponse: - if user_service_password_reset_request is None: - user_service_password_reset_request = {} + async def password_reset( + self, + user_service_password_reset_request: UserServicePasswordResetRequest, + ) -> UserServicePasswordResetResponse: """Request a code to reset a password - Request a code to reset a password.. + :param user_service_password_reset_request: (required) - :param user_service_password_reset_request: (required) - :type user_service_password_reset_request: UserServicePasswordResetRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._password_reset_serialize( - user_service_password_reset_request=user_service_password_reset_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServicePasswordResetResponse + :raises ApiException: if fails to make API call + """ + if user_service_password_reset_request is None: + raise ValueError( + "Missing the required parameter 'user_service_password_reset_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServicePasswordResetResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.password_reset_with_http_info( + user_service_password_reset_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _password_reset_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def password_reset_with_http_info( self, - user_service_password_reset_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_password_reset_request is not None: - _body_params = user_service_password_reset_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/PasswordReset', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_password_reset_request: UserServicePasswordResetRequest, + ) -> "ApiResult[UserServicePasswordResetResponse]": + """Request a code to reset a password (with HTTP info) + Request a code to reset a password.. + :param user_service_password_reset_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_password_reset_request is None: + raise ValueError( + "Missing the required parameter 'user_service_password_reset_request'" + ) + path = "/zitadel.user.v2.UserService/PasswordReset" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_password_reset_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServicePasswordResetResponse", + None, + ) - @validate_call - def reactivate_user( self, user_service_reactivate_user_request: UserServiceReactivateUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceReactivateUserResponse: + async def reactivate_user( + self, + user_service_reactivate_user_request: UserServiceReactivateUserRequest, + ) -> UserServiceReactivateUserResponse: """Reactivate user - Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. + :param user_service_reactivate_user_request: (required) + + :return: UserServiceReactivateUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_reactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_reactivate_user_request'" + ) - :param user_service_reactivate_user_request: (required) - :type user_service_reactivate_user_request: UserServiceReactivateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._reactivate_user_serialize( - user_service_reactivate_user_request=user_service_reactivate_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.reactivate_user_with_http_info( + user_service_reactivate_user_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceReactivateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _reactivate_user_serialize( + async def reactivate_user_with_http_info( self, - user_service_reactivate_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_reactivate_user_request is not None: - _body_params = user_service_reactivate_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ReactivateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_reactivate_user_request: UserServiceReactivateUserRequest, + ) -> "ApiResult[UserServiceReactivateUserResponse]": + """Reactivate user (with HTTP info) + Reactivate a user with the state 'deactivated'. The user will be able to log in again afterward. The endpoint returns an error if the user is not in the state 'deactivated'.. + :param user_service_reactivate_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_reactivate_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_reactivate_user_request'" + ) + path = "/zitadel.user.v2.UserService/ReactivateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_reactivate_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceReactivateUserResponse", + None, + ) - @validate_call - def register_passkey( self, user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRegisterPasskeyResponse: + async def register_passkey( + self, + user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, + ) -> UserServiceRegisterPasskeyResponse: """Start the registration of passkey for a user - Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. + :param user_service_register_passkey_request: (required) + + :return: UserServiceRegisterPasskeyResponse + :raises ApiException: if fails to make API call + """ + if user_service_register_passkey_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_passkey_request'" + ) - :param user_service_register_passkey_request: (required) - :type user_service_register_passkey_request: UserServiceRegisterPasskeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_passkey_serialize( - user_service_register_passkey_request=user_service_register_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.register_passkey_with_http_info( + user_service_register_passkey_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterPasskeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _register_passkey_serialize( + async def register_passkey_with_http_info( self, - user_service_register_passkey_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_register_passkey_request is not None: - _body_params = user_service_register_passkey_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RegisterPasskey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_register_passkey_request: UserServiceRegisterPasskeyRequest, + ) -> "ApiResult[UserServiceRegisterPasskeyResponse]": + """Start the registration of passkey for a user (with HTTP info) + Start the registration of a passkey for a user, as a response the public key credential creation options are returned, which are used to verify the passkey.. + :param user_service_register_passkey_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_register_passkey_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_passkey_request'" + ) + path = "/zitadel.user.v2.UserService/RegisterPasskey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_register_passkey_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRegisterPasskeyResponse", + None, + ) - @validate_call - def register_totp( self, user_service_register_totp_request: UserServiceRegisterTOTPRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRegisterTOTPResponse: + async def register_totp( + self, + user_service_register_totp_request: UserServiceRegisterTOTPRequest, + ) -> UserServiceRegisterTOTPResponse: """Start the registration of a TOTP generator for a user - Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. + :param user_service_register_totp_request: (required) + + :return: UserServiceRegisterTOTPResponse + :raises ApiException: if fails to make API call + """ + if user_service_register_totp_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_totp_request'" + ) - :param user_service_register_totp_request: (required) - :type user_service_register_totp_request: UserServiceRegisterTOTPRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_totp_serialize( - user_service_register_totp_request=user_service_register_totp_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.register_totp_with_http_info( + user_service_register_totp_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterTOTPResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _register_totp_serialize( + async def register_totp_with_http_info( self, - user_service_register_totp_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_register_totp_request is not None: - _body_params = user_service_register_totp_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RegisterTOTP', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_register_totp_request: UserServiceRegisterTOTPRequest, + ) -> "ApiResult[UserServiceRegisterTOTPResponse]": + """Start the registration of a TOTP generator for a user (with HTTP info) + Start the registration of a TOTP generator for a user, as a response a secret returned, which is used to initialize a TOTP app or device.. + :param user_service_register_totp_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_register_totp_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_totp_request'" + ) + path = "/zitadel.user.v2.UserService/RegisterTOTP" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_register_totp_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRegisterTOTPResponse", + None, + ) - @validate_call - def register_u2_f( self, user_service_register_u2_f_request: UserServiceRegisterU2FRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRegisterU2FResponse: + async def register_u2_f( + self, + user_service_register_u2_f_request: UserServiceRegisterU2FRequest, + ) -> UserServiceRegisterU2FResponse: """Start the registration of a u2f token for a user - Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. + :param user_service_register_u2_f_request: (required) + + :return: UserServiceRegisterU2FResponse + :raises ApiException: if fails to make API call + """ + if user_service_register_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_u2_f_request'" + ) - :param user_service_register_u2_f_request: (required) - :type user_service_register_u2_f_request: UserServiceRegisterU2FRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._register_u2_f_serialize( - user_service_register_u2_f_request=user_service_register_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.register_u2_f_with_http_info( + user_service_register_u2_f_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRegisterU2FResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _register_u2_f_serialize( + async def register_u2_f_with_http_info( self, - user_service_register_u2_f_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_register_u2_f_request is not None: - _body_params = user_service_register_u2_f_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RegisterU2F', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_register_u2_f_request: UserServiceRegisterU2FRequest, + ) -> "ApiResult[UserServiceRegisterU2FResponse]": + """Start the registration of a u2f token for a user (with HTTP info) + Start the registration of a u2f token for a user, as a response the public key credential creation options are returned, which are used to verify the u2f token.. + :param user_service_register_u2_f_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_register_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'user_service_register_u2_f_request'" + ) + path = "/zitadel.user.v2.UserService/RegisterU2F" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_register_u2_f_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRegisterU2FResponse", + None, + ) - @validate_call - def remove_idp_link( self, user_service_remove_idp_link_request: UserServiceRemoveIDPLinkRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveIDPLinkResponse: + async def remove_idp_link( + self, + user_service_remove_idp_link_request: UserServiceRemoveIDPLinkRequest, + ) -> UserServiceRemoveIDPLinkResponse: """Remove link of an identity provider to an user - Remove link of an identity provider to an user. + :param user_service_remove_idp_link_request: (required) + + :return: UserServiceRemoveIDPLinkResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_idp_link_request'" + ) - :param user_service_remove_idp_link_request: (required) - :type user_service_remove_idp_link_request: UserServiceRemoveIDPLinkRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_idp_link_serialize( - user_service_remove_idp_link_request=user_service_remove_idp_link_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_idp_link_with_http_info( + user_service_remove_idp_link_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveIDPLinkResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_idp_link_serialize( + async def remove_idp_link_with_http_info( self, - user_service_remove_idp_link_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_idp_link_request is not None: - _body_params = user_service_remove_idp_link_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveIDPLink', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_idp_link_request: UserServiceRemoveIDPLinkRequest, + ) -> "ApiResult[UserServiceRemoveIDPLinkResponse]": + """Remove link of an identity provider to an user (with HTTP info) + Remove link of an identity provider to an user. + :param user_service_remove_idp_link_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_idp_link_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_idp_link_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveIDPLink" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_idp_link_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveIDPLinkResponse", + None, + ) - @validate_call - def remove_key( self, user_service_remove_key_request: UserServiceRemoveKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveKeyResponse: + async def remove_key( + self, + user_service_remove_key_request: UserServiceRemoveKeyRequest, + ) -> UserServiceRemoveKeyResponse: """Remove a Key - Remove a machine users key by the given key ID and an optionally given user ID. Required permission: - user.write + :param user_service_remove_key_request: (required) + + :return: UserServiceRemoveKeyResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_key_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_key_request'" + ) - :param user_service_remove_key_request: (required) - :type user_service_remove_key_request: UserServiceRemoveKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_key_serialize( - user_service_remove_key_request=user_service_remove_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.remove_key_with_http_info(user_service_remove_key_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_key_serialize( + async def remove_key_with_http_info( self, - user_service_remove_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_key_request is not None: - _body_params = user_service_remove_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_key_request: UserServiceRemoveKeyRequest, + ) -> "ApiResult[UserServiceRemoveKeyResponse]": + """Remove a Key (with HTTP info) + Remove a machine users key by the given key ID and an optionally given user ID. Required permission: - user.write + :param user_service_remove_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_key_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_key_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_key_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveKeyResponse", + None, + ) - @validate_call - def remove_otp_email( self, user_service_remove_otp_email_request: UserServiceRemoveOTPEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveOTPEmailResponse: + async def remove_otp_email( + self, + user_service_remove_otp_email_request: UserServiceRemoveOTPEmailRequest, + ) -> UserServiceRemoveOTPEmailResponse: """Remove One-Time Password (OTP) Email from a user - Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. + :param user_service_remove_otp_email_request: (required) + + :return: UserServiceRemoveOTPEmailResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_otp_email_request'" + ) - :param user_service_remove_otp_email_request: (required) - :type user_service_remove_otp_email_request: UserServiceRemoveOTPEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_otp_email_serialize( - user_service_remove_otp_email_request=user_service_remove_otp_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_otp_email_with_http_info( + user_service_remove_otp_email_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_otp_email_serialize( + async def remove_otp_email_with_http_info( self, - user_service_remove_otp_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_otp_email_request is not None: - _body_params = user_service_remove_otp_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveOTPEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_otp_email_request: UserServiceRemoveOTPEmailRequest, + ) -> "ApiResult[UserServiceRemoveOTPEmailResponse]": + """Remove One-Time Password (OTP) Email from a user (with HTTP info) + Remove the configured One-Time Password (OTP) Email factor of a user. As only one OTP Email per user is allowed, the user will not have OTP Email as a second factor afterward. + :param user_service_remove_otp_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_otp_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_otp_email_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveOTPEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_otp_email_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveOTPEmailResponse", + None, + ) - @validate_call - def remove_otpsms( self, user_service_remove_otpsms_request: UserServiceRemoveOTPSMSRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveOTPSMSResponse: + async def remove_otpsms( + self, + user_service_remove_otpsms_request: UserServiceRemoveOTPSMSRequest, + ) -> UserServiceRemoveOTPSMSResponse: """Remove One-Time Password (OTP) SMS from a user - Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. + :param user_service_remove_otpsms_request: (required) + + :return: UserServiceRemoveOTPSMSResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_otpsms_request'" + ) - :param user_service_remove_otpsms_request: (required) - :type user_service_remove_otpsms_request: UserServiceRemoveOTPSMSRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_otpsms_serialize( - user_service_remove_otpsms_request=user_service_remove_otpsms_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_otpsms_with_http_info( + user_service_remove_otpsms_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveOTPSMSResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_otpsms_serialize( + async def remove_otpsms_with_http_info( self, - user_service_remove_otpsms_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_otpsms_request is not None: - _body_params = user_service_remove_otpsms_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveOTPSMS', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_otpsms_request: UserServiceRemoveOTPSMSRequest, + ) -> "ApiResult[UserServiceRemoveOTPSMSResponse]": + """Remove One-Time Password (OTP) SMS from a user (with HTTP info) + Remove the configured One-Time Password (OTP) SMS factor of a user. As only one OTP SMS per user is allowed, the user will not have OTP SMS as a second factor afterward. + :param user_service_remove_otpsms_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_otpsms_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_otpsms_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveOTPSMS" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_otpsms_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveOTPSMSResponse", + None, + ) - @validate_call - def remove_passkey( self, user_service_remove_passkey_request: UserServiceRemovePasskeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemovePasskeyResponse: + async def remove_passkey( + self, + user_service_remove_passkey_request: UserServiceRemovePasskeyRequest, + ) -> UserServiceRemovePasskeyResponse: """Remove passkey from a user - Remove passkey from a user. + :param user_service_remove_passkey_request: (required) + + :return: UserServiceRemovePasskeyResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_passkey_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_passkey_request'" + ) - :param user_service_remove_passkey_request: (required) - :type user_service_remove_passkey_request: UserServiceRemovePasskeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_passkey_serialize( - user_service_remove_passkey_request=user_service_remove_passkey_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_passkey_with_http_info( + user_service_remove_passkey_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePasskeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_passkey_serialize( + async def remove_passkey_with_http_info( self, - user_service_remove_passkey_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_passkey_request is not None: - _body_params = user_service_remove_passkey_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemovePasskey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_passkey_request: UserServiceRemovePasskeyRequest, + ) -> "ApiResult[UserServiceRemovePasskeyResponse]": + """Remove passkey from a user (with HTTP info) + Remove passkey from a user. + :param user_service_remove_passkey_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_passkey_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_passkey_request'" + ) + path = "/zitadel.user.v2.UserService/RemovePasskey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_passkey_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemovePasskeyResponse", + None, + ) - @validate_call - def remove_personal_access_token( self, user_service_remove_personal_access_token_request: UserServiceRemovePersonalAccessTokenRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemovePersonalAccessTokenResponse: + async def remove_personal_access_token( + self, + user_service_remove_personal_access_token_request: UserServiceRemovePersonalAccessTokenRequest, + ) -> UserServiceRemovePersonalAccessTokenResponse: """Remove a Personal Access Token - Removes a machine users personal access token by the given token ID and an optionally given user ID. Required permission: - user.write + :param user_service_remove_personal_access_token_request: (required) + + :return: UserServiceRemovePersonalAccessTokenResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_personal_access_token_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_personal_access_token_request'" + ) - :param user_service_remove_personal_access_token_request: (required) - :type user_service_remove_personal_access_token_request: UserServiceRemovePersonalAccessTokenRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_personal_access_token_serialize( - user_service_remove_personal_access_token_request=user_service_remove_personal_access_token_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_personal_access_token_with_http_info( + user_service_remove_personal_access_token_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePersonalAccessTokenResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_personal_access_token_serialize( + async def remove_personal_access_token_with_http_info( self, - user_service_remove_personal_access_token_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_personal_access_token_request is not None: - _body_params = user_service_remove_personal_access_token_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemovePersonalAccessToken', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_personal_access_token_request: UserServiceRemovePersonalAccessTokenRequest, + ) -> "ApiResult[UserServiceRemovePersonalAccessTokenResponse]": + """Remove a Personal Access Token (with HTTP info) + Removes a machine users personal access token by the given token ID and an optionally given user ID. Required permission: - user.write + :param user_service_remove_personal_access_token_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_personal_access_token_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_personal_access_token_request'" + ) + path = "/zitadel.user.v2.UserService/RemovePersonalAccessToken" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_personal_access_token_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemovePersonalAccessTokenResponse", + None, + ) - @validate_call - def remove_phone( self, user_service_remove_phone_request: UserServiceRemovePhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemovePhoneResponse: + async def remove_phone( + self, + user_service_remove_phone_request: UserServiceRemovePhoneRequest, + ) -> UserServiceRemovePhoneResponse: """Delete the user phone - Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx) to remove the phone number. Delete the phone number of a user. + :param user_service_remove_phone_request: (required) + + :return: UserServiceRemovePhoneResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_phone_request'" + ) - :param user_service_remove_phone_request: (required) - :type user_service_remove_phone_request: UserServiceRemovePhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_phone_serialize( - user_service_remove_phone_request=user_service_remove_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_phone_with_http_info( + user_service_remove_phone_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemovePhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_phone_serialize( + async def remove_phone_with_http_info( self, - user_service_remove_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_phone_request is not None: - _body_params = user_service_remove_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemovePhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_phone_request: UserServiceRemovePhoneRequest, + ) -> "ApiResult[UserServiceRemovePhoneResponse]": + """Delete the user phone (with HTTP info) + Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx) to remove the phone number. Delete the phone number of a user. + :param user_service_remove_phone_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_phone_request'" + ) + path = "/zitadel.user.v2.UserService/RemovePhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_phone_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemovePhoneResponse", + None, + ) - @validate_call - def remove_recovery_codes( self, user_service_remove_recovery_codes_request: UserServiceRemoveRecoveryCodesRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveRecoveryCodesResponse: + async def remove_recovery_codes( + self, + user_service_remove_recovery_codes_request: UserServiceRemoveRecoveryCodesRequest, + ) -> UserServiceRemoveRecoveryCodesResponse: """Remove recovery codes from a user + Remove all recovery codes from the authenticated user. This will disable the recovery code second factor. + :param user_service_remove_recovery_codes_request: (required) + + :return: UserServiceRemoveRecoveryCodesResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_recovery_codes_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_recovery_codes_request'" + ) + + result = await self.remove_recovery_codes_with_http_info( + user_service_remove_recovery_codes_request + ) + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def remove_recovery_codes_with_http_info( + self, + user_service_remove_recovery_codes_request: UserServiceRemoveRecoveryCodesRequest, + ) -> "ApiResult[UserServiceRemoveRecoveryCodesResponse]": + """Remove recovery codes from a user (with HTTP info) Remove all recovery codes from the authenticated user. This will disable the recovery code second factor. + :param user_service_remove_recovery_codes_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_recovery_codes_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_recovery_codes_request'" + ) - :param user_service_remove_recovery_codes_request: (required) - :type user_service_remove_recovery_codes_request: UserServiceRemoveRecoveryCodesRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_recovery_codes_serialize( - user_service_remove_recovery_codes_request=user_service_remove_recovery_codes_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + path = "/zitadel.user.v2.UserService/RemoveRecoveryCodes" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_recovery_codes_request - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveRecoveryCodesResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveRecoveryCodesResponse", + None, ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _remove_recovery_codes_serialize( + async def remove_secret( self, - user_service_remove_recovery_codes_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_recovery_codes_request is not None: - _body_params = user_service_remove_recovery_codes_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveRecoveryCodes', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def remove_secret( self, user_service_remove_secret_request: UserServiceRemoveSecretRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveSecretResponse: + user_service_remove_secret_request: UserServiceRemoveSecretRequest, + ) -> UserServiceRemoveSecretResponse: """Remove a Users Secret - Remove the current client ID and client secret from a machine user. Required permission: - user.write + :param user_service_remove_secret_request: (required) + + :return: UserServiceRemoveSecretResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_secret_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_secret_request'" + ) - :param user_service_remove_secret_request: (required) - :type user_service_remove_secret_request: UserServiceRemoveSecretRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_secret_serialize( - user_service_remove_secret_request=user_service_remove_secret_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.remove_secret_with_http_info( + user_service_remove_secret_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveSecretResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_secret_serialize( + async def remove_secret_with_http_info( self, - user_service_remove_secret_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_secret_request is not None: - _body_params = user_service_remove_secret_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveSecret', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_secret_request: UserServiceRemoveSecretRequest, + ) -> "ApiResult[UserServiceRemoveSecretResponse]": + """Remove a Users Secret (with HTTP info) + Remove the current client ID and client secret from a machine user. Required permission: - user.write + :param user_service_remove_secret_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_secret_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_secret_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveSecret" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_secret_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveSecretResponse", + None, + ) - @validate_call - def remove_totp( self, user_service_remove_totp_request: UserServiceRemoveTOTPRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveTOTPResponse: + async def remove_totp( + self, + user_service_remove_totp_request: UserServiceRemoveTOTPRequest, + ) -> UserServiceRemoveTOTPResponse: """Remove TOTP generator from a user - Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. + :param user_service_remove_totp_request: (required) + + :return: UserServiceRemoveTOTPResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_totp_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_totp_request'" + ) - :param user_service_remove_totp_request: (required) - :type user_service_remove_totp_request: UserServiceRemoveTOTPRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_totp_serialize( - user_service_remove_totp_request=user_service_remove_totp_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveTOTPResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.remove_totp_with_http_info(user_service_remove_totp_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_totp_serialize( + async def remove_totp_with_http_info( self, - user_service_remove_totp_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_totp_request is not None: - _body_params = user_service_remove_totp_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveTOTP', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_totp_request: UserServiceRemoveTOTPRequest, + ) -> "ApiResult[UserServiceRemoveTOTPResponse]": + """Remove TOTP generator from a user (with HTTP info) + Remove the configured TOTP generator of a user. As only one TOTP generator per user is allowed, the user will not have TOTP as a second factor afterward. + :param user_service_remove_totp_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_totp_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_totp_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveTOTP" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_totp_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveTOTPResponse", + None, + ) - @validate_call - def remove_u2_f( self, user_service_remove_u2_f_request: UserServiceRemoveU2FRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRemoveU2FResponse: + async def remove_u2_f( + self, + user_service_remove_u2_f_request: UserServiceRemoveU2FRequest, + ) -> UserServiceRemoveU2FResponse: """Remove u2f token from a user - Remove u2f token from a user. + :param user_service_remove_u2_f_request: (required) + + :return: UserServiceRemoveU2FResponse + :raises ApiException: if fails to make API call + """ + if user_service_remove_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_u2_f_request'" + ) - :param user_service_remove_u2_f_request: (required) - :type user_service_remove_u2_f_request: UserServiceRemoveU2FRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._remove_u2_f_serialize( - user_service_remove_u2_f_request=user_service_remove_u2_f_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRemoveU2FResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.remove_u2_f_with_http_info(user_service_remove_u2_f_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _remove_u2_f_serialize( + async def remove_u2_f_with_http_info( self, - user_service_remove_u2_f_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_remove_u2_f_request is not None: - _body_params = user_service_remove_u2_f_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RemoveU2F', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_remove_u2_f_request: UserServiceRemoveU2FRequest, + ) -> "ApiResult[UserServiceRemoveU2FResponse]": + """Remove u2f token from a user (with HTTP info) + Remove u2f token from a user. + :param user_service_remove_u2_f_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_remove_u2_f_request is None: + raise ValueError( + "Missing the required parameter 'user_service_remove_u2_f_request'" + ) + path = "/zitadel.user.v2.UserService/RemoveU2F" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_remove_u2_f_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRemoveU2FResponse", + None, + ) - @validate_call - def resend_email_code( self, user_service_resend_email_code_request: Optional[UserServiceResendEmailCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceResendEmailCodeResponse: - if user_service_resend_email_code_request is None: - user_service_resend_email_code_request = {} + async def resend_email_code( + self, + user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, + ) -> UserServiceResendEmailCodeResponse: """Resend code to verify user email - Resend code to verify user email + :param user_service_resend_email_code_request: (required) - :param user_service_resend_email_code_request: (required) - :type user_service_resend_email_code_request: UserServiceResendEmailCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._resend_email_code_serialize( - user_service_resend_email_code_request=user_service_resend_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceResendEmailCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_resend_email_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_email_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendEmailCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.resend_email_code_with_http_info( + user_service_resend_email_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _resend_email_code_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def resend_email_code_with_http_info( self, - user_service_resend_email_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_resend_email_code_request is not None: - _body_params = user_service_resend_email_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ResendEmailCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_resend_email_code_request: UserServiceResendEmailCodeRequest, + ) -> "ApiResult[UserServiceResendEmailCodeResponse]": + """Resend code to verify user email (with HTTP info) + Resend code to verify user email + :param user_service_resend_email_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_resend_email_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_email_code_request'" + ) + path = "/zitadel.user.v2.UserService/ResendEmailCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_resend_email_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceResendEmailCodeResponse", + None, + ) - @validate_call - def resend_invite_code( self, user_service_resend_invite_code_request: UserServiceResendInviteCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceResendInviteCodeResponse: + async def resend_invite_code( + self, + user_service_resend_invite_code_request: UserServiceResendInviteCodeRequest, + ) -> UserServiceResendInviteCodeResponse: """Resend an invite code for a user - Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. + :param user_service_resend_invite_code_request: (required) + + :return: UserServiceResendInviteCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_resend_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_invite_code_request'" + ) - :param user_service_resend_invite_code_request: (required) - :type user_service_resend_invite_code_request: UserServiceResendInviteCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._resend_invite_code_serialize( - user_service_resend_invite_code_request=user_service_resend_invite_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.resend_invite_code_with_http_info( + user_service_resend_invite_code_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendInviteCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _resend_invite_code_serialize( + async def resend_invite_code_with_http_info( self, - user_service_resend_invite_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_resend_invite_code_request is not None: - _body_params = user_service_resend_invite_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ResendInviteCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_resend_invite_code_request: UserServiceResendInviteCodeRequest, + ) -> "ApiResult[UserServiceResendInviteCodeResponse]": + """Resend an invite code for a user (with HTTP info) + Deprecated: Use [CreateInviteCode](apis/resources/user_service_v2/user-service-create-invite-code.api.mdx) instead. Resend an invite code for a user to initialize their first authentication method (password, passkeys, IdP) depending on the organization's available methods. A resend is only possible if a code has been created previously and sent to the user. If there is no code or it was directly returned, an error will be returned. + :param user_service_resend_invite_code_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_resend_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_invite_code_request'" + ) + path = "/zitadel.user.v2.UserService/ResendInviteCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_resend_invite_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceResendInviteCodeResponse", + None, + ) - @validate_call - def resend_phone_code( self, user_service_resend_phone_code_request: Optional[UserServiceResendPhoneCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceResendPhoneCodeResponse: - if user_service_resend_phone_code_request is None: - user_service_resend_phone_code_request = {} + async def resend_phone_code( + self, + user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, + ) -> UserServiceResendPhoneCodeResponse: """Resend code to verify user phone number - Resend code to verify user phone number. + :param user_service_resend_phone_code_request: (required) - :param user_service_resend_phone_code_request: (required) - :type user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._resend_phone_code_serialize( - user_service_resend_phone_code_request=user_service_resend_phone_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceResendPhoneCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_resend_phone_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_phone_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceResendPhoneCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.resend_phone_code_with_http_info( + user_service_resend_phone_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _resend_phone_code_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def resend_phone_code_with_http_info( self, - user_service_resend_phone_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_resend_phone_code_request is not None: - _body_params = user_service_resend_phone_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/ResendPhoneCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_resend_phone_code_request: UserServiceResendPhoneCodeRequest, + ) -> "ApiResult[UserServiceResendPhoneCodeResponse]": + """Resend code to verify user phone number (with HTTP info) + Resend code to verify user phone number. + :param user_service_resend_phone_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_resend_phone_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_resend_phone_code_request'" + ) + path = "/zitadel.user.v2.UserService/ResendPhoneCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_resend_phone_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceResendPhoneCodeResponse", + None, + ) - @validate_call - def retrieve_identity_provider_intent( self, user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceRetrieveIdentityProviderIntentResponse: + async def retrieve_identity_provider_intent( + self, + user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, + ) -> UserServiceRetrieveIdentityProviderIntentResponse: """Retrieve the information returned by the identity provider - Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. + :param user_service_retrieve_identity_provider_intent_request: (required) + + :return: UserServiceRetrieveIdentityProviderIntentResponse + :raises ApiException: if fails to make API call + """ + if user_service_retrieve_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request'" + ) - :param user_service_retrieve_identity_provider_intent_request: (required) - :type user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._retrieve_identity_provider_intent_serialize( - user_service_retrieve_identity_provider_intent_request=user_service_retrieve_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.retrieve_identity_provider_intent_with_http_info( + user_service_retrieve_identity_provider_intent_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceRetrieveIdentityProviderIntentResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _retrieve_identity_provider_intent_serialize( + async def retrieve_identity_provider_intent_with_http_info( self, - user_service_retrieve_identity_provider_intent_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_retrieve_identity_provider_intent_request is not None: - _body_params = user_service_retrieve_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/RetrieveIdentityProviderIntent', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_retrieve_identity_provider_intent_request: UserServiceRetrieveIdentityProviderIntentRequest, + ) -> "ApiResult[UserServiceRetrieveIdentityProviderIntentResponse]": + """Retrieve the information returned by the identity provider (with HTTP info) + Retrieve the information returned by the identity provider for registration or updating an existing user with new information.. + :param user_service_retrieve_identity_provider_intent_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_retrieve_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'user_service_retrieve_identity_provider_intent_request'" + ) + path = "/zitadel.user.v2.UserService/RetrieveIdentityProviderIntent" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_retrieve_identity_provider_intent_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceRetrieveIdentityProviderIntentResponse", + None, + ) - @validate_call - def send_email_code( self, user_service_send_email_code_request: Optional[UserServiceSendEmailCodeRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceSendEmailCodeResponse: - if user_service_send_email_code_request is None: - user_service_send_email_code_request = {} + async def send_email_code( + self, + user_service_send_email_code_request: UserServiceSendEmailCodeRequest, + ) -> UserServiceSendEmailCodeResponse: """Send code to verify user email - Send code to verify user email + :param user_service_send_email_code_request: (required) - :param user_service_send_email_code_request: (required) - :type user_service_send_email_code_request: UserServiceSendEmailCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._send_email_code_serialize( - user_service_send_email_code_request=user_service_send_email_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceSendEmailCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_send_email_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_send_email_code_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSendEmailCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.send_email_code_with_http_info( + user_service_send_email_code_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _send_email_code_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def send_email_code_with_http_info( self, - user_service_send_email_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_send_email_code_request is not None: - _body_params = user_service_send_email_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/SendEmailCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_send_email_code_request: UserServiceSendEmailCodeRequest, + ) -> "ApiResult[UserServiceSendEmailCodeResponse]": + """Send code to verify user email (with HTTP info) + Send code to verify user email + :param user_service_send_email_code_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_send_email_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_send_email_code_request'" + ) + path = "/zitadel.user.v2.UserService/SendEmailCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_send_email_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceSendEmailCodeResponse", + None, + ) - @validate_call - def set_email( self, user_service_set_email_request: Optional[UserServiceSetEmailRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceSetEmailResponse: - if user_service_set_email_request is None: - user_service_set_email_request = {} + async def set_email( + self, + user_service_set_email_request: UserServiceSetEmailRequest, + ) -> UserServiceSetEmailResponse: """Change the user email - Deprecated: [Update the users email field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. + :param user_service_set_email_request: (required) - :param user_service_set_email_request: (required) - :type user_service_set_email_request: UserServiceSetEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_email_serialize( - user_service_set_email_request=user_service_set_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceSetEmailResponse + :raises ApiException: if fails to make API call + """ + if user_service_set_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_email_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.set_email_with_http_info(user_service_set_email_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_email_serialize( + async def set_email_with_http_info( self, - user_service_set_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_email_request is not None: - _body_params = user_service_set_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/SetEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_set_email_request: UserServiceSetEmailRequest, + ) -> "ApiResult[UserServiceSetEmailResponse]": + """Change the user email (with HTTP info) + Deprecated: [Update the users email field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Change the email address of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by email.. + :param user_service_set_email_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_set_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_email_request'" + ) + path = "/zitadel.user.v2.UserService/SetEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_set_email_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceSetEmailResponse", + None, + ) - @validate_call - def set_password( self, user_service_set_password_request: Optional[UserServiceSetPasswordRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceSetPasswordResponse: - if user_service_set_password_request is None: - user_service_set_password_request = {} + async def set_password( + self, + user_service_set_password_request: UserServiceSetPasswordRequest, + ) -> UserServiceSetPasswordResponse: """Change password - Deprecated: [Update the users password](apis/resources/user_service_v2/user-service-update-user.api.mdx) instead. Change the password of a user with either a verification code or the current password.. + :param user_service_set_password_request: (required) - :param user_service_set_password_request: (required) - :type user_service_set_password_request: UserServiceSetPasswordRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_password_serialize( - user_service_set_password_request=user_service_set_password_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceSetPasswordResponse + :raises ApiException: if fails to make API call + """ + if user_service_set_password_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_password_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPasswordResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.set_password_with_http_info( + user_service_set_password_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _set_password_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def set_password_with_http_info( self, - user_service_set_password_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_password_request is not None: - _body_params = user_service_set_password_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/SetPassword', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_set_password_request: UserServiceSetPasswordRequest, + ) -> "ApiResult[UserServiceSetPasswordResponse]": + """Change password (with HTTP info) + Deprecated: [Update the users password](apis/resources/user_service_v2/user-service-update-user.api.mdx) instead. Change the password of a user with either a verification code or the current password.. + :param user_service_set_password_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_set_password_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_password_request'" + ) + path = "/zitadel.user.v2.UserService/SetPassword" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_set_password_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceSetPasswordResponse", + None, + ) - @validate_call - def set_phone( self, user_service_set_phone_request: Optional[UserServiceSetPhoneRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceSetPhoneResponse: - if user_service_set_phone_request is None: - user_service_set_phone_request = {} + async def set_phone( + self, + user_service_set_phone_request: UserServiceSetPhoneRequest, + ) -> UserServiceSetPhoneResponse: """Set the user phone - Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. + :param user_service_set_phone_request: (required) - :param user_service_set_phone_request: (required) - :type user_service_set_phone_request: UserServiceSetPhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_phone_serialize( - user_service_set_phone_request=user_service_set_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceSetPhoneResponse + :raises ApiException: if fails to make API call + """ + if user_service_set_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_phone_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetPhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.set_phone_with_http_info(user_service_set_phone_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_phone_serialize( + async def set_phone_with_http_info( self, - user_service_set_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_phone_request is not None: - _body_params = user_service_set_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/SetPhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_set_phone_request: UserServiceSetPhoneRequest, + ) -> "ApiResult[UserServiceSetPhoneResponse]": + """Set the user phone (with HTTP info) + Deprecated: [Update the users phone field](apis/resources/user_service_v2/user-service-update-user.api.mdx). Set the phone number of a user. If the state is set to not verified, a verification code will be generated, which can be either returned or sent to the user by sms.. + :param user_service_set_phone_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_set_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_phone_request'" + ) + path = "/zitadel.user.v2.UserService/SetPhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_set_phone_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceSetPhoneResponse", + None, + ) - @validate_call - def set_user_metadata( self, user_service_set_user_metadata_request: UserServiceSetUserMetadataRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceSetUserMetadataResponse: + async def set_user_metadata( + self, + user_service_set_user_metadata_request: UserServiceSetUserMetadataRequest, + ) -> UserServiceSetUserMetadataResponse: """Set User Metadata - Sets a list of key value pairs. Existing metadata entries with matching keys are overwritten. Existing metadata entries without matching keys are untouched. To remove metadata entries, use [DeleteUserMetadata](apis/resources/user_service_v2/user-service-delete-user-metadata.api.mdx). For HTTP requests, make sure the bytes array value is base64 encoded. Required permission: - `user.write` + :param user_service_set_user_metadata_request: (required) + + :return: UserServiceSetUserMetadataResponse + :raises ApiException: if fails to make API call + """ + if user_service_set_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_user_metadata_request'" + ) - :param user_service_set_user_metadata_request: (required) - :type user_service_set_user_metadata_request: UserServiceSetUserMetadataRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._set_user_metadata_serialize( - user_service_set_user_metadata_request=user_service_set_user_metadata_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.set_user_metadata_with_http_info( + user_service_set_user_metadata_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceSetUserMetadataResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _set_user_metadata_serialize( + async def set_user_metadata_with_http_info( self, - user_service_set_user_metadata_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_set_user_metadata_request is not None: - _body_params = user_service_set_user_metadata_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/SetUserMetadata', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_set_user_metadata_request: UserServiceSetUserMetadataRequest, + ) -> "ApiResult[UserServiceSetUserMetadataResponse]": + """Set User Metadata (with HTTP info) + Sets a list of key value pairs. Existing metadata entries with matching keys are overwritten. Existing metadata entries without matching keys are untouched. To remove metadata entries, use [DeleteUserMetadata](apis/resources/user_service_v2/user-service-delete-user-metadata.api.mdx). For HTTP requests, make sure the bytes array value is base64 encoded. Required permission: - `user.write` + :param user_service_set_user_metadata_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_set_user_metadata_request is None: + raise ValueError( + "Missing the required parameter 'user_service_set_user_metadata_request'" + ) + path = "/zitadel.user.v2.UserService/SetUserMetadata" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_set_user_metadata_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceSetUserMetadataResponse", + None, + ) - @validate_call - def start_identity_provider_intent( self, user_service_start_identity_provider_intent_request: Optional[UserServiceStartIdentityProviderIntentRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceStartIdentityProviderIntentResponse: - if user_service_start_identity_provider_intent_request is None: - user_service_start_identity_provider_intent_request = {} + async def start_identity_provider_intent( + self, + user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, + ) -> UserServiceStartIdentityProviderIntentResponse: """Start flow with an identity provider - Start a flow with an identity provider, for external login, registration or linking.. + :param user_service_start_identity_provider_intent_request: (required) - :param user_service_start_identity_provider_intent_request: (required) - :type user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_identity_provider_intent_serialize( - user_service_start_identity_provider_intent_request=user_service_start_identity_provider_intent_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceStartIdentityProviderIntentResponse + :raises ApiException: if fails to make API call + """ + if user_service_start_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'user_service_start_identity_provider_intent_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceStartIdentityProviderIntentResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout + result = await self.start_identity_provider_intent_with_http_info( + user_service_start_identity_provider_intent_request ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - def _start_identity_provider_intent_serialize( + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data + + async def start_identity_provider_intent_with_http_info( self, - user_service_start_identity_provider_intent_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_start_identity_provider_intent_request is not None: - _body_params = user_service_start_identity_provider_intent_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/StartIdentityProviderIntent', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_start_identity_provider_intent_request: UserServiceStartIdentityProviderIntentRequest, + ) -> "ApiResult[UserServiceStartIdentityProviderIntentResponse]": + """Start flow with an identity provider (with HTTP info) + Start a flow with an identity provider, for external login, registration or linking.. + :param user_service_start_identity_provider_intent_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_start_identity_provider_intent_request is None: + raise ValueError( + "Missing the required parameter 'user_service_start_identity_provider_intent_request'" + ) + path = "/zitadel.user.v2.UserService/StartIdentityProviderIntent" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_start_identity_provider_intent_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceStartIdentityProviderIntentResponse", + None, + ) - @validate_call - def unlock_user( self, user_service_unlock_user_request: UserServiceUnlockUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceUnlockUserResponse: + async def unlock_user( + self, + user_service_unlock_user_request: UserServiceUnlockUserRequest, + ) -> UserServiceUnlockUserResponse: """Unlock user - The state of the user will be changed to 'active'. The user will be able to log in again. The endpoint returns an error if the user is not in the state 'locked'. + :param user_service_unlock_user_request: (required) + + :return: UserServiceUnlockUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_unlock_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_unlock_user_request'" + ) - :param user_service_unlock_user_request: (required) - :type user_service_unlock_user_request: UserServiceUnlockUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unlock_user_serialize( - user_service_unlock_user_request=user_service_unlock_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUnlockUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.unlock_user_with_http_info(user_service_unlock_user_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _unlock_user_serialize( + async def unlock_user_with_http_info( self, - user_service_unlock_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_unlock_user_request is not None: - _body_params = user_service_unlock_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/UnlockUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_unlock_user_request: UserServiceUnlockUserRequest, + ) -> "ApiResult[UserServiceUnlockUserResponse]": + """Unlock user (with HTTP info) + The state of the user will be changed to 'active'. The user will be able to log in again. The endpoint returns an error if the user is not in the state 'locked'. + :param user_service_unlock_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_unlock_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_unlock_user_request'" + ) + path = "/zitadel.user.v2.UserService/UnlockUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_unlock_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceUnlockUserResponse", + None, + ) - @validate_call - def update_human_user( self, user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceUpdateHumanUserResponse: + async def update_human_user( + self, + user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, + ) -> UserServiceUpdateHumanUserResponse: """Update Human User - Deprecated: Use [UpdateUser](apis/resources/user_service_v2/user-service-update-user.api.mdx) to update a user of type human instead. Update all information from a user. + :param user_service_update_human_user_request: (required) + + :return: UserServiceUpdateHumanUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_update_human_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_update_human_user_request'" + ) - :param user_service_update_human_user_request: (required) - :type user_service_update_human_user_request: UserServiceUpdateHumanUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_human_user_serialize( - user_service_update_human_user_request=user_service_update_human_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.update_human_user_with_http_info( + user_service_update_human_user_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUpdateHumanUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_human_user_serialize( + async def update_human_user_with_http_info( self, - user_service_update_human_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_update_human_user_request is not None: - _body_params = user_service_update_human_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/UpdateHumanUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_update_human_user_request: UserServiceUpdateHumanUserRequest, + ) -> "ApiResult[UserServiceUpdateHumanUserResponse]": + """Update Human User (with HTTP info) + Deprecated: Use [UpdateUser](apis/resources/user_service_v2/user-service-update-user.api.mdx) to update a user of type human instead. Update all information from a user. + :param user_service_update_human_user_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_update_human_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_update_human_user_request'" + ) + path = "/zitadel.user.v2.UserService/UpdateHumanUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_update_human_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceUpdateHumanUserResponse", + None, + ) - @validate_call - def update_user( self, user_service_update_user_request: Optional[UserServiceUpdateUserRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceUpdateUserResponse: - if user_service_update_user_request is None: - user_service_update_user_request = {} + async def update_user( + self, + user_service_update_user_request: UserServiceUpdateUserRequest, + ) -> UserServiceUpdateUserResponse: """Update a User - Partially update an existing user. If you change the users email or phone, you can specify how the ownership should be verified. If you change the users password, you can specify if the password should be changed again on the users next login. Required permission: - user.write + :param user_service_update_user_request: (required) - :param user_service_update_user_request: (required) - :type user_service_update_user_request: UserServiceUpdateUserRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_user_serialize( - user_service_update_user_request=user_service_update_user_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) + :return: UserServiceUpdateUserResponse + :raises ApiException: if fails to make API call + """ + if user_service_update_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_update_user_request'" + ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceUpdateUserResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + result = await self.update_user_with_http_info(user_service_update_user_request) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _update_user_serialize( + async def update_user_with_http_info( self, - user_service_update_user_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_update_user_request is not None: - _body_params = user_service_update_user_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/UpdateUser', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) + user_service_update_user_request: UserServiceUpdateUserRequest, + ) -> "ApiResult[UserServiceUpdateUserResponse]": + """Update a User (with HTTP info) + Partially update an existing user. If you change the users email or phone, you can specify how the ownership should be verified. If you change the users password, you can specify if the password should be changed again on the users next login. Required permission: - user.write + :param user_service_update_user_request: (required) + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_update_user_request is None: + raise ValueError( + "Missing the required parameter 'user_service_update_user_request'" + ) + path = "/zitadel.user.v2.UserService/UpdateUser" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_update_user_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceUpdateUserResponse", + None, + ) - @validate_call - def verify_email( self, user_service_verify_email_request: UserServiceVerifyEmailRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyEmailResponse: + async def verify_email( + self, + user_service_verify_email_request: UserServiceVerifyEmailRequest, + ) -> UserServiceVerifyEmailResponse: """Verify the email - Verify the email with the generated code. + :param user_service_verify_email_request: (required) + + :return: UserServiceVerifyEmailResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_email_request'" + ) - :param user_service_verify_email_request: (required) - :type user_service_verify_email_request: UserServiceVerifyEmailRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_email_serialize( - user_service_verify_email_request=user_service_verify_email_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_email_with_http_info( + user_service_verify_email_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyEmailResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_email_serialize( + async def verify_email_with_http_info( self, - user_service_verify_email_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_email_request is not None: - _body_params = user_service_verify_email_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyEmail', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_email_request: UserServiceVerifyEmailRequest, + ) -> "ApiResult[UserServiceVerifyEmailResponse]": + """Verify the email (with HTTP info) + Verify the email with the generated code. + :param user_service_verify_email_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_email_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_email_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyEmail" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_email_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyEmailResponse", + None, + ) - @validate_call - def verify_invite_code( self, user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyInviteCodeResponse: + async def verify_invite_code( + self, + user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, + ) -> UserServiceVerifyInviteCodeResponse: """Verify an invite code for a user - Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + :param user_service_verify_invite_code_request: (required) + + :return: UserServiceVerifyInviteCodeResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_invite_code_request'" + ) - :param user_service_verify_invite_code_request: (required) - :type user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_invite_code_serialize( - user_service_verify_invite_code_request=user_service_verify_invite_code_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_invite_code_with_http_info( + user_service_verify_invite_code_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyInviteCodeResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_invite_code_serialize( + async def verify_invite_code_with_http_info( self, - user_service_verify_invite_code_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_invite_code_request is not None: - _body_params = user_service_verify_invite_code_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyInviteCode', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_invite_code_request: UserServiceVerifyInviteCodeRequest, + ) -> "ApiResult[UserServiceVerifyInviteCodeResponse]": + """Verify an invite code for a user (with HTTP info) + Verify the invite code of a user previously issued. This will set their email to a verified state and allow the user to set up their first authentication method (password, passkeys, IdP) depending on the organization's available methods. + :param user_service_verify_invite_code_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_invite_code_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_invite_code_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyInviteCode" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_invite_code_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyInviteCodeResponse", + None, + ) - @validate_call - def verify_passkey_registration( self, user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyPasskeyRegistrationResponse: + async def verify_passkey_registration( + self, + user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, + ) -> UserServiceVerifyPasskeyRegistrationResponse: """Verify a passkey for a user - Verify the passkey registration with the public key credential.. + :param user_service_verify_passkey_registration_request: (required) + + :return: UserServiceVerifyPasskeyRegistrationResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_passkey_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_passkey_registration_request'" + ) - :param user_service_verify_passkey_registration_request: (required) - :type user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_passkey_registration_serialize( - user_service_verify_passkey_registration_request=user_service_verify_passkey_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_passkey_registration_with_http_info( + user_service_verify_passkey_registration_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPasskeyRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_passkey_registration_serialize( + async def verify_passkey_registration_with_http_info( self, - user_service_verify_passkey_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_passkey_registration_request is not None: - _body_params = user_service_verify_passkey_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyPasskeyRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_passkey_registration_request: UserServiceVerifyPasskeyRegistrationRequest, + ) -> "ApiResult[UserServiceVerifyPasskeyRegistrationResponse]": + """Verify a passkey for a user (with HTTP info) + Verify the passkey registration with the public key credential.. + :param user_service_verify_passkey_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_passkey_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_passkey_registration_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyPasskeyRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_passkey_registration_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyPasskeyRegistrationResponse", + None, + ) - @validate_call - def verify_phone( self, user_service_verify_phone_request: UserServiceVerifyPhoneRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyPhoneResponse: + async def verify_phone( + self, + user_service_verify_phone_request: UserServiceVerifyPhoneRequest, + ) -> UserServiceVerifyPhoneResponse: """Verify the phone number - Verify the phone number with the generated code. + :param user_service_verify_phone_request: (required) + + :return: UserServiceVerifyPhoneResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_phone_request'" + ) - :param user_service_verify_phone_request: (required) - :type user_service_verify_phone_request: UserServiceVerifyPhoneRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_phone_serialize( - user_service_verify_phone_request=user_service_verify_phone_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_phone_with_http_info( + user_service_verify_phone_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyPhoneResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_phone_serialize( + async def verify_phone_with_http_info( self, - user_service_verify_phone_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_phone_request is not None: - _body_params = user_service_verify_phone_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyPhone', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_phone_request: UserServiceVerifyPhoneRequest, + ) -> "ApiResult[UserServiceVerifyPhoneResponse]": + """Verify the phone number (with HTTP info) + Verify the phone number with the generated code. + :param user_service_verify_phone_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_phone_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_phone_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyPhone" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_phone_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyPhoneResponse", + None, + ) - @validate_call - def verify_totp_registration( self, user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyTOTPRegistrationResponse: + async def verify_totp_registration( + self, + user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, + ) -> UserServiceVerifyTOTPRegistrationResponse: """Verify a TOTP generator for a user - Verify the TOTP registration with a generated code.. + :param user_service_verify_totp_registration_request: (required) + + :return: UserServiceVerifyTOTPRegistrationResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_totp_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_totp_registration_request'" + ) - :param user_service_verify_totp_registration_request: (required) - :type user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_totp_registration_serialize( - user_service_verify_totp_registration_request=user_service_verify_totp_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_totp_registration_with_http_info( + user_service_verify_totp_registration_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyTOTPRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_totp_registration_serialize( + async def verify_totp_registration_with_http_info( self, - user_service_verify_totp_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_totp_registration_request is not None: - _body_params = user_service_verify_totp_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyTOTPRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_totp_registration_request: UserServiceVerifyTOTPRegistrationRequest, + ) -> "ApiResult[UserServiceVerifyTOTPRegistrationResponse]": + """Verify a TOTP generator for a user (with HTTP info) + Verify the TOTP registration with a generated code.. + :param user_service_verify_totp_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_totp_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_totp_registration_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyTOTPRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_totp_registration_request + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyTOTPRegistrationResponse", + None, + ) - @validate_call - def verify_u2_f_registration( self, user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> UserServiceVerifyU2FRegistrationResponse: + async def verify_u2_f_registration( + self, + user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest, + ) -> UserServiceVerifyU2FRegistrationResponse: """Verify a u2f token for a user - Verify the u2f token registration with the public key credential.. + :param user_service_verify_u2_f_registration_request: (required) + + :return: UserServiceVerifyU2FRegistrationResponse + :raises ApiException: if fails to make API call + """ + if user_service_verify_u2_f_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_u2_f_registration_request'" + ) - :param user_service_verify_u2_f_registration_request: (required) - :type user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._verify_u2_f_registration_serialize( - user_service_verify_u2_f_registration_request=user_service_verify_u2_f_registration_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.verify_u2_f_registration_with_http_info( + user_service_verify_u2_f_registration_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "UserServiceVerifyU2FRegistrationResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _verify_u2_f_registration_serialize( + async def verify_u2_f_registration_with_http_info( self, - user_service_verify_u2_f_registration_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if user_service_verify_u2_f_registration_request is not None: - _body_params = user_service_verify_u2_f_registration_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.user.v2.UserService/VerifyU2FRegistration', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - + user_service_verify_u2_f_registration_request: UserServiceVerifyU2FRegistrationRequest, + ) -> "ApiResult[UserServiceVerifyU2FRegistrationResponse]": + """Verify a u2f token for a user (with HTTP info) + Verify the u2f token registration with the public key credential.. + :param user_service_verify_u2_f_registration_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if user_service_verify_u2_f_registration_request is None: + raise ValueError( + "Missing the required parameter 'user_service_verify_u2_f_registration_request'" + ) + path = "/zitadel.user.v2.UserService/VerifyU2FRegistration" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = user_service_verify_u2_f_registration_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "UserServiceVerifyU2FRegistrationResponse", + None, + ) diff --git a/zitadel_client/api/web_key_service_api.py b/zitadel_client/api/web_key_service_api.py index d9efd396..ff4cc4f0 100644 --- a/zitadel_client/api/web_key_service_api.py +++ b/zitadel_client/api/web_key_service_api.py @@ -1,557 +1,309 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from typing import Any, Dict -from zitadel_client.models.web_key_service_activate_web_key_request import WebKeyServiceActivateWebKeyRequest -from zitadel_client.models.web_key_service_activate_web_key_response import WebKeyServiceActivateWebKeyResponse -from zitadel_client.models.web_key_service_create_web_key_request import WebKeyServiceCreateWebKeyRequest -from zitadel_client.models.web_key_service_create_web_key_response import WebKeyServiceCreateWebKeyResponse -from zitadel_client.models.web_key_service_delete_web_key_request import WebKeyServiceDeleteWebKeyRequest -from zitadel_client.models.web_key_service_delete_web_key_response import WebKeyServiceDeleteWebKeyResponse -from zitadel_client.models.web_key_service_list_web_keys_response import WebKeyServiceListWebKeysResponse - -from zitadel_client.api_client import ApiClient, RequestSerialized -from zitadel_client.api_response import ApiResponse -from zitadel_client.rest import RESTResponseType - - -class WebKeyServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from __future__ import annotations + +from typing import Any, Dict, Optional + +from zitadel_client.models.web_key_service_activate_web_key_request import ( + WebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.web_key_service_activate_web_key_response import ( + WebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.web_key_service_create_web_key_request import ( + WebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.web_key_service_create_web_key_response import ( + WebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.web_key_service_delete_web_key_request import ( + WebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.web_key_service_delete_web_key_response import ( + WebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.web_key_service_list_web_keys_response import ( + WebKeyServiceListWebKeysResponse, +) + +from ..api_client import ApiClient +from ..api_result import ApiResult +from ..configuration import Configuration +from .base_api import BaseApi +from ..auth.authenticator import Authenticator +from ..errors import ApiException + + +class WebKeyServiceApi(BaseApi): + """WebKeyServiceApi provides methods for the WebKeyService API group.""" + + def __init__( + self, + api_client: Optional[ApiClient] = None, + config: Optional[Configuration] = None, + authenticator: Optional[Authenticator] = None, + ): + super().__init__(api_client, config, authenticator) - @validate_call - def activate_web_key( self, web_key_service_activate_web_key_request: WebKeyServiceActivateWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceActivateWebKeyResponse: + async def activate_web_key( + self, + web_key_service_activate_web_key_request: WebKeyServiceActivateWebKeyRequest, + ) -> WebKeyServiceActivateWebKeyResponse: """Activate Web Key - Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + :param web_key_service_activate_web_key_request: (required) + + :return: WebKeyServiceActivateWebKeyResponse + :raises ApiException: if fails to make API call + """ + if web_key_service_activate_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_activate_web_key_request'" + ) - :param web_key_service_activate_web_key_request: (required) - :type web_key_service_activate_web_key_request: WebKeyServiceActivateWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._activate_web_key_serialize( - web_key_service_activate_web_key_request=web_key_service_activate_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.activate_web_key_with_http_info( + web_key_service_activate_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceActivateWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _activate_web_key_serialize( + async def activate_web_key_with_http_info( self, - web_key_service_activate_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if web_key_service_activate_web_key_request is not None: - _body_params = web_key_service_activate_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + web_key_service_activate_web_key_request: WebKeyServiceActivateWebKeyRequest, + ) -> "ApiResult[WebKeyServiceActivateWebKeyResponse]": + """Activate Web Key (with HTTP info) + Switch the active signing web key. The previously active key will be deactivated. Note that the JWKs OIDC endpoint returns a cacheable response. Therefore it is not advised to activate a key that has been created within the cache duration (default is 5min), as the public key may not have been propagated to caches and clients yet. Required permission: - `iam.web_key.write` + :param web_key_service_activate_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if web_key_service_activate_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_activate_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2.WebKeyService/ActivateWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2.WebKeyService/ActivateWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = web_key_service_activate_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "WebKeyServiceActivateWebKeyResponse", + None, ) - - - - @validate_call - def create_web_key( self, web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceCreateWebKeyResponse: + async def create_web_key( + self, + web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest, + ) -> WebKeyServiceCreateWebKeyResponse: """Create Web Key - Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + :param web_key_service_create_web_key_request: (required) + + :return: WebKeyServiceCreateWebKeyResponse + :raises ApiException: if fails to make API call + """ + if web_key_service_create_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_create_web_key_request'" + ) - :param web_key_service_create_web_key_request: (required) - :type web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_web_key_serialize( - web_key_service_create_web_key_request=web_key_service_create_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.create_web_key_with_http_info( + web_key_service_create_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceCreateWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _create_web_key_serialize( + async def create_web_key_with_http_info( self, - web_key_service_create_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if web_key_service_create_web_key_request is not None: - _body_params = web_key_service_create_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + web_key_service_create_web_key_request: WebKeyServiceCreateWebKeyRequest, + ) -> "ApiResult[WebKeyServiceCreateWebKeyResponse]": + """Create Web Key (with HTTP info) + Generate a private and public key pair. The private key can be used to sign OIDC tokens after activation. The public key can be used to validate OIDC tokens. The newly created key will have the state `STATE_INITIAL` and is published to the public key endpoint. Note that the JWKs OIDC endpoint returns a cacheable response. If no key type is provided, a RSA key pair with 2048 bits and SHA256 hashing will be created. Required permission: - `iam.web_key.write` + :param web_key_service_create_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if web_key_service_create_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_create_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2.WebKeyService/CreateWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2.WebKeyService/CreateWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = web_key_service_create_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "WebKeyServiceCreateWebKeyResponse", + None, ) - - - - @validate_call - def delete_web_key( self, web_key_service_delete_web_key_request: WebKeyServiceDeleteWebKeyRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceDeleteWebKeyResponse: + async def delete_web_key( + self, + web_key_service_delete_web_key_request: WebKeyServiceDeleteWebKeyRequest, + ) -> WebKeyServiceDeleteWebKeyResponse: """Delete Web Key - Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + :param web_key_service_delete_web_key_request: (required) + + :return: WebKeyServiceDeleteWebKeyResponse + :raises ApiException: if fails to make API call + """ + if web_key_service_delete_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_delete_web_key_request'" + ) - :param web_key_service_delete_web_key_request: (required) - :type web_key_service_delete_web_key_request: WebKeyServiceDeleteWebKeyRequest - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_web_key_serialize( - web_key_service_delete_web_key_request=web_key_service_delete_web_key_request, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index + result = await self.delete_web_key_with_http_info( + web_key_service_delete_web_key_request ) - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceDeleteWebKeyResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _delete_web_key_serialize( + async def delete_web_key_with_http_info( self, - web_key_service_delete_web_key_request, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if web_key_service_delete_web_key_request is not None: - _body_params = web_key_service_delete_web_key_request - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] + web_key_service_delete_web_key_request: WebKeyServiceDeleteWebKeyRequest, + ) -> "ApiResult[WebKeyServiceDeleteWebKeyResponse]": + """Delete Web Key (with HTTP info) + Delete a web key pair. Only inactive keys can be deleted. Once a key is deleted, any tokens signed by this key will be invalid. Note that the JWKs OIDC endpoint returns a cacheable response. In case the web key is not found, the request will return a successful response as the desired state is already achieved. You can check the change date in the response to verify if the web key was deleted during the request. Required permission: - `iam.web_key.delete` + :param web_key_service_delete_web_key_request: (required) + + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if web_key_service_delete_web_key_request is None: + raise ValueError( + "Missing the required parameter 'web_key_service_delete_web_key_request'" ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2.WebKeyService/DeleteWebKey', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + path = "/zitadel.webkey.v2.WebKeyService/DeleteWebKey" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = web_key_service_delete_web_key_request + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "WebKeyServiceDeleteWebKeyResponse", + None, ) - - - - @validate_call - def list_web_keys( self, body: Optional[Dict[str, Any]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], Tuple[ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] ] ] = None, _request_auth: Optional[Dict[StrictStr, Any]] = None, _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> WebKeyServiceListWebKeysResponse: - if body is None: - body = {} + async def list_web_keys( + self, + body: object, + ) -> WebKeyServiceListWebKeysResponse: """List Web Keys - List all web keys and their states. Required permission: - `iam.web_key.read` + :param body: (required) - :param body: (required) - :type body: object - :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. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_web_keys_serialize( - body=body, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "WebKeyServiceListWebKeysResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data + :return: WebKeyServiceListWebKeysResponse + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + result = await self.list_web_keys_with_http_info(body) + + if result.data is None: + # This operation declares a non-void return type, so an empty / + # undecodable response body is a contract violation. Raise the + # SDK's typed ApiException (rather than an assert that vanishes + # under -O, or a silent None) so callers get one catchable error. + raise ApiException( + status_code=result.status_code, + message="Expected a response body but the server returned none", + response_body=result.raw_body, + response_headers=result.headers, + ) + return result.data - def _list_web_keys_serialize( + async def list_web_keys_with_http_info( self, - body, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[ - str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] - ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if body is not None: - _body_params = body - - - # set the HTTP header `Accept` - if 'Accept' not in _header_params: - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + body: object, + ) -> "ApiResult[WebKeyServiceListWebKeysResponse]": + """List Web Keys (with HTTP info) + List all web keys and their states. Required permission: - `iam.web_key.read` + :param body: (required) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - 'zitadelAccessToken' - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/zitadel.webkey.v2.WebKeyService/ListWebKeys', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth + :return: ApiResult containing the response data, status code, raw body, and headers + :raises ApiException: if fails to make API call + """ + if body is None: + raise ValueError("Missing the required parameter 'body'") + + path = "/zitadel.webkey.v2.WebKeyService/ListWebKeys" + query_params: Dict[str, Any] = {} + header_params: Dict[str, str] = {} + body = body + + return await self._invoke_api_for_result( + "POST", + path, + query_params, + header_params, + body, + ["application/json"], + "application/json", + "WebKeyServiceListWebKeysResponse", + None, ) - - diff --git a/zitadel_client/api_client.py b/zitadel_client/api_client.py index 334baf05..28fbb244 100644 --- a/zitadel_client/api_client.py +++ b/zitadel_client/api_client.py @@ -1,677 +1,51 @@ -import datetime -import decimal -import json -import mimetypes -import os -import re -import tempfile -from enum import Enum -from types import TracebackType -from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, no_type_check -from urllib.parse import quote +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -from dateutil.parser import parse -from pydantic import SecretStr +from typing import Any, Dict, Protocol, runtime_checkable -import zitadel_client.models -import zitadel_client.rest_response -from zitadel_client import rest -from zitadel_client.api_response import ApiResponse +from zitadel_client.api_http_response import ApiHttpResponse -# noinspection PyPep8Naming -from zitadel_client.api_response import T as ApiResponseT -from zitadel_client.auth.no_auth_authenticator import NoAuthAuthenticator -from zitadel_client.configuration import Configuration -from zitadel_client.exceptions import ApiError -RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] +@runtime_checkable +class ApiClient(Protocol): + """Interface for API HTTP transport. - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI 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 OpenAPI - templates. - - :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. + Implementations handle the actual HTTP request/response cycle. + The default implementation uses urllib3. Implementations that own a + connection pool should additionally provide ``close()`` and the + context-manager protocol (``__enter__``/``__exit__``) so callers can + release sockets deterministically via ``with``; this Protocol does + not require those methods so test fixtures and lightweight stubs + don't have to implement them. """ - PRIMITIVE_TYPES = (float, bool, bytes, str, int) - NATIVE_TYPES_MAPPING = { - "int": int, - "long": int, - "float": float, - "str": str, - "bool": bool, - "date": datetime.date, - "datetime": datetime.datetime, - "decimal": decimal.Decimal, - "object": object, - } - _pool = None - - def __init__( - self, - configuration: Configuration, - header_name: Optional[str] = None, - header_value: Optional[str] = None, - ) -> None: - self.configuration = configuration - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {"User-Agent": configuration.user_agent} - if configuration.default_headers: - self.default_headers.update(configuration.default_headers) - if header_name is not None and header_value is not None: - self.default_headers[header_name] = header_value - self.client_side_validation = configuration.client_side_validation - - # noinspection PyArgumentList - T = TypeVar("T", bound="ApiClient") - - def __enter__(self: T) -> T: - return self - - def __exit__( - self, - exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType], - ) -> Optional[bool]: - return None - - def set_default_header(self, header_name: str, header_value: str) -> None: - self.default_headers[header_name] = header_value - - _default = None - - # noinspection PyUnusedLocal - @no_type_check - def param_serialize( - self, - method, - resource_path, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, - auth_settings=None, - collection_formats=None, - _host=None, - _request_auth=None, - ) -> RequestSerialized: - """Builds the HTTP request params needed by the request. - :param files: - :param _host: - :param auth_settings: - :param method: Method to call. - :param resource_path: Path to method endpoint. - :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: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_auth: set to override the auth_settings for an single - request; this effectively ignores the authentication - in the spec for a single request. - :return: tuple of form (path, http_method, query_params, header_params, - body, post_params, files) - """ - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - 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)) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, collection_formats) - if files: - post_params.extend(self.files_parameters(files)) - - header_params.update(self.configuration.authenticator.get_auth_headers()) - - if body: - body = self.sanitize_for_serialization(body) - - if _host is None: - url = self.configuration.host + resource_path - else: - url = _host + resource_path - - if query_params: - query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, collection_formats) - url += "?" + url_query - - return method, url, header_params, body, post_params - - @no_type_check - def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None, - ) -> zitadel_client.rest_response.RESTResponse: - """Makes the HTTP request (synchronous) - :param post_params: - :param method: Method to call. - :param url: Path to method endpoint. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param _request_timeout: timeout setting for this request. - :return: RESTResponse - """ - - try: - # perform request and return response - response_data = self.rest_client.request( - method, - url, - headers=header_params, - body=body, - post_params=post_params, - _request_timeout=_request_timeout, - ) - - except ApiError as e: - raise e - - return response_data - - @no_type_check - def response_deserialize( - self, - response_data: zitadel_client.rest_response.RESTResponse, - response_types_map: Optional[Dict[str, ApiResponseT]] = None, - ) -> ApiResponse[ApiResponseT]: - """Deserializes response into an object. - :param response_data: RESTResponse object to be deserialized. - :param response_types_map: dict of response types. - :return: ApiResponse - """ - - msg = "RESTResponse.read() must be called before passing it to response_deserialize()" - assert response_data.data is not None, msg - - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - # deserialize response data - # noinspection PyUnusedLocal - response_text = None - return_data = None - # noinspection PyUnreachableCode - try: - if response_type == "bytearray": - return_data = response_data.data - elif response_type == "file": - return_data = self.__deserialize_file(response_data) - elif response_type is not None: - match = None - content_type = response_data.getheader("content-type") - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_text = response_data.data.decode(encoding) - # noinspection PyTypeChecker - return_data = self.deserialize(response_text, response_type, content_type) - finally: - if not 200 <= response_data.status <= 299: - body = None - if response_data.data: - content_type = response_data.getheader("content-type") or "" - - # Manually check if the content type is JSON-like - is_json = re.match(r"^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)", content_type, re.IGNORECASE) - - if is_json: - try: - # Attempt to decode the JSON into a standard dictionary - body = json.loads(response_data.data.decode("utf-8")) - except (json.JSONDecodeError, UnicodeDecodeError): - # Fallback to raw text if JSON is malformed - body = response_data.data.decode("utf-8", errors="ignore") - else: - # If content type is not JSON, use the raw text - body = response_data.data.decode("utf-8", errors="ignore") - - raise ApiError(response_data.status, response_data.getheaders(), body) - else: - return ApiResponse( - status_code=response_data.status, - data=return_data, - headers=response_data.getheaders(), - raw_data=response_data.data, - ) - - @no_type_check - def sanitize_for_serialization(self, obj): # noqa C901 too complex - """Builds a JSON POST object. - - If obj is None, return None. - If obj is SecretStr, return obj.get_secret_value() - 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 decimal.Decimal return string representation. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI 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, Enum): - return obj.value - elif isinstance(obj, SecretStr): - return obj.get_secret_value() - 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() - elif isinstance(obj, decimal.Decimal): - return str(obj) - - elif isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, "to_dict") and callable(obj.to_dict): - obj_dict = obj.to_dict() - else: - obj_dict = obj.__dict__ - - return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} - - @no_type_check - def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): - """Deserializes response into an object. - - :param response_text: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - :param content_type: content type of response. - - :return: deserialized object. - """ - - # fetch data from response object - if content_type is None: - try: - # noinspection PyUnusedLocal - data = json.loads(response_text) - except ValueError: - data = response_text - elif re.match( - r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", - content_type, - re.IGNORECASE, - ): - if response_text == "": - data = "" - else: - data = json.loads(response_text) - elif re.match(r"^text/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): - data = response_text - else: - raise RuntimeError("Unsupported content type: {0}".format(content_type)) - - return self.__deserialize(data, response_type) - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize(data, klass): # noqa C901 too complex - """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 isinstance(klass, str): - if klass.startswith("List["): - m = re.match(r"List\[(.*)]", klass) - assert m is not None, "Malformed List type definition" - # noinspection PyArgumentList - return [ApiClient.__deserialize(sub_data) for sub_data in data] - - if klass.startswith("Dict["): - m = re.match(r"Dict\[([^,]*), (.*)]", klass) - assert m is not None, "Malformed Dict type definition" - sub_kls = m.group(2) - # noinspection PyArgumentList - return {k: ApiClient.__deserialize(sub_kls) for k, v in data.items()} - - # convert str to class - if klass in ApiClient.NATIVE_TYPES_MAPPING: - klass = ApiClient.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(zitadel_client.models, klass) - - if klass in ApiClient.PRIMITIVE_TYPES: - return ApiClient.__deserialize_primitive(data, klass) - elif klass is object: - return ApiClient.__deserialize_object(data) - elif klass == datetime.date: - return ApiClient.__deserialize_date(data) - elif klass == datetime.datetime: - return ApiClient.__deserialize_datetime(data) - elif klass == decimal.Decimal: - return decimal.Decimal(data) - elif issubclass(klass, Enum): - return ApiClient.__deserialize_enum(data, klass) - else: - return ApiClient.__deserialize_model(data, klass) - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def parameters_to_tuples(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: List[Tuple[str, str]] = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - 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 - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def parameters_to_url_query(params, collection_formats): # noqa C901 too complex - """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: URL query string (e.g. a=Hello%20World&b=123) - """ - new_params: List[Tuple[str, str]] = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance(v, bool): - v = str(v).lower() - if isinstance(v, (int, float)): - v = str(v) - if isinstance(v, dict): - v = json.dumps(v) - - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == "multi": - new_params.extend((k, quote(str(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(quote(str(value)) for value in v))) - else: - new_params.append((k, quote(str(v)))) - - return "&".join(["=".join(map(str, item)) for item in new_params]) - - @no_type_check - def files_parameters( + def send_request( self, - files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], - ): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - for k, v in files.items(): - if isinstance(v, str): - with open(v, "rb") as f: - filename = os.path.basename(f.name) - filedata = f.read() - elif isinstance(v, bytes): - filename = k - filedata = v - elif isinstance(v, tuple): - filename, filedata = v - elif isinstance(v, list): - for file_param in v: - params.extend(self.files_parameters({k: file_param})) - continue - else: - raise ValueError("Unsupported file value") - mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" - params.append((k, (filename, filedata, mimetype))) - return params - - @staticmethod - def select_header_accept(accepts: List[str]) -> Optional[str]: - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return None - - for accept in accepts: - if re.search("json", accept, re.IGNORECASE): - return accept - - return accepts[0] - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def select_header_content_type(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 None - - for content_type in content_types: - if re.search("json", content_type, re.IGNORECASE): - return content_type - - return content_types[0] - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_file(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. - - handle file downloading - save response body into a tmp file and return the instance - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp() - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) - assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_primitive(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 str(data) - except TypeError: - return data - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_object(value): - """Return an original value. - - :return: object. - """ - return value - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_date(string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError as err: - raise RuntimeError("Failed to parse `{0}` as date object".format(string)) from err - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_datetime(string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError as err: - raise RuntimeError("Failed to parse `{0}` as datetime object".format(string)) from err - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_enum(data, klass): - """Deserializes primitive type to enum. - - :param data: primitive type. - :param klass: class literal. - :return: enum value. - """ - try: - return klass(data) - except ValueError as err: - raise RuntimeError("Failed to parse `{0}` as `{1}`".format(data, klass)) from err - - # noinspection PyNestedDecorators - @no_type_check - @staticmethod - def __deserialize_model(data, klass: Any): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - return klass.from_dict(data) - - # noinspection PyNestedDecorators - @no_type_check - @classmethod - def get_default(cls): - return ApiClient(configuration=Configuration(authenticator=NoAuthAuthenticator())) + method: str, + url: str, + headers: Dict[str, str], + body: Any = None, + no_redirect: bool = False, + ) -> ApiHttpResponse: + """Send an HTTP request and return the response. + + :param method: HTTP method (GET, POST, PUT, DELETE, etc.) + :param url: Fully qualified URL + :param headers: HTTP headers + :param body: Request body (serialized JSON string, bytes, dict for multipart, or None) + :param no_redirect: When ``True``, the implementation must NOT follow + any redirect on this request and must return the first 3xx + response verbatim so the caller can inspect and reject it itself; + the implementation must not raise on its own for a 3xx. Used by + OAuth2 token requests so that a malicious 307/308 cannot replay + the credential-bearing token POST against an attacker-controlled + endpoint — the token manager checks the returned status code and + refuses to follow it. When ``False`` (the default), the + implementation follows redirects per its usual security guards. + :return: ApiHttpResponse containing status code, body, and headers + """ + ... diff --git a/zitadel_client/api_http_response.py b/zitadel_client/api_http_response.py new file mode 100644 index 00000000..16c80cf7 --- /dev/null +++ b/zitadel_client/api_http_response.py @@ -0,0 +1,18 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from dataclasses import dataclass +from typing import Dict + + +@dataclass(frozen=True) +class ApiHttpResponse: + """Represents an HTTP API response.""" + + status_code: int + body: str + headers: Dict[str, str] diff --git a/zitadel_client/api_response.py b/zitadel_client/api_response.py deleted file mode 100644 index 7953a532..00000000 --- a/zitadel_client/api_response.py +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import annotations - -from typing import Generic, Mapping, Optional, TypeVar - -from pydantic import BaseModel, Field, StrictBytes, StrictInt - -T = TypeVar("T") - - -# noinspection PyTypeHints -class ApiResponse(BaseModel, Generic[T]): - """ - API response object - """ - - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") - data: T = Field(description="Deserialized data given the data type") - raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - - model_config = {"arbitrary_types_allowed": True} diff --git a/zitadel_client/api_result.py b/zitadel_client/api_result.py new file mode 100644 index 00000000..9bbd296d --- /dev/null +++ b/zitadel_client/api_result.py @@ -0,0 +1,25 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from dataclasses import dataclass +from typing import Dict, Generic, Optional, TypeVar + +T = TypeVar("T") + + +@dataclass(frozen=True) +class ApiResult(Generic[T]): + """Represents a typed API response with deserialized data, status code, + raw body, and headers. Returned by ``with_http_info`` methods. + """ + + status_code: int + data: Optional[T] + # The raw response body is always populated by the transport (an empty + # string when the server sent no body), so it is never null. + raw_body: str + headers: Dict[str, str] diff --git a/zitadel_client/auth/__init__.py b/zitadel_client/auth/__init__.py index e69de29b..c82a81f2 100644 --- a/zitadel_client/auth/__init__.py +++ b/zitadel_client/auth/__init__.py @@ -0,0 +1,24 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from zitadel_client.auth.authenticator import Authenticator as Authenticator +from zitadel_client.auth.base_authenticator import ( + BaseAuthenticator as BaseAuthenticator, +) +from zitadel_client.auth.http_aware_authenticator import ( + HttpAwareAuthenticator as HttpAwareAuthenticator, +) +from zitadel_client.auth.bearer_authenticator import ( + BearerAuthenticator as BearerAuthenticator, +) + +__all__ = [ + "Authenticator", + "BaseAuthenticator", + "HttpAwareAuthenticator", + "BearerAuthenticator", +] diff --git a/zitadel_client/auth/authenticator.py b/zitadel_client/auth/authenticator.py index 9ecae820..355cd68b 100644 --- a/zitadel_client/auth/authenticator.py +++ b/zitadel_client/auth/authenticator.py @@ -1,68 +1,32 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + from abc import ABC, abstractmethod -from datetime import datetime, timedelta, timezone -from typing import Any, Dict, Generic, TypeVar # noqa: F401 +from typing import Dict class Authenticator(ABC): - """ - Abstract base class for authenticators. + """Base class for providing authentication credentials to the API client. - This class defines the basic structure for any authenticator by requiring the implementation - of a method to retrieve authentication headers, and provides a way to store and retrieve the host. + Subclasses supply the API host URL and authorization headers. """ - def __init__(self, host: str): - """ - Initializes the Authenticator with the specified host. - - :param host: The base URL or endpoint for the service. - """ - self.host = host - @abstractmethod - def get_auth_headers(self) -> Dict[str, str]: - """ - Retrieves the authentication headers to be sent with requests. - - Subclasses must override this method to return the appropriate headers. - - :return: A dictionary mapping header names to their values. - """ - pass # pragma: no cover - def get_host(self) -> str: - """ - Returns the stored host. - - :return: The host as a string. - """ - return self.host - - -class Token: - def __init__(self, access_token: str, expires_at: datetime): - """ - Initializes a new Token instance. + """Returns the base URL of the API.""" - Parameters: - - access_token (str): The JWT or OAuth token. - - expires_at (datetime): The expiration time of the token. It should be timezone-aware. - If a naive datetime is provided, it will be converted to an aware datetime in UTC. - """ - self.access_token = access_token - - # Ensure expires_at is timezone-aware. If naive, assume UTC. - if expires_at.tzinfo is None: - self.expires_at = expires_at.replace(tzinfo=timezone.utc) - else: - self.expires_at = expires_at + @abstractmethod + def get_auth_headers(self) -> Dict[str, str]: + """Returns the authentication headers to include in every request.""" - def is_expired(self) -> bool: - """ - Checks if the token is expired by comparing the current UTC time - with the token's expiration time. + def get_query_params(self) -> Dict[str, str]: + """Returns query parameters to include for authentication.""" + return {} - Returns: - - bool: True if expired, False otherwise. - """ - return datetime.now(timezone.utc) >= (self.expires_at - timedelta(minutes=5)) + def get_cookie_params(self) -> Dict[str, str]: + """Returns cookie parameters to include for authentication.""" + return {} diff --git a/zitadel_client/auth/base_authenticator.py b/zitadel_client/auth/base_authenticator.py new file mode 100644 index 00000000..d787164a --- /dev/null +++ b/zitadel_client/auth/base_authenticator.py @@ -0,0 +1,33 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from abc import abstractmethod +from typing import Dict + +from .authenticator import Authenticator + + +class BaseAuthenticator(Authenticator): + """Abstract base class providing default implementations for optional + Authenticator methods. Concrete authenticators should extend this class. + """ + + @abstractmethod + def get_host(self) -> str: + """Returns the base URL of the API.""" + + @abstractmethod + def get_auth_headers(self) -> Dict[str, str]: + """Returns the authentication headers to include in every request.""" + + def get_query_params(self) -> Dict[str, str]: + """Returns query parameters to include for authentication.""" + return {} + + def get_cookie_params(self) -> Dict[str, str]: + """Returns cookie parameters to include for authentication.""" + return {} diff --git a/zitadel_client/auth/bearer_authenticator.py b/zitadel_client/auth/bearer_authenticator.py new file mode 100644 index 00000000..4cbb6e77 --- /dev/null +++ b/zitadel_client/auth/bearer_authenticator.py @@ -0,0 +1,57 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from dataclasses import dataclass, field +from typing import Dict + +from .base_authenticator import BaseAuthenticator + + +@dataclass(frozen=True) +class BearerAuthenticator(BaseAuthenticator): + """Authenticator for HTTP Bearer token authentication.""" + + host: str + # repr=False so the bearer token is never leaked through the dataclass's + # auto-generated repr/str (e.g. logging, f-strings, %r). The default + # representation shows the host only. + token: str = field(repr=False) + + def __post_init__(self) -> None: + # Reject an empty / whitespace-only token so the SDK never emits a + # bare ``Authorization: Bearer `` header, matching the api-key + # authenticator's own empty guard. + if not self.token or not self.token.strip(): + raise ValueError("Bearer token must not be empty") + # RFC 7230 §3.2.6 — field-value is HTAB / SP / VCHAR / obs-text. + # Reject anything outside printable ASCII + TAB so callers see a + # clear error rather than HTTP header injection from CR/LF or + # silently-mangled non-ASCII bytes. + if any(c != "\t" and (ord(c) < 0x20 or ord(c) >= 0x7F) for c in self.token): + raise ValueError( + "Bearer token must contain only printable ASCII characters (RFC 7230 §3.2.6)" + ) + + def get_host(self) -> str: + return self.host + + def get_auth_headers(self) -> Dict[str, str]: + # Dedupe "Bearer " prefix (case-insensitive ASCII): tokens read + # from env files are commonly stored already-prefixed; emitting + # "Bearer Bearer xyz" would otherwise silently break auth. + value = self.token + if len(value) >= 7 and value[:7].lower() == "bearer ": + value = value[7:] + return {"Authorization": f"Bearer {value}"} + + def __repr__(self) -> str: + """Redacts the bearer token so it never leaks into logs or tracebacks. + + The token is shown as the literal ``***`` while non-sensitive fields + remain visible to keep the representation useful for debugging. + """ + return f"{type(self).__name__}(host={self.host!r}, token='***')" diff --git a/zitadel_client/auth/client_credentials_authenticator.py b/zitadel_client/auth/client_credentials_authenticator.py index a95cd8b3..0281dbf3 100644 --- a/zitadel_client/auth/client_credentials_authenticator.py +++ b/zitadel_client/auth/client_credentials_authenticator.py @@ -1,75 +1,64 @@ -import sys -from typing import Dict, Optional, Set - -if sys.version_info >= (3, 12): - from typing import override -else: - from typing_extensions import override - -from authlib.integrations.requests_client import OAuth2Session +from typing import Dict from zitadel_client.auth.oauth_authenticator import ( OAuthAuthenticator, OAuthAuthenticatorBuilder, + require_text, ) from zitadel_client.auth.open_id import OpenId -from zitadel_client.transport_options import TransportOptions class ClientCredentialsAuthenticator(OAuthAuthenticator): """ - OAuth authenticator implementing the client credentials flow. + OAuth authenticator implementing the client-credentials flow (RFC 6749 §4.4). - Uses client_id and client_secret to obtain an access token from the OAuth2 token endpoint. + Mints a bearer token by POSTing client_id / client_secret to the provider's + token endpoint through the SDK's shared transport. See + :class:`OAuthAuthenticator` for the caching and HTTP-injection contract. """ + GRANT_TYPE = "client_credentials" + def __init__( self, open_id: OpenId, client_id: str, client_secret: str, - auth_scopes: Set[str], - transport_options: Optional[TransportOptions] = None, + scope: str, ): """ Constructs a ClientCredentialsAuthenticator. - :param open_id: The base URL for the OAuth provider. + :param open_id: The OpenID discovery helper for the target host. :param client_id: The OAuth client identifier. :param client_secret: The OAuth client secret. - :param auth_scopes: The scope(s) for the token request. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param scope: Space-delimited scope string for the token request. """ - opts = transport_options or TransportOptions.defaults() - - session = OAuth2Session( - client_id=client_id, - client_secret=client_secret, - scope=" ".join(auth_scopes), - **opts.to_session_kwargs(), - ) - - if opts.default_headers: - session.headers.update(opts.default_headers) + super().__init__(open_id, scope) + self.client_id = client_id + self.client_secret = client_secret - super().__init__( - open_id, - session, - transport_options=opts, + def __repr__(self) -> str: + """Redacts the client secret and cached token so they never leak into + logs or tracebacks, while the client id stays visible.""" + return ( + f"{type(self).__name__}(host={self.get_host()!r}, " + f"client_id={self.client_id!r}, client_secret='***', " + f"scope={self.scope!r}, access_token={self._masked_token()!r})" ) - @override - def get_grant(self) -> Dict[str, str]: - """ - Returns the grant parameters for the client credentials flow. + def get_grant_type(self) -> str: + return self.GRANT_TYPE - :return: A dictionary with the grant type for client credentials. - """ - return {"grant_type": "client_credentials"} + def get_token_request_params(self) -> Dict[str, str]: + return { + "client_id": self.client_id, + "client_secret": self.client_secret, + } @staticmethod def builder( - host: str, client_id: str, client_secret: str, transport_options: Optional[TransportOptions] = None + host: str, client_id: str, client_secret: str ) -> "ClientCredentialsAuthenticatorBuilder": """ Returns a builder for constructing a ClientCredentialsAuthenticator. @@ -77,43 +66,38 @@ def builder( :param host: The base URL for the OAuth provider. :param client_id: The OAuth client identifier. :param client_secret: The OAuth client secret. - :param transport_options: Optional transport options for TLS, proxy, and headers. :return: A ClientCredentialsAuthenticatorBuilder instance. + :raises ValueError: If the host is not a valid http or https URL, or + the client identifier or secret is empty. """ - return ClientCredentialsAuthenticatorBuilder(host, client_id, client_secret, transport_options=transport_options) + return ClientCredentialsAuthenticatorBuilder(host, client_id, client_secret) -class ClientCredentialsAuthenticatorBuilder(OAuthAuthenticatorBuilder["ClientCredentialsAuthenticatorBuilder"]): +class ClientCredentialsAuthenticatorBuilder( + OAuthAuthenticatorBuilder["ClientCredentialsAuthenticatorBuilder"] +): """ Builder class for constructing ClientCredentialsAuthenticator instances. - - This builder extends the OAuthAuthenticatorBuilder with client credentials (client_id and client_secret) - required for the client credentials flow. """ - def __init__(self, host: str, client_id: str, client_secret: str, transport_options: Optional[TransportOptions] = None): + def __init__(self, host: str, client_id: str, client_secret: str): """ - Initializes the ClientCredentialsAuthenticatorBuilder with host, client ID, and client secret. + Initializes the ClientCredentialsAuthenticatorBuilder. :param host: The base URL for the OAuth provider. :param client_id: The OAuth client identifier. :param client_secret: The OAuth client secret. - :param transport_options: Optional transport options for TLS, proxy, and headers. """ - super().__init__(host, transport_options=transport_options) - self.client_id = client_id - self.client_secret = client_secret + super().__init__(host) + self.client_id = require_text(client_id, "Client ID") + self.client_secret = require_text(client_secret, "Client secret") def build(self) -> ClientCredentialsAuthenticator: """ - Constructs and returns a ClientCredentialsAuthenticator instance using the configured parameters. + Constructs and returns a ClientCredentialsAuthenticator instance. :return: A configured ClientCredentialsAuthenticator. """ return ClientCredentialsAuthenticator( - self.open_id, - self.client_id, - self.client_secret, - self.auth_scopes, - transport_options=self.transport_options, + self.open_id, self.client_id, self.client_secret, self.scope ) diff --git a/zitadel_client/auth/http_aware_authenticator.py b/zitadel_client/auth/http_aware_authenticator.py new file mode 100644 index 00000000..e7836de8 --- /dev/null +++ b/zitadel_client/auth/http_aware_authenticator.py @@ -0,0 +1,44 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from abc import abstractmethod + +from ..api_client import ApiClient +from .authenticator import Authenticator + + +class HttpAwareAuthenticator(Authenticator): + """Extension of :class:`Authenticator` for authentication schemes that + require making HTTP requests (e.g. OAuth2 token exchange, OpenID Connect + discovery). + + Implementations receive a shared :class:`ApiClient` instance so that + authentication-related HTTP calls (token endpoints, discovery documents) + use the same transport configuration (proxy, TLS, timeouts) as regular + API calls. + + The :class:`ApiClient` is injected by the :class:`Zitadel` class after + construction, via :meth:`set_api_client`. Implementations must not make + HTTP calls before the client is injected. + + Only OAuth2 and OpenID Connect authenticators implement this class. + Simple authenticators (Basic, Bearer, API Key) do not need HTTP access + and implement :class:`Authenticator` directly. + """ + + @abstractmethod + def set_api_client(self, api_client: ApiClient) -> None: + """Inject the shared API client for making HTTP requests. + + Called by the :class:`Zitadel` constructor after the :class:`ApiClient` + has been created with the user's :class:`TransportOptions`. + Implementations should store this reference and use it for all + outbound HTTP calls (token exchange, discovery, etc.). + + Args: + api_client: The shared API client instance. + """ diff --git a/zitadel_client/auth/no_auth_authenticator.py b/zitadel_client/auth/no_auth_authenticator.py index c6df71f3..fe0ffc40 100644 --- a/zitadel_client/auth/no_auth_authenticator.py +++ b/zitadel_client/auth/no_auth_authenticator.py @@ -1,23 +1,29 @@ from typing import Dict -from zitadel_client.auth.authenticator import Authenticator +from zitadel_client.auth.base_authenticator import BaseAuthenticator +from zitadel_client.auth.open_id import OpenId -class NoAuthAuthenticator(Authenticator): +class NoAuthAuthenticator(BaseAuthenticator): """ - A simple authenticator that performs no authentication. + A no-op authenticator that performs no authentication. - This authenticator is useful for cases where no token or credentials are required. - It simply returns an empty dictionary for authentication headers. + Useful for testing and unauthenticated endpoints: it never mints a token, + so it returns an empty set of auth headers. """ def __init__(self, host: str = "http://localhost"): """ - Initializes the NoAuthAuthenticator with a default host. + Initializes the NoAuthAuthenticator. - :param host: The base URL for the service. Defaults to "http://localhost". + :param host: The base URL for the API endpoints. Defaults to + "http://localhost". + :raises ValueError: If the host is not a valid http or https URL. """ - super().__init__(host) + self.host = OpenId(host).get_host_endpoint() + + def get_host(self) -> str: + return self.host def get_auth_headers(self) -> Dict[str, str]: """ diff --git a/zitadel_client/auth/oauth_authenticator.py b/zitadel_client/auth/oauth_authenticator.py index 195e6aa6..3acc12f5 100644 --- a/zitadel_client/auth/oauth_authenticator.py +++ b/zitadel_client/auth/oauth_authenticator.py @@ -1,127 +1,235 @@ +import json +import time from abc import ABC, abstractmethod -from datetime import datetime, timedelta, timezone -from threading import Lock -from typing import Any, Dict, Generic, Optional, TypeVar # noqa: F401 +from threading import RLock +from typing import Any, Dict, Generic, Optional, TypeVar +from urllib.parse import urlencode -from authlib.integrations.requests_client import OAuth2Session - -from zitadel_client import ZitadelError -from zitadel_client.auth.authenticator import Authenticator, Token +from zitadel_client.api_client import ApiClient +from zitadel_client.auth.base_authenticator import BaseAuthenticator +from zitadel_client.auth.http_aware_authenticator import HttpAwareAuthenticator from zitadel_client.auth.open_id import OpenId -from zitadel_client.transport_options import TransportOptions +from zitadel_client.errors.oauth2_server_exception import OAuth2ServerException +from zitadel_client.errors.oauth2_token_exception import OAuth2TokenException +DEFAULT_SCOPE = "openid urn:zitadel:iam:org:project:id:zitadel:aud" + + +def require_text(value: Optional[str], label: str) -> str: + """Raise :class:`ValueError` when the value is ``None`` or blank.""" + if not isinstance(value, str) or not value.strip(): + raise ValueError(f"{label} cannot be empty.") + return value -class OAuthAuthenticator(Authenticator, ABC): - """ - Base class for OAuth-based authentication using Authlib. - Attributes: - open_id: An object providing OAuth endpoint information. - oauth_session: An OAuth2Session instance used for fetching tokens. +def _parse_object(body: str) -> Optional[Dict[str, Any]]: + try: + payload = json.loads(body) + except ValueError: + return None + return payload if isinstance(payload, dict) else None + + +class OAuthAuthenticator(BaseAuthenticator, HttpAwareAuthenticator, ABC): + """ + Abstract base class for OAuth-based, token-minting authenticators. + + Mints a bearer token by POSTing an OAuth2 grant (client-credentials or a + signed JWT-bearer assertion) to the provider's token endpoint, then + attaches the resulting access token on every API request. The minted token + is cached together with its expiry and only re-minted once it is within the + refresh skew of expiring. + + Token-minting requires an outbound HTTP call, so this class implements + :class:`HttpAwareAuthenticator`: the shared :class:`ApiClient` is injected + by the :class:`zitadel_client.zitadel.Zitadel` constructor and both OpenID + discovery and the token POST are sent through it. A token request fails + with: + + - :class:`RuntimeError` when no :class:`ApiClient` has been injected; + - :class:`NetworkException` or :class:`NetworkTimeoutException` when no + HTTP response arrived; + - :class:`OAuth2ServerException` when the token endpoint answered with a + non-2xx status; + - :class:`OAuth2TokenException` when it answered 2xx without a usable + access token. """ - def __init__( - self, - open_id: OpenId, - oauth_session: OAuth2Session, - transport_options: Optional[TransportOptions] = None, - ): + # Seconds before expiry at which a cached token is treated as stale. + REFRESH_SKEW_SECONDS = 300 + + def __init__(self, open_id: OpenId, scope: str): """ Constructs an OAuthAuthenticator. - :param open_id: An object that must implement get_host_endpoint() and get_token_endpoint(). - :param oauth_session: The scope for the token request. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param open_id: The OpenID discovery helper for the target host. + :param scope: Space-delimited scope string for the token request. """ - super().__init__(open_id.get_host_endpoint()) self.open_id = open_id - self.token: Optional[Token] = None - self.transport_options = transport_options or TransportOptions.defaults() - self.oauth_session = oauth_session - self._lock = Lock() + self.scope = scope + self._api_client: Optional[ApiClient] = None + self._access_token: Optional[str] = None + self._expires_at: Optional[float] = None + self._lock = RLock() + + def set_api_client(self, api_client: ApiClient) -> None: + self._api_client = api_client + + def get_host(self) -> str: + return self.open_id.get_host_endpoint() + + def get_auth_headers(self) -> Dict[str, str]: + return {"Authorization": "Bearer " + self.get_auth_token()} def get_auth_token(self) -> str: """ - Returns the current access token, refreshing it if necessary. + Return a valid access token, minting (or re-minting) one if the cache + is empty or within the refresh skew of expiring. """ with self._lock: - if self.token is None or self.token.is_expired(): - self.refresh_token() - - if self.token is None: - raise ZitadelError("Token is null even after attempting to refresh.") - else: - return self.token.access_token - - def get_auth_headers(self) -> Dict[str, str]: + token = self._access_token + if token is None or self._is_stale(): + token = self.refresh_token() + return token + + def _is_stale(self) -> bool: + return ( + self._expires_at is not None + and time.time() >= self._expires_at - self.REFRESH_SKEW_SECONDS + ) + + def refresh_token(self) -> str: """ - Retrieves authentication headers. + Exchange the configured grant for a fresh access token and cache it. - :return: A dictionary containing the 'Authorization' header. + :return: The freshly minted access token. """ - return {"Authorization": "Bearer " + self.get_auth_token()} + with self._lock: + api_client = self._api_client + if api_client is None: + raise RuntimeError( + "OAuthAuthenticator has no ApiClient; use it through the Zitadel client, which injects one before the first token request." + ) + + params: Dict[str, str] = { + "grant_type": self.get_grant_type(), + "scope": self.scope, + } + params.update(self.get_token_request_params()) + + response = api_client.send_request( + "POST", + self.open_id.get_token_endpoint(api_client), + { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "application/json", + }, + urlencode(params), + # never replay a token POST across a redirect: a malicious + # 307/308 could otherwise leak the assertion or secret. + True, + ) + + status = response.status_code + if status < 200 or status >= 300: + raise self._server_error(status, response.body) + + payload = _parse_object(response.body) + if payload is None: + raise OAuth2TokenException("Token response is not a JSON object") + access_token = payload.get("access_token") + if not isinstance(access_token, str) or not access_token: + raise OAuth2TokenException( + "Token response missing or empty access_token field" + ) + expires_in = payload.get("expires_in") + if ( + isinstance(expires_in, (int, float)) + and not isinstance(expires_in, bool) + and expires_in > 0 + ): + self._expires_at = time.time() + float(expires_in) + else: + self._expires_at = None + self._access_token = access_token + return access_token + + @staticmethod + def _server_error(status: int, body: str) -> OAuth2ServerException: + payload = _parse_object(body) + code = payload.get("error") if payload is not None else None + if payload is None or not isinstance(code, str) or not code: + return OAuth2ServerException(status, None, None, None, body) + description = payload.get("error_description") + uri = payload.get("error_uri") + return OAuth2ServerException( + status, + code, + description if isinstance(description, str) else None, + uri if isinstance(uri, str) else None, + body, + ) + + def _masked_token(self) -> Optional[str]: + return "***" if self._access_token is not None else None + + def __repr__(self) -> str: + # Mask the cached token so it never leaks through repr() / logging. + return f"{type(self).__name__}(host={self.get_host()!r}, scope={self.scope!r}, access_token={self._masked_token()!r})" @abstractmethod - def get_grant(self) -> Dict[str, str]: - """ - Builds and returns a dictionary of grant parameters required for the token request. + def get_grant_type(self) -> str: + """The OAuth2 grant_type value sent in the token request.""" + ... # pragma: no cover - For example, this might include parameters like grant_type, client_assertion, etc. - """ - pass # pragma: no cover + @abstractmethod + def get_token_request_params(self) -> Dict[str, str]: + """Grant-specific token-request parameters (e.g. assertion).""" + ... # pragma: no cover - def refresh_token(self) -> Token: - """ - Refreshes the access token using the OAuth flow. - It uses get_grant() to obtain all necessary parameters, such as the grant type and any assertions. - :return: A new Token. - """ - try: - token_response = self.oauth_session.fetch_token(url=(self.open_id.get_token_endpoint()), **(self.get_grant())) - access_token = token_response["access_token"] - expires_in = token_response.get("expires_in", 3600) - expires_at = datetime.now(timezone.utc) + timedelta(seconds=expires_in) - self.token = Token(access_token, expires_at) - return self.token - except Exception as e: - raise ZitadelError("Failed to refresh token: " + str(e)) from e - - -# noinspection PyArgumentList T = TypeVar("T", bound="OAuthAuthenticatorBuilder[Any]") -# noinspection PyTypeHintsInspection,PyTypeHints class OAuthAuthenticatorBuilder(ABC, Generic[T]): """ Abstract builder class for constructing OAuth authenticator instances. - This builder provides common configuration options such as the OpenId instance and authentication scopes. + Holds the OpenID discovery helper for the host and the requested scopes. """ - def __init__( - self, - host: str, - transport_options: Optional[TransportOptions] = None, - ): + def __init__(self, host: str): """ Initializes the OAuthAuthenticatorBuilder with a given host. :param host: The base URL for the OAuth provider. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :raises ValueError: If the host is not a valid http or https URL. """ super().__init__() - self.transport_options = transport_options or TransportOptions.defaults() - self.open_id = OpenId(host, transport_options=self.transport_options) - self.auth_scopes = {"openid", "urn:zitadel:iam:org:project:id:zitadel:aud"} + self.open_id = OpenId(host) + self.scope = DEFAULT_SCOPE def scopes(self: T, *auth_scopes: str) -> T: """ - Sets the authentication scopes for the OAuth authenticator. + Overrides the default scopes. Duplicates are dropped; order is kept. - :param auth_scopes: A variable number of scope strings. + :param auth_scopes: The scopes for the token request. :return: The builder instance to allow for method chaining. + :raises ValueError: If no scope is given, or a scope is empty or + contains whitespace. """ - self.auth_scopes = set(auth_scopes) + if not auth_scopes: + raise ValueError("At least one scope is required.") + unique: Dict[str, None] = {} + for auth_scope in auth_scopes: + if ( + not isinstance(auth_scope, str) + or not auth_scope + or any(c.isspace() for c in auth_scope) + ): + raise ValueError( + f"Scope must be a non-empty string without whitespace: '{auth_scope}'" + ) + unique[auth_scope] = None + self.scope = " ".join(unique) return self diff --git a/zitadel_client/auth/open_id.py b/zitadel_client/auth/open_id.py index e2be4505..cd5ea816 100644 --- a/zitadel_client/auth/open_id.py +++ b/zitadel_client/auth/open_id.py @@ -1,110 +1,101 @@ import json -import ssl -import urllib.error -import urllib.request +import threading from typing import Optional -from urllib.parse import urljoin +from urllib.parse import urlsplit -from zitadel_client.transport_options import TransportOptions +from zitadel_client.api_client import ApiClient +from zitadel_client.errors import ApiException, SerializationException + +_WELL_KNOWN_PATH = "/.well-known/openid-configuration" class OpenId: """ - OpenId retrieves OpenID Connect configuration from a given host. - - It builds the well-known configuration URL from the provided hostname, - fetches the configuration, and extracts the token endpoint. + Resolves the OpenID Connect discovery document for a Zitadel host. + + The constructor only validates and normalises the host; it performs no + I/O. The ``token_endpoint`` is fetched through the shared + :class:`ApiClient` the first time :meth:`get_token_endpoint` is called, so + discovery honours the SDK's proxy, TLS and timeout settings and fails with + the same error types as any other request: + + - no HTTP response: :class:`NetworkException` or + :class:`NetworkTimeoutException`; + - a non-2xx status: the :class:`ApiException` subclass for that status, as + chosen by :meth:`ApiException.from_response`; + - a body that is not a JSON object with a ``token_endpoint``: + :class:`SerializationException`. """ - host_endpoint: str - token_endpoint: str - - def __init__( # noqa: C901 - self, - hostname: str, - transport_options: Optional[TransportOptions] = None, - ): + def __init__(self, host: str): """ - Initialize the OpenId configuration fetcher. + Validate and normalise the host. A host without a scheme gets ``https://``. - :param hostname: The Zitadel instance hostname or URL. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param host: The Zitadel instance host name or URL. + :raises ValueError: If the host is empty, uses a scheme other than + http or https, or is not a valid URL. """ - if transport_options is None: - transport_options = TransportOptions.defaults() + self._host_endpoint = self._normalise_host(host) + parts = urlsplit(self._host_endpoint) + self._well_known_url = f"{parts.scheme}://{parts.netloc}{_WELL_KNOWN_PATH}" + self._token_endpoint: Optional[str] = None + self._lock = threading.Lock() + @staticmethod + def _normalise_host(host: Optional[str]) -> str: + trimmed = (host or "").strip() + if not trimmed: + raise ValueError("Host cannot be empty.") # noinspection HttpUrlsUsage - if not (hostname.startswith("http://") or hostname.startswith("https://")): - hostname = "https://" + hostname - - self.host_endpoint = hostname - well_known_url = self.build_well_known_url(hostname) - + if not trimmed.lower().startswith(("http://", "https://")): + if "://" in trimmed: + raise ValueError(f"Host must use the http or https scheme: {trimmed}") + trimmed = "https://" + trimmed try: - # noinspection HttpUrlsUsage - if not well_known_url.lower().startswith(("http://", "https://")): - raise ValueError("Invalid URL scheme. Only 'http' and 'https' are allowed.") - - request = urllib.request.Request(well_known_url) # noqa: S310 - if transport_options.default_headers: - for header_name, header_value in transport_options.default_headers.items(): - request.add_header(header_name, header_value) - - if transport_options.insecure: - ctx = ssl.create_default_context() - ctx.check_hostname = False - ctx.verify_mode = ssl.CERT_NONE - elif transport_options.ca_cert_path: - ctx = ssl.create_default_context() - ctx.check_hostname = True - ctx.verify_mode = ssl.CERT_REQUIRED - ctx.load_verify_locations(transport_options.ca_cert_path) - else: - ctx = None - - if transport_options.proxy_url: - proxy_handler = urllib.request.ProxyHandler( - {"http": transport_options.proxy_url, "https": transport_options.proxy_url} - ) - if ctx: - https_handler = urllib.request.HTTPSHandler(context=ctx) - opener = urllib.request.build_opener(proxy_handler, https_handler) - else: - opener = urllib.request.build_opener(proxy_handler) - response_ctx = opener.open(request) - else: - response_ctx = urllib.request.urlopen(request, context=ctx) # noqa: S310 - - with response_ctx as response: - if response.status != 200: - raise Exception(f"Failed to fetch OpenID configuration: HTTP {response.status}") - config = json.loads(response.read().decode("utf-8")) - except urllib.error.URLError as e: - raise Exception(f"URL error occurred: {e}") from e - except json.JSONDecodeError as e: - raise Exception("Failed to decode JSON response") from e - - token_endpoint = config.get("token_endpoint") - if not token_endpoint: - raise Exception("token_endpoint not found in OpenID configuration") - - self.token_endpoint = token_endpoint - - @staticmethod - def build_well_known_url(hostname: str) -> str: - """ - Builds the well-known OpenID configuration URL for the given hostname. - """ - return urljoin(hostname, "/.well-known/openid-configuration") + hostname = urlsplit(trimmed).hostname + except ValueError as e: + raise ValueError(f"Host is not a valid URL: {trimmed}") from e + if not hostname: + raise ValueError(f"Host is not a valid URL: {trimmed}") + return trimmed def get_host_endpoint(self) -> str: - """ - Returns the host endpoint URL. - """ - return self.host_endpoint + """Returns the normalised host endpoint.""" + return self._host_endpoint - def get_token_endpoint(self) -> str: + def get_token_endpoint(self, api_client: ApiClient) -> str: """ - Returns the token endpoint URL extracted from the OpenID configuration. + Returns the OAuth2 token endpoint, fetching the discovery document + through the given API client on first access and caching the result. + + :param api_client: The shared API client used for the discovery request. + :raises ApiException: If discovery fails at the transport or HTTP level. + :raises SerializationException: If the discovery document is unusable. """ - return self.token_endpoint + with self._lock: + if self._token_endpoint is None: + self._token_endpoint = self._discover(api_client) + return self._token_endpoint + + def _discover(self, api_client: ApiClient) -> str: + url = self._well_known_url + response = api_client.send_request("GET", url, {"Accept": "application/json"}) + status = response.status_code + if status < 200 or status >= 300: + raise ApiException.from_response(status, response.headers, response.body) + try: + document = json.loads(response.body) + except ValueError as e: + raise SerializationException( + f"OpenID configuration at {url} is not a JSON object", e + ) from e + if not isinstance(document, dict): + raise SerializationException( + f"OpenID configuration at {url} is not a JSON object" + ) + endpoint = document.get("token_endpoint") + if not isinstance(endpoint, str) or not endpoint: + raise SerializationException( + f"OpenID configuration at {url} has no valid token_endpoint" + ) + return endpoint diff --git a/zitadel_client/auth/personal_access_token_authenticator.py b/zitadel_client/auth/personal_access_token_authenticator.py index 000c06d6..60c7357d 100644 --- a/zitadel_client/auth/personal_access_token_authenticator.py +++ b/zitadel_client/auth/personal_access_token_authenticator.py @@ -1,19 +1,34 @@ from typing import Dict -from zitadel_client.auth.authenticator import Authenticator -from zitadel_client.utils.url_util import URLUtil +from zitadel_client.auth.base_authenticator import BaseAuthenticator +from zitadel_client.auth.oauth_authenticator import require_text +from zitadel_client.auth.open_id import OpenId -class PersonalAccessTokenAuthenticator(Authenticator): +class PersonalAccessTokenAuthenticator(BaseAuthenticator): """ Personal Access Token Authenticator. - Uses a static personal access token for API authentication. + Uses a static personal access token (PAT) for API authentication. A PAT is + a long-lived bearer credential minted out-of-band in the Zitadel console, + so no token exchange is required: the token is attached verbatim on every + request. """ def __init__(self, host: str, token: str): - super().__init__(URLUtil.build_hostname(host)) - self.token = token + """ + Constructs a PersonalAccessTokenAuthenticator. + + :param host: The base URL for the API endpoints. + :param token: The personal access token. + :raises ValueError: If the host is not a valid http or https URL or + the token is empty. + """ + self.host = OpenId(host).get_host_endpoint() + self.token = require_text(token, "Token") + + def get_host(self) -> str: + return self.host def get_auth_headers(self) -> Dict[str, str]: """ @@ -22,3 +37,7 @@ def get_auth_headers(self) -> Dict[str, str]: :return: A dictionary containing the 'Authorization' header. """ return {"Authorization": "Bearer " + self.token} + + def __repr__(self) -> str: + # Mask the token so it never leaks through repr() / logging. + return f"{type(self).__name__}(host={self.host!r}, token='***')" diff --git a/zitadel_client/auth/web_token_authenticator.py b/zitadel_client/auth/web_token_authenticator.py index 8121f5ee..f36ed7da 100644 --- a/zitadel_client/auth/web_token_authenticator.py +++ b/zitadel_client/auth/web_token_authenticator.py @@ -1,62 +1,69 @@ import json from datetime import datetime, timedelta, timezone -from typing import Dict, Optional, Set +from typing import Any, Dict, Optional -from authlib.integrations.requests_client import OAuth2Session -from authlib.jose import JoseError, jwt +import jwt +from jwt.algorithms import RSAAlgorithm from zitadel_client.auth.oauth_authenticator import ( OAuthAuthenticator, OAuthAuthenticatorBuilder, + require_text, ) from zitadel_client.auth.open_id import OpenId -from zitadel_client.transport_options import TransportOptions + +_ALGORITHMS = ("RS256", "RS384", "RS512") + + +def _load_private_key(private_key: str) -> Any: + """Parse a PEM-encoded RSA private key, raising :class:`ValueError` otherwise.""" + try: + key = RSAAlgorithm(RSAAlgorithm.SHA256).prepare_key(private_key) + except Exception as e: + raise ValueError("Private key is not a valid RSA private key.") from e + if not hasattr(key, "private_numbers"): + raise ValueError("Private key is not a valid RSA private key.") + return key class WebTokenAuthenticator(OAuthAuthenticator): """ - OAuth authenticator implementing the JWT bearer flow. + JWT-bearer authenticator using the JWT Bearer Grant (RFC 7523). - This implementation builds a JWT assertion dynamically in get_grant(). + Signs a short-lived JWT assertion with PyJWT and exchanges it at the + provider's token endpoint for an access token. The exchange is sent through + the SDK's shared transport; see :class:`OAuthAuthenticator` for the caching + and HTTP-injection contract. """ + GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer" + def __init__( self, open_id: OpenId, - auth_scopes: Set[str], + scope: str, jwt_issuer: str, jwt_subject: str, jwt_audience: str, - private_key: str, + private_key: Any, jwt_lifetime: timedelta = timedelta(hours=1), jwt_algorithm: str = "RS256", key_id: Optional[str] = None, - transport_options: Optional[TransportOptions] = None, ): """ Constructs a WebTokenAuthenticator. - :param open_id: The base URL for the OAuth provider. - :param auth_scopes: The scope(s) for the token request. - :param jwt_issuer: The JWT issuer. - :param jwt_subject: The JWT subject. - :param jwt_audience: The JWT audience. - :param private_key: The private key used to sign the JWT. - :param jwt_lifetime: Lifetime of the JWT in seconds. + :param open_id: The OpenID discovery helper for the target host. + :param scope: Space-delimited scope string for the token request. + :param jwt_issuer: The JWT issuer (iss) claim. + :param jwt_subject: The JWT subject (sub) claim. + :param jwt_audience: The JWT audience (aud) claim. + :param private_key: The RSA private key used to sign the JWT. + :param jwt_lifetime: Lifetime of the JWT assertion. :param jwt_algorithm: The JWT signing algorithm (default "RS256"). - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param key_id: Optional key id (kid) header. """ - opts = transport_options or TransportOptions.defaults() - - session = OAuth2Session( - scope=" ".join(auth_scopes), - **opts.to_session_kwargs(), - ) - - if opts.default_headers: - session.headers.update(opts.default_headers) - - super().__init__(open_id, session, transport_options=opts) + super().__init__(open_id, scope) self.jwt_issuer = jwt_issuer self.jwt_subject = jwt_subject self.jwt_audience = jwt_audience @@ -65,162 +72,172 @@ def __init__( self.jwt_algorithm = jwt_algorithm self.key_id = key_id - def get_grant(self) -> Dict[str, str]: - """ - Builds and returns the grant parameters for the JWT bearer flow. - - Dynamically generates a JWT assertion that includes time-sensitive claims. + def get_grant_type(self) -> str: + return self.GRANT_TYPE - :return: A dictionary with the JWT bearer grant parameters. - :raises Exception: If JWT generation fails. + def get_token_request_params(self) -> Dict[str, str]: + """ + Builds the grant-specific parameters for the JWT-bearer flow: a freshly + signed JWT assertion with time-sensitive claims. """ now = datetime.now(timezone.utc) + headers: Dict[str, str] = {} + if self.key_id is not None: + headers["kid"] = self.key_id try: - return { - "grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", - "assertion": ( - jwt.encode( - { - "alg": self.jwt_algorithm, - "typ": "JWT", - "kid": self.key_id, - }, - { - "iss": self.jwt_issuer, - "sub": self.jwt_subject, - "aud": self.jwt_audience, - "iat": int(now.timestamp()), - "exp": int((now + self.jwt_lifetime).timestamp()), - }, - self.private_key, - ) - ), - } - except JoseError as e: - raise Exception("Failed to generate JWT assertion: " + str(e)) from e + assertion = jwt.encode( + { + "iss": self.jwt_issuer, + "sub": self.jwt_subject, + "aud": self.jwt_audience, + "iat": int(now.timestamp()), + "exp": int((now + self.jwt_lifetime).timestamp()), + }, + self.private_key, + algorithm=self.jwt_algorithm, + headers=headers, + ) + except Exception as e: + raise RuntimeError("Unable to sign the JWT assertion") from e + return {"assertion": assertion} @classmethod - def from_json( - cls, host: str, json_path: str, transport_options: Optional[TransportOptions] = None - ) -> "WebTokenAuthenticator": + def from_json(cls, host: str, json_path: str) -> "WebTokenAuthenticator": """ - Create a WebTokenAuthenticatorBuilder instance from a JSON configuration file. + Create a WebTokenAuthenticator from a Zitadel service-account key file. - Expected JSON format: - { - "type": "serviceaccount", - "keyId": "", - "key": "", - "userId": "" - } + Expected JSON format:: + + { + "type": "serviceaccount", + "keyId": "", + "key": "", + "userId": "" + } :param host: Base URL for the API endpoints. - :param json_path: File path to the JSON configuration file. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param json_path: File path to the key file. :return: A new instance of WebTokenAuthenticator. - :raises Exception: If the file cannot be read, the JSON is invalid, - or required keys are missing. + :raises ValueError: If the file cannot be read, is not a JSON object, + lacks the string fields ``userId``, ``keyId`` and ``key``, or + holds an invalid key. """ try: - with open(json_path, "r") as file: - config = json.load(file) - except Exception as e: - raise Exception(f"Unable to read JSON file: {json_path}") from e - + with open(json_path, "r", encoding="utf-8") as file: + content = file.read() + except OSError as e: + raise ValueError(f"Unable to read the key file at {json_path}") from e + try: + config = json.loads(content) + except ValueError: + config = None + if not isinstance(config, dict): + raise ValueError(f"The key file at {json_path} is not a JSON object") user_id = config.get("userId") - private_key = config.get("key") key_id = config.get("keyId") - if not user_id or not key_id or not private_key: - raise Exception("Missing required keys 'userId', 'keyId' or 'key' in JSON file.") - - return ( - (WebTokenAuthenticator.builder(host, user_id, private_key, transport_options=transport_options)) - .key_identifier(key_id) - .build() - ) + private_key = config.get("key") + if ( + not isinstance(user_id, str) + or not isinstance(key_id, str) + or not isinstance(private_key, str) + ): + raise ValueError( + f"The key file at {json_path} must contain the string fields userId, keyId and key" + ) + return cls.builder(host, user_id, private_key).key_id(key_id).build() @staticmethod def builder( - host: str, user_id: str, private_key: str, transport_options: Optional[TransportOptions] = None + host: str, user_id: str, private_key: str ) -> "WebTokenAuthenticatorBuilder": """ Returns a builder for constructing a WebTokenAuthenticator. :param host: The base URL for the OAuth provider. - :param user_id: The user identifier, used as both the issuer and subject. - :param private_key: The private key used to sign the JWT. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param user_id: The user ID, used as both the issuer and the subject. + :param private_key: The PEM-encoded RSA private key used to sign the JWT. :return: A WebTokenAuthenticatorBuilder instance. + :raises ValueError: If the host is not a valid http or https URL, the + user ID is empty, or the key is not an RSA private key. """ - return WebTokenAuthenticatorBuilder(host, user_id, user_id, host, private_key, transport_options=transport_options) + return WebTokenAuthenticatorBuilder(host, user_id, private_key) -class WebTokenAuthenticatorBuilder(OAuthAuthenticatorBuilder["WebTokenAuthenticatorBuilder"]): +class WebTokenAuthenticatorBuilder( + OAuthAuthenticatorBuilder["WebTokenAuthenticatorBuilder"] +): """ Builder for WebTokenAuthenticator. - - Provides a fluent API for configuring and constructing a WebTokenAuthenticator instance. """ - def __init__( - self, - host: str, - jwt_issuer: str, - jwt_subject: str, - jwt_audience: str, - private_key: str, - key_id: Optional[str] = None, - transport_options: Optional[TransportOptions] = None, - ): + def __init__(self, host: str, user_id: str, private_key: str): """ - Initializes the WebTokenAuthenticatorBuilder with required parameters. + Initializes the WebTokenAuthenticatorBuilder. :param host: The base URL for API endpoints. - :param jwt_issuer: The issuer claim for the JWT. - :param jwt_subject: The subject claim for the JWT. - :param jwt_audience: The audience claim for the JWT. - :param private_key: The PEM-formatted private key used for signing the JWT. - :param transport_options: Optional transport options for TLS, proxy, and headers. + :param user_id: The user ID, used as both the issuer and the subject. + :param private_key: The PEM-encoded RSA private key used to sign the JWT. """ - super().__init__(host, transport_options=transport_options) - self.jwt_issuer = jwt_issuer - self.jwt_subject = jwt_subject - self.jwt_audience = jwt_audience - self.private_key = private_key - self.jwt_lifetime = timedelta(hours=1) - self.key_id = key_id + super().__init__(host) + self.user_id = require_text(user_id, "User ID") + self.private_key = _load_private_key(private_key) + self.lifetime = timedelta(hours=1) + self.algorithm = "RS256" + self.kid: Optional[str] = None def token_lifetime_seconds(self, seconds: int) -> "WebTokenAuthenticatorBuilder": """ - Sets the JWT token lifetime in seconds. + Sets the JWT assertion lifetime in seconds. - :param seconds: Lifetime of the JWT in seconds. + :param seconds: Lifetime of the JWT in seconds; must be positive. :return: The builder instance. + :raises ValueError: If the lifetime is not positive. """ - self.jwt_lifetime = timedelta(seconds=seconds) + if isinstance(seconds, bool) or not isinstance(seconds, int) or seconds <= 0: + raise ValueError("Token lifetime must be a positive number of seconds.") + self.lifetime = timedelta(seconds=seconds) return self - def build(self) -> WebTokenAuthenticator: + def jwt_algorithm(self, jwt_algorithm: str) -> "WebTokenAuthenticatorBuilder": """ - Builds and returns a new WebTokenAuthenticator instance using the configured parameters. + Sets the JWT signing algorithm. - This method inlines the JWT assertion generation logic and passes all required - configuration to the WebTokenAuthenticator constructor. + :param jwt_algorithm: One of "RS256", "RS384" or "RS512". + :return: The builder instance. + :raises ValueError: If the algorithm is not supported. + """ + if jwt_algorithm not in _ALGORITHMS: + raise ValueError( + f"Unsupported JWT algorithm '{jwt_algorithm}'; use RS256, RS384 or RS512." + ) + self.algorithm = jwt_algorithm + return self + + def key_id(self, key_id: str) -> "WebTokenAuthenticatorBuilder": + """ + Sets the key ID sent as the ``kid`` header of the assertion. + + :param key_id: The key identifier. + :return: The builder instance. + :raises ValueError: If the key ID is empty. + """ + self.kid = require_text(key_id, "Key ID") + return self + + def build(self) -> WebTokenAuthenticator: + """ + Builds and returns a new WebTokenAuthenticator instance. :return: A new WebTokenAuthenticator instance. """ return WebTokenAuthenticator( open_id=self.open_id, - auth_scopes=self.auth_scopes, - jwt_issuer=self.jwt_issuer, - jwt_subject=self.jwt_subject, - jwt_audience=self.jwt_audience, + scope=self.scope, + jwt_issuer=self.user_id, + jwt_subject=self.user_id, + jwt_audience=self.open_id.get_host_endpoint(), private_key=self.private_key, - jwt_lifetime=self.jwt_lifetime, - key_id=self.key_id, - transport_options=self.transport_options, + jwt_lifetime=self.lifetime, + jwt_algorithm=self.algorithm, + key_id=self.kid, ) - - def key_identifier(self, key_id: Optional[str]) -> "WebTokenAuthenticatorBuilder": - self.key_id = key_id - return self diff --git a/zitadel_client/auth/zitadel_access_token_authenticator.py b/zitadel_client/auth/zitadel_access_token_authenticator.py new file mode 100644 index 00000000..3a59b7c8 --- /dev/null +++ b/zitadel_client/auth/zitadel_access_token_authenticator.py @@ -0,0 +1,15 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from .bearer_authenticator import BearerAuthenticator + + +class ZitadelAccessTokenAuthenticator(BearerAuthenticator): + """Scheme-specific authenticator for the zitadelAccessToken security scheme.""" + + def __init__(self, host: str, token: str): + super().__init__(host, token) diff --git a/zitadel_client/configuration.py b/zitadel_client/configuration.py index 964cff7d..d3c3a29b 100644 --- a/zitadel_client/configuration.py +++ b/zitadel_client/configuration.py @@ -1,224 +1,158 @@ -import copy -import http.client as httplib -import logging -import multiprocessing -import platform -import sys -from logging import FileHandler -from typing import Any, Dict, Optional, Union +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -from typing_extensions import Self +from dataclasses import dataclass, field +from types import MappingProxyType +from typing import Dict, Mapping, Optional -from zitadel_client.auth.authenticator import Authenticator -from zitadel_client.version import Version +from .server_configuration import ServerConfiguration +@dataclass(frozen=True) class Configuration: - """This class contains various settings of the API client.""" - - USER_AGENT = " ".join( - [ - f"zitadel-client/{Version.VERSION}", - "(" - + "; ".join( - [ - "lang=python", - f"lang_version={platform.python_version()}", - f"os={platform.system()}", - f"arch={platform.machine()}", - ] - ) - + ")", - ] - ).lower() + """API-level configuration for generated client classes. - def __init__( - self, - authenticator: Authenticator, - ssl_ca_cert: Optional[str] = None, - retries: Optional[int] = None, - ca_cert_data: Optional[Union[str, bytes]] = None, - *, - debug: Optional[bool] = None, - ) -> None: - """Constructor""" - self._user_agent = Configuration.USER_AGENT - self.authenticator = authenticator - self.refresh_api_key_hook = None - self.logger = { - "package_logger": logging.getLogger("zitadel_client"), - "urllib3_logger": logging.getLogger("urllib3"), - } - self.logger_format = "%(asctime)s %(levelname)s %(message)s" - self.logger_stream_handler = None - self.logger_file_handler: Optional[FileHandler] = None - self.logger_file = None - if debug is not None: - self.debug = debug - else: - self.__debug = False - self.verify_ssl = True - self.ssl_ca_cert = ssl_ca_cert - self.ca_cert_data = ca_cert_data - self.cert_file = None - self.key_file = None - self.assert_hostname = None - self.tls_server_name = None - - # noinspection PyUnresolvedReferences - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """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. + Holds the base URL and default headers that are applied to every API + request. Transport-level settings (TLS, proxy, timeouts) belong in + :class:`TransportOptions` and are configured on the + :class:`DefaultApiClient`. + + This class is immutable and thread-safe. Use :meth:`builder` to create + instances:: + + config = Configuration.builder() \\ + .base_url('https://api.example.com') \\ + .default_header('Authorization', 'Bearer token') \\ + .build() """ - self.safe_chars_for_path_param = "" - self.retries = retries - # Enable client side validation - self.client_side_validation = True - self.socket_options = None - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - self.date_format = "%Y-%m-%d" - self.default_headers: Dict[str, str] = {} - self.proxy_url: Optional[str] = None - - def __deepcopy__(self, memo: Dict[int, Any]) -> Self: - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ("logger", "logger_file_handler"): - # noinspection PyArgumentList - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name: str, value: Any) -> None: - object.__setattr__(self, name, value) - - @property - def logger_file(self) -> Optional[str]: - """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. - - :type: str - """ - return self.__logger_file + base_url: str = "https://zitadel.com" + """The base URL for all API requests. - @logger_file.setter - def logger_file(self, value: Optional[str]) -> None: - """The logger file. + Defaults to the first server URL from the OpenAPI specification. + """ - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. + default_headers: Mapping[str, str] = field( + default_factory=lambda: MappingProxyType({}) + ) + """Default headers included in every API request. - :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 self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self) -> bool: - """Debug status - - :type: bool - """ - return self.__debug + These headers are merged after transport-level headers from + :class:`TransportOptions` but before operation-specific headers + and authentication headers. + """ - @debug.setter - def debug(self, value: bool) -> None: - """Debug status + def __post_init__(self) -> None: + if not isinstance(self.default_headers, MappingProxyType): + object.__setattr__( + self, "default_headers", MappingProxyType(dict(self.default_headers)) + ) - :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 self.logger.items(): - 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 self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self) -> str: - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :type: str + @classmethod + def builder(cls) -> "ConfigurationBuilder": + """Create a new builder for constructing Configuration instances.""" + return ConfigurationBuilder() + + @classmethod + def default_configuration(cls) -> "Configuration": + """Return a Configuration with default values. + + A fresh instance every call: the SDK keeps no process-wide default a + caller could swap out from under another caller. """ - return self.__logger_format + return ConfigurationBuilder().build() - @logger_format.setter - def logger_format(self, value: str) -> None: - """The logger format. - The logger_formatter will be updated when sets logger_format. +class ConfigurationBuilder: + """Builder for creating immutable :class:`Configuration` instances. - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) + Example:: - @staticmethod - def to_debug_report() -> str: - """Gets the essential information for debugging. + config = Configuration.builder() \\ + .base_url('https://api.example.com') \\ + .default_header('X-Custom', 'value') \\ + .build() + """ - :return: The report for debugging. - """ - return ( - "Python SDK Debug Report:\n" - "OS: {env}\n" - "Python Version: {pyversion}\n" - "Version of the API: 1.0.0\n" - "SDK Package Version: 0.0.1".format(env=sys.platform, pyversion=sys.version) - ) + def __init__(self) -> None: + self._base_url: str = "https://zitadel.com" + self._default_headers: Dict[str, str] = {} - @property - def host(self) -> str: - """Return generated host.""" - return self.authenticator.get_host() + def base_url(self, base_url: str) -> "ConfigurationBuilder": + """Set the base URL for all API requests. + + Args: + base_url: The base URL. - @property - def user_agent(self) -> str: + Returns: + This builder. """ - Get the user agent string. + self._base_url = base_url + return self + + def default_header(self, name: str, value: str) -> "ConfigurationBuilder": + """Add a single default header to include in every API request. + + Args: + name: Header name. + value: Header value. Returns: - str: The current value of the user agent. + This builder. """ - return self._user_agent + self._default_headers[name] = value + return self + + def default_headers(self, headers: Dict[str, str]) -> "ConfigurationBuilder": + """Add multiple default headers to include in every API request. - @user_agent.setter - def user_agent(self, value: str) -> None: + Args: + headers: Map of header names to values. + + Returns: + This builder. """ - Set the user agent string. + self._default_headers.update(headers) + return self + + def server( + self, + server_config: ServerConfiguration, + variables: Optional[Dict[str, str]] = None, + ) -> "ConfigurationBuilder": + """Set the base URL by resolving a server configuration with optional variable overrides. + + Calls :meth:`ServerConfiguration.get_url` to resolve the URL template + with the given variable overrides and stores the result as the base URL. + If the user also calls :meth:`base_url` after this method, the explicit + base URL wins (last-write-wins). Args: - value (str): The new user agent string to set. + server_config: The server configuration to resolve. + variables: Variable name to value overrides. If ``None``, all + variables use their default values. + + Returns: + This builder. + + Raises: + ValueError: If an override value is not in the variable's + enum_values. """ - self._user_agent = value + self._base_url = server_config.get_url(variables) + return self + + def build(self) -> Configuration: + """Build and return an immutable Configuration instance. + + Returns: + The configured instance. + """ + return Configuration( + base_url=self._base_url, + default_headers=self._default_headers, + ) diff --git a/zitadel_client/default_api_client.py b/zitadel_client/default_api_client.py new file mode 100644 index 00000000..91fcb836 --- /dev/null +++ b/zitadel_client/default_api_client.py @@ -0,0 +1,1045 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Dict, FrozenSet, Optional, Tuple +import base64 +import gzip +import mimetypes +import re +import ssl +import uuid +import zlib +from urllib.parse import ( + quote as _url_quote, + unquote as _url_unquote, + urlsplit, + urlunsplit, +) + +import urllib3 +import urllib3.exceptions + +from zitadel_client.api_http_response import ApiHttpResponse +from zitadel_client.errors import ( + ApiException, + NetworkException, + NetworkTimeoutException, +) +from zitadel_client.transport_options import TransportOptions + +from types import ModuleType + +_brotli: Optional[ModuleType] = None +try: + import brotli + + _brotli = brotli +except ImportError: + pass + +_zstandard: Optional[ModuleType] = None +try: + import zstandard + + _zstandard = zstandard +except ImportError: + pass + + +def _network_exception(error: urllib3.exceptions.HTTPError) -> NetworkException: + """Classify a urllib3 transport failure as a network error or a timeout. + + Retries are disabled (``Retry(total=0)``), so a failure before the + response arrives surfaces as ``MaxRetryError`` wrapping the real cause in + ``reason``. ``NewConnectionError`` subclasses ``ConnectTimeoutError`` in + urllib3 2.x, so it is checked first: a refused connection or a failed DNS + lookup is a network error, not a timeout. + """ + cause: BaseException = error + if isinstance(error, urllib3.exceptions.MaxRetryError) and error.reason is not None: + cause = error.reason + if isinstance(cause, urllib3.exceptions.NewConnectionError): + return NetworkException(message=str(error)) + if isinstance(cause, (urllib3.exceptions.TimeoutError, TimeoutError)): + return NetworkTimeoutException(message=str(error)) + return NetworkException(message=str(error)) + + +def _supported_encodings() -> str: + """Return a comma-separated string of supported content encodings. + + Includes gzip and deflate unconditionally. Brotli and zstd are + included when their respective packages are installed. + + Returns: + Supported encoding names for the Accept-Encoding header. + """ + encodings = ["gzip", "deflate"] + if _brotli is not None: + encodings.append("br") + if _zstandard is not None: + encodings.append("zstd") + return ", ".join(encodings) + + +_CHARSET_RE = re.compile(r'charset\s*=\s*"?([^";\s]+)"?', re.IGNORECASE) + + +def _charset_from_content_type(content_type: str) -> Optional[str]: + """Extract the charset parameter from a Content-Type header value. + + Returns ``None`` when the header is empty or has no ``charset=`` parameter. + """ + if not content_type: + return None + match = _CHARSET_RE.search(content_type) + if not match: + return None + return match.group(1).strip() + + +def _resolve_utf16_charset(charset: str, data: bytes) -> str: + """Resolve a bare ``utf-16`` label to an explicit byte order. + + Python's ``utf-16`` codec defaults to the platform-native byte order + (little-endian on common hardware) when the body carries no BOM. That + disagrees with other SDKs and with RFC 2781, which specifies that a + UTF-16 stream without a BOM defaults to BIG-ENDIAN. This normalizes a + bare ``utf-16`` / ``utf16`` label so that: + + * a leading little-endian BOM (``FF FE``) decodes as little-endian; + * a leading big-endian BOM (``FE FF``) decodes as big-endian; + * no BOM decodes as big-endian (UTF-16BE) per RFC 2781. + + Labels that already pin an explicit byte order (``utf-16le`` / + ``utf-16be``) are returned unchanged so an explicit choice always wins. + When a BOM is present the bare ``utf-16`` label is kept so Python's + codec auto-detects the byte order and strips the mark; only the BOM-less + case is rewritten to ``utf-16-be``. + """ + normalized = charset.lower().replace("_", "-") + if normalized not in ("utf-16", "utf16"): + return charset + if data[:2] in (b"\xff\xfe", b"\xfe\xff"): + return charset + return "utf-16-be" + + +def _decode_with_charset(data: bytes, content_type: str) -> str: + """Decode bytes using the charset from a Content-Type header. + + Falls back to UTF-8 when the charset is missing or unknown. Uses + ``errors='replace'`` so malformed bytes never raise. A BOM-less + ``utf-16`` body is decoded as big-endian per RFC 2781. + """ + charset = _charset_from_content_type(content_type) or "utf-8" + charset = _resolve_utf16_charset(charset, data) + try: + return data.decode(charset, errors="replace") + except LookupError: + return data.decode("utf-8", errors="replace") + + +def _sanitize_multipart_filename(filename: str) -> Tuple[str, Optional[str]]: + """Sanitize a multipart filename for use in a Content-Disposition header. + + Returns a tuple of ``(ascii_fallback, rfc5987_value_or_None)``. The first + element is suitable for ``filename="..."`` after backslash-escaping ``"`` + and ``\\``. The second is suitable for ``filename*=UTF-8''`` when + the original filename contained non-ASCII characters. + + Raises ``ValueError`` if the filename contains CR, LF, or NUL. + """ + if any(ch in filename for ch in ("\r", "\n", "\x00")): + raise ValueError( + "Multipart filename must not contain CR, LF, or NUL characters" + ) + try: + filename.encode("ascii") + is_ascii = True + except UnicodeEncodeError: + is_ascii = False + if is_ascii: + escaped = filename.replace("\\", "\\\\").replace('"', '\\"') + return escaped, None + ascii_fallback = filename.encode("ascii", errors="replace").decode("ascii") + ascii_fallback = ascii_fallback.replace("\\", "\\\\").replace('"', '\\"') + rfc5987 = "UTF-8''" + _url_quote(filename, safe="") + return ascii_fallback, rfc5987 + + +def _sanitize_multipart_field_name(name: str) -> str: + """Sanitize a multipart field name for a Content-Disposition header. + + Unlike :func:`_sanitize_multipart_filename`, a non-ASCII field name is + NOT transliterated to ``?`` -- per RFC 7578 section 5.1.1 field names are + carried verbatim and most servers decode the part headers as UTF-8. The + name is emitted raw (UTF-8 on the wire) after backslash-escaping ``"`` and + ``\\`` so it cannot terminate the quoted ``name="..."`` value early. CR, + LF, and NUL are rejected to prevent header injection. + + Raises ``ValueError`` if the name contains CR, LF, or NUL. + """ + if any(ch in name for ch in ("\r", "\n", "\x00")): + raise ValueError( + "Multipart field name must not contain CR, LF, or NUL characters" + ) + return name.replace("\\", "\\\\").replace('"', '\\"') + + +def _guess_content_type(filename: Optional[str]) -> str: + """Guess a Content-Type from a filename, defaulting to octet-stream.""" + if not filename: + return "application/octet-stream" + guessed, _ = mimetypes.guess_type(filename) + return guessed or "application/octet-stream" + + +def _is_text_content_type(content_type: str) -> bool: + """Return True if the content type represents text that can be decoded as UTF-8.""" + media_type = content_type.split(";")[0].strip().lower() + if not media_type: + return True + if media_type.startswith("text/"): + return True + return ( + media_type + in ( + "application/json", + "application/xml", + "application/javascript", + ) + or media_type.endswith("+json") + or media_type.endswith("+xml") + ) + + +class DefaultApiClient: + """Default implementation of :class:`ApiClient` using urllib3. + + Applies transport-level settings from :class:`TransportOptions`: TLS + verification, custom CA certificates, proxy routing, timeouts, redirect + handling, ``User-Agent`` injection, ``X-Request-ID`` injection, and + transport-level default headers. + + Header merge order (lowest to highest priority): + + 1. :attr:`TransportOptions.default_headers` -- transport-level defaults + 2. Caller-provided headers (from :class:`BaseApi` -- includes config + defaults, auth, operation headers) + 3. :attr:`TransportOptions.user_agent` -- injected if not already set + 4. :attr:`TransportOptions.inject_request_id` -- injected if not already set + """ + + def __init__( + self, + transport_options: Optional[TransportOptions] = None, + pool_manager: Optional[Any] = None, + ) -> None: + """Create a new DefaultApiClient. + + Args: + transport_options: Transport configuration to apply. If ``None``, + default transport options are used. + pool_manager: Pre-configured urllib3 pool manager. If provided, + transport_options TLS/proxy settings are ignored for pool + creation, but header injection settings still apply. + """ + if transport_options is None: + transport_options = TransportOptions.builder().build() + self._transport_options = transport_options + self._closed = False + + if pool_manager is not None: + self._pool_manager = pool_manager + else: + kwargs: Dict[str, Any] = {} + + # --- TLS / SSL --- + if not transport_options.verify_ssl: + kwargs["cert_reqs"] = "CERT_NONE" + urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) + elif transport_options.ca_cert_path: + # Gap T4: fail fast on a user-supplied CA cert that cannot be + # read or parsed rather than silently falling back to the + # system trust store. If the caller explicitly asked for SSL + # pinning we must not pretend it succeeded -- validate the + # PEM eagerly at construction. + try: + ctx = ssl.create_default_context() + ctx.load_verify_locations(cafile=transport_options.ca_cert_path) + except (OSError, ssl.SSLError) as e: + raise ValueError( + "failed to load CA certificate from " + f"{transport_options.ca_cert_path!r}: {e}" + ) from e + kwargs["ca_certs"] = transport_options.ca_cert_path + kwargs["cert_reqs"] = "CERT_REQUIRED" + + # --- Proxy --- + if transport_options.proxy: + # urllib3 2.x does NOT auto-extract userinfo embedded in the + # proxy URL (``ProxyManager('http://user:pass@host').proxy_headers`` + # is ``{}``), so an authenticated proxy would 407 and the SDK + # would be non-functional. Parse the userinfo here and emit an + # explicit ``Proxy-Authorization: Basic base64(user:pass)`` + # header, matching the other 11 SDKs. The userinfo is + # percent-decoded before base64 (mirroring Java/Kotlin which + # URLDecode first) so credentials containing reserved + # characters round-trip correctly. + parsed_proxy = urlsplit(transport_options.proxy) + if parsed_proxy.username is not None: + user = _url_unquote(parsed_proxy.username) + pwd = _url_unquote(parsed_proxy.password or "") + # Build the header manually rather than via + # ``urllib3.util.make_headers`` (which is untyped and trips + # mypy's no-untyped-call in strict mode). Same wire result: + # ``Proxy-Authorization: Basic base64(user:pass)``. + _proxy_token = base64.b64encode( + f"{user}:{pwd}".encode("utf-8") + ).decode("ascii") + kwargs["proxy_headers"] = { + "proxy-authorization": f"Basic {_proxy_token}" + } + self._pool_manager = urllib3.ProxyManager( + transport_options.proxy, **kwargs + ) + else: + self._pool_manager = urllib3.PoolManager(**kwargs) + + def close(self) -> None: + """Close the underlying urllib3 PoolManager and release sockets. + + After calling this method the client must not be reused. Calling + :meth:`send_request` on a closed client raises :class:`RuntimeError`. + ``close()`` itself is idempotent. + """ + self._closed = True + if self._pool_manager is not None: + self._pool_manager.clear() + + def __enter__(self) -> "DefaultApiClient": + return self + + def __exit__( + self, + exc_type: Any, + exc_val: Any, + exc_tb: Any, + ) -> None: + self.close() + + def send_request( + self, + method: str, + url: str, + headers: Dict[str, str], + body: Any = None, + no_redirect: bool = False, + ) -> ApiHttpResponse: + """Send an HTTP request and return the response. + + Applies transport-level header injection (default headers, User-Agent, + X-Request-ID) before sending. The merge order ensures transport + defaults have lowest priority. + + Args: + method: HTTP method (GET, POST, PUT, DELETE, etc.). + url: Fully qualified URL. + headers: HTTP headers from the caller. + body: Request body (serialized JSON string, bytes, dict for + multipart, or None). + no_redirect: When ``True``, redirects are not followed for this + request; the first 3xx response is returned to the caller + verbatim (status, body, headers). Used by the OAuth2 token + manager so a credential-bearing POST is never silently + replayed against a redirect target -- the token manager + inspects and rejects the 3xx itself. + + Returns: + :class:`ApiHttpResponse` containing status code, body, and headers. + """ + # Use-after-close is a wrong call order, so it raises the + # invalid-state RuntimeError rather than a foreign urllib3 exception + # (or silently succeeding against a cleared pool), matching the + # closed-flag guard the other SDKs use. + if self._closed: + raise RuntimeError("ApiClient has been closed and can no longer be used") + + # --- Merge headers: transport defaults < caller headers < injected --- + merged_headers: Dict[str, str] = dict(self._transport_options.default_headers) + merged_headers.update(headers) + + if ( + self._transport_options.user_agent is not None + and "User-Agent" not in merged_headers + ): + merged_headers["User-Agent"] = self._transport_options.user_agent + + if ( + self._transport_options.inject_request_id + and "X-Request-ID" not in merged_headers + ): + merged_headers["X-Request-ID"] = str(uuid.uuid4()) + + merged_headers.setdefault("Accept-Encoding", _supported_encodings()) + + if isinstance(body, dict): + boundary = str(uuid.uuid4()) + merged_headers["Content-Type"] = f"multipart/form-data; boundary={boundary}" + encoded_body = self._build_multipart_body(body, boundary) + elif isinstance(body, bytes): + encoded_body = body + elif isinstance(body, str): + encoded_body = body.encode("utf-8") + else: + encoded_body = None + merged_headers.pop("Content-Type", None) + + # Some servers / WAFs treat POST/PUT/PATCH with no body and + # no Content-Length as malformed (411 Length Required) or + # behave inconsistently. Emit an explicit `Content-Length: 0` + # on body-bearing verbs when the body is None, matching + # Kotlin's `ByteArray(0)` and the other 11 SDKs. + if encoded_body is None and method.upper() in ("POST", "PUT", "PATCH"): + merged_headers.setdefault("Content-Length", "0") + + # --- Timeout --- + request_kwargs: Dict[str, Any] = {} + if self._transport_options.timeout is not None: + timeout_seconds = self._transport_options.timeout / 1000.0 + request_kwargs["timeout"] = urllib3.Timeout(total=timeout_seconds) + + # --- Redirects --- + # Gap BH / Bucket 4.1: urllib3's built-in redirect handling (via + # Retry.remove_headers_on_redirect) does not give us the three + # security guards we need: + # 1. Scheme allowlist -- a malicious Location: file:/// or + # data:... must NOT be followed. urllib3 will happily try + # anything that looks like a URL. + # 2. Authorization strip on HTTPS->HTTP downgrade -- urllib3 + # only compares scheme+host+port for same-origin, and treats + # a scheme change as origin change today, but we want the + # guard explicit and matching the other 11 SDKs' behaviour. + # 3. Proxy-Authorization clear on proxy_headers path -- the + # ProxyManager keeps Proxy-Authorization in its own header + # bag (pool_manager.proxy_headers) which urllib3.Retry's + # remove_headers_on_redirect cannot reach. + # We disable urllib3's redirect handling entirely and run the + # loop manually, mirroring the canonical Rust / Java / Kotlin + # implementations. + request_kwargs["redirect"] = False + request_kwargs["retries"] = urllib3.Retry( + total=0, + redirect=0, + status=0, + read=0, + other=0, + connect=0, + ) + + try: + response = self._pool_manager.request( + method, + url, + headers=merged_headers, + body=encoded_body, + preload_content=False, + decode_content=False, + **request_kwargs, + ) + + # no_redirect means "do not follow redirects; return the 3xx + # response as-is" -- not "throw on redirect". When redirects are + # disabled (either no_redirect or follow_redirects=False) the loop + # is skipped and the first 3xx surfaces to the caller verbatim, + # matching java/csharp/go/php/node/dart/elixir. + if self._transport_options.follow_redirects and not no_redirect: + response = self._follow_redirects( + response=response, + initial_url=url, + initial_method=method, + initial_body=encoded_body, + initial_headers=merged_headers, + request_kwargs=request_kwargs, + ) + + # The body read happens INSIDE the transport try/catch so a + # connection-reset / read-timeout / truncated-chunked failure + # that occurs AFTER the response headers are received is wrapped + # in the SDK's uniform ApiException (with the underlying error + # preserved as the cause) rather than leaking a raw urllib3 + # exception. This gives callers one error type for the whole + # transport phase, matching Java/Swift/Ruby/PHP/Elixir. + raw_data = response.read() + + # A malformed Content-Encoding body (e.g. a server that + # advertises `gzip` but sends truncated / non-gzip bytes) arrived + # with a real response, so it surfaces as an ApiException + # carrying that response's status -- never a NetworkException and + # never a raw gzip.BadGzipFile / zlib.error / OSError. + content_encoding = (response.headers.get("content-encoding") or "").lower() + try: + decompressed = self._decompress_body(raw_data, content_encoding) + except ApiException: + raise + except Exception as e: + # gzip.BadGzipFile (OSError), zlib.error, brotli.error, and + # zstandard.ZstdError are all direct/indirect subclasses of + # Exception with no shared codec base, so they are caught here + # as a group and re-raised as the SDK's uniform ApiException. + raise ApiException( + status_code=response.status, + message=f"failed to decompress response body (content-encoding={content_encoding!r}): {e}", + response_headers=dict(response.headers), + ) from e + except urllib3.exceptions.LocationValueError as e: + # An unparseable request URL is a caller mistake, not a network + # failure: urllib3 reports it as an HTTPError subclass, so it is + # caught before the network handler below. + raise ValueError(f"Invalid request URL: {url}: {e}") from e + except urllib3.exceptions.HTTPError as e: + raise _network_exception(e) from e + + content_type = response.headers.get("content-type") or "" + # Empty bodies flow through the same content-type decode path as the + # other 11 SDKs rather than short-circuiting to ''. For an empty body + # _decode_with_charset returns '' and base64-encoding empty bytes also + # returns '', so the observable output is identical -- this keeps the + # decode path structurally uniform across all transports. + response_body = ( + _decode_with_charset(decompressed, content_type) + if _is_text_content_type(content_type) + else base64.b64encode(decompressed).decode("ascii") + ) + # Gap BE+BF: response header keys are normalised to lowercase so + # callers can look them up consistently regardless of the casing the + # server used (HTTP header names are case-insensitive per RFC 7230 + # section 3.2, and HTTP/2 mandates lowercase on the wire). Repeated + # header lines (for example multiple Link or Set-Cookie headers) are + # joined with ", " to preserve order per RFC 7230 section 3.2.2. + # The joined form is not directly parseable for Set-Cookie; callers + # needing structured cookie access should use http.cookies.SimpleCookie + # or read response.headers.getlist('set-cookie') on the raw urllib3 + # HTTPHeaderDict. + response_headers: Dict[str, str] = {} + if response.headers: + for name in set(response.headers.keys()): + values = ( + response.headers.getlist(name) + if hasattr(response.headers, "getlist") + else [response.headers[name]] + ) + response_headers[name.lower()] = ", ".join(values) + + return ApiHttpResponse( + status_code=response.status, body=response_body, headers=response_headers + ) + + # Sensitive headers that MUST be stripped on a cross-origin redirect + # to avoid leaking bearer tokens / cookies / proxy credentials to an + # attacker-controlled host. Names are compared case-insensitively. + # + # The spec-declared API-key header names (none declared in this spec) + # are merged in at codegen time so an API key sent in a custom header + # (e.g. ``X-API-Key``) is also treated as a credential and stripped on + # a cross-origin hop, matching the canonical SDKs. + _SENSITIVE_HEADERS: FrozenSet[str] = frozenset( + [ + "authorization", + "cookie", + "proxy-authorization", + ] + ) + + # Body-related headers that must be cleared when the follow-up has + # no body (303 coercion, or 301/302 demotion of POST -> GET). + _BODY_HEADERS: FrozenSet[str] = frozenset(["content-type", "content-length"]) + + _REDIRECT_STATUSES: FrozenSet[int] = frozenset([301, 302, 303, 307, 308]) + + def _follow_redirects( + self, + response: Any, + initial_url: str, + initial_method: str, + initial_body: Any, + initial_headers: Dict[str, str], + request_kwargs: Dict[str, Any], + ) -> Any: + """Drive the redirect loop manually with security guards. + + urllib3's built-in redirect handling is disabled by the caller; + this method walks ``Location`` headers up to the configured + ``max_redirects`` budget, applying: + + 1. Scheme allowlist -- only ``http`` / ``https`` targets are + followed. Anything else (``file:``, ``data:``, ``javascript:``) + raises :class:`ApiException`. + 2. Authorization / Cookie / Proxy-Authorization strip on every + cross-origin hop, where origin is scheme + host + effective + port. An HTTPS -> HTTP downgrade is by definition cross-origin + because the scheme differs. + 3. ``proxy_headers`` Proxy-Authorization is also cleared on the + pool manager so credentials configured at the transport layer + are not silently re-sent across the downgrade. + + The 303 -> GET coercion and 301/302 demotion of non-idempotent + methods are handled here for completeness, but those are about + method semantics rather than security and mirror the existing + Java / Kotlin behaviour. + """ + max_redirects = ( + self._transport_options.max_redirects + if self._transport_options.max_redirects is not None + else 20 + ) + redirects_remaining = max_redirects + current_url = initial_url + current_method = initial_method + current_body = initial_body + current_headers: Dict[str, str] = dict(initial_headers) + # Snapshot the pool manager's proxy_headers so we can restore + # them after the loop -- we only mutate them for the duration + # of the redirect chain so subsequent unrelated requests are + # unaffected. + original_proxy_headers: Optional[Dict[str, str]] = None + proxy_headers_attr = getattr(self._pool_manager, "proxy_headers", None) + if isinstance(proxy_headers_attr, dict): + original_proxy_headers = dict(proxy_headers_attr) + + try: + while ( + response.status in self._REDIRECT_STATUSES and redirects_remaining > 0 + ): + location = ( + response.headers.get("location") if response.headers else None + ) + if not location: + break + + next_url = self._resolve_url(current_url, location) + + # Guard 1: scheme allowlist. + parsed_next = urlsplit(next_url) + scheme = (parsed_next.scheme or "").lower() + if scheme not in ("http", "https"): + raise ApiException( + status_code=response.status, + message=f"Refusing to follow redirect to non-HTTP(S) URL: {next_url}", + response_headers=dict(response.headers), + ) + + same_origin = self._same_origin(current_url, next_url) + + # Guard 1c (3.3): HTTPS -> HTTP downgrade with a request + # body must not silently replay the body over plaintext. + # The Authorization strip below handles credential leakage, + # but body content can itself be sensitive (form fields, + # JSON payloads), so refuse outright when a body would be + # carried across the downgrade. 303 still coerces to GET + # and drops the body below, so the guard only triggers on + # 307 / 308 (body preserved) and on 301 / 302 of a body- + # bearing non-idempotent method that the matrix expects + # to replay. + if ( + current_body is not None + and self._is_https_to_http_downgrade(current_url, next_url) + and response.status in (307, 308) + ): + raise ApiException( + status_code=response.status, + message=( + f"Refusing to replay request body across HTTPS -> HTTP " + f"downgrade redirect ({response.status}) to {next_url}" + ), + response_headers=dict(response.headers), + ) + + # Pick follow-up method/body per RFC 7231 section 6.4 / RFC 7538. + status_code = response.status + if status_code in (307, 308): + next_method = current_method + next_body = current_body + elif status_code == 303: + next_method = "GET" + next_body = None + elif current_method.upper() in ("GET", "HEAD"): + next_method = current_method + next_body = current_body + else: + next_method = "GET" + next_body = None + + next_headers: Dict[str, str] = dict(current_headers) + if not same_origin: + # Guard 2: strip Authorization / Cookie / + # Proxy-Authorization on cross-origin hops, including + # the HTTPS -> HTTP downgrade case. + for key in list(next_headers.keys()): + if key.lower() in self._SENSITIVE_HEADERS: + del next_headers[key] + # Guard 3: clear Proxy-Authorization that lives on + # the pool manager's proxy_headers bag too. This is + # the path urllib3.Retry's remove_headers_on_redirect + # cannot reach. + if isinstance(proxy_headers_attr, dict): + for key in list(proxy_headers_attr.keys()): + if key.lower() == "proxy-authorization": + del proxy_headers_attr[key] + + # Drop body-bearing headers when the follow-up carries + # no body (303 coercion, or 301/302 method demotion). + drop_body_headers = next_body is None and current_body is not None + if drop_body_headers: + for key in list(next_headers.keys()): + if key.lower() in self._BODY_HEADERS: + del next_headers[key] + + # Read and release the prior response before issuing the + # follow-up so urllib3 returns the connection to the pool. + try: + response.read() + finally: + response.release_conn() + + response = self._pool_manager.request( + next_method, + next_url, + headers=next_headers, + body=next_body, + preload_content=False, + decode_content=False, + **request_kwargs, + ) + + current_url = next_url + current_method = next_method + current_body = next_body + current_headers = next_headers + redirects_remaining -= 1 + finally: + # Restore the original proxy_headers snapshot so subsequent + # requests issued through the same client see the original + # configuration. Without this, a cross-origin redirect would + # permanently strip Proxy-Authorization for the lifetime of + # the pool manager. + if original_proxy_headers is not None and isinstance( + proxy_headers_attr, dict + ): + proxy_headers_attr.clear() + proxy_headers_attr.update(original_proxy_headers) + + # Redirect-budget exhaustion must surface as a typed SDK error rather + # than silently handing back the final 3xx as if it were a normal + # response. We only got here with a redirect status still set (and a + # Location to follow) when the loop ran out of budget -- the + # no-Location case breaks out and is a legitimate terminal 3xx. + if ( + response.status in self._REDIRECT_STATUSES + and response.headers + and response.headers.get("location") + ): + raise ApiException( + status_code=response.status, + message=f"Too many redirects (exceeded max_redirects={max_redirects})", + response_headers=dict(response.headers), + ) + + return response + + @staticmethod + def _resolve_url(base_url: str, location: str) -> str: + """Resolve a ``Location`` header against the request URL. + + Accepts absolute URLs (returned verbatim modulo scheme casing) + and relative URLs (resolved against ``base_url``). Uses + :mod:`urllib.parse` rather than ``urljoin`` so we surface the + raw scheme of an absolute Location for the scheme-allowlist + guard rather than silently inheriting the base URL's scheme. + """ + parsed_location = urlsplit(location) + if parsed_location.scheme: + return location + parsed_base = urlsplit(base_url) + if location.startswith("//"): + # Protocol-relative: inherit the base scheme. + return urlunsplit( + ( + parsed_base.scheme, + parsed_location.netloc, + parsed_location.path, + parsed_location.query, + parsed_location.fragment, + ) + ) + if location.startswith("/"): + return urlunsplit( + ( + parsed_base.scheme, + parsed_base.netloc, + parsed_location.path, + parsed_location.query, + parsed_location.fragment, + ) + ) + # Relative path: resolve against the base path's parent. + base_path = parsed_base.path or "/" + parent = base_path.rsplit("/", 1)[0] + "/" + return urlunsplit( + ( + parsed_base.scheme, + parsed_base.netloc, + parent + parsed_location.path, + parsed_location.query, + parsed_location.fragment, + ) + ) + + @staticmethod + def _is_https_to_http_downgrade(original_url: str, redirect_url: str) -> bool: + """Return ``True`` when ``original_url`` is HTTPS and ``redirect_url`` + is HTTP. Used by the body-replay guard so we only refuse on the + TLS-removed direction; HTTP -> HTTPS and same-scheme hops are fine. + """ + original = urlsplit(original_url) + redirect = urlsplit(redirect_url) + return (original.scheme or "").lower() == "https" and ( + redirect.scheme or "" + ).lower() == "http" + + @staticmethod + def _effective_port(scheme: str, port: Optional[int]) -> int: + """Return the effective port for an origin comparison. + + Falls back to the scheme default (443 for ``https``, 80 for + ``http``) when the URL omits an explicit port, so + ``https://host/x`` and ``https://host:443/x`` compare equal. + """ + if port is not None: + return port + return 443 if scheme.lower() == "https" else 80 + + @classmethod + def _same_origin(cls, original_url: str, redirect_url: str) -> bool: + """Return ``True`` when two URLs share the same origin. + + Same-origin requires identical scheme (case-insensitive), + identical host (case-insensitive per RFC 3986 section 3.2.2), + and identical effective port. The scheme MUST match so a + redirect from ``https://host/x`` to ``http://host/x`` is + treated as cross-origin -- this is the TLS downgrade guard + that triggers Authorization stripping. + """ + original = urlsplit(original_url) + redirect = urlsplit(redirect_url) + if not original.scheme or not redirect.scheme: + return False + if not original.hostname or not redirect.hostname: + return False + if original.scheme.lower() != redirect.scheme.lower(): + return False + if original.hostname.lower() != redirect.hostname.lower(): + return False + return cls._effective_port( + original.scheme, original.port + ) == cls._effective_port(redirect.scheme, redirect.port) + + def _build_multipart_body(self, form_parts: Dict[str, Any], boundary: str) -> bytes: + """Build a multipart/form-data body from a dict of form parts. + + Args: + form_parts: Dict mapping field names to values. + boundary: The multipart boundary string. + + Returns: + Encoded multipart body as bytes. + """ + parts: list[bytes] = [] + for name, value in form_parts.items(): + if value is None: + continue + if isinstance(value, list): + for item in value: + if item is None: + continue + parts.append(self._multipart_part(name, item, boundary)) + else: + parts.append(self._multipart_part(name, value, boundary)) + parts.append(f"--{boundary}--\r\n".encode("utf-8")) + return b"".join(parts) + + @staticmethod + def _build_disposition(name: str, filename: Optional[str]) -> str: + """Build a sanitized Content-Disposition header value for a multipart part.""" + # The field NAME is preserved as raw UTF-8 (only quote/backslash + # escaped) -- it must NOT be ASCII-folded to '?', which is what + # _sanitize_multipart_filename does for the filename fallback. + safe_name = _sanitize_multipart_field_name(name) + disposition = f'form-data; name="{safe_name}"' + if filename is not None: + ascii_fallback, rfc5987 = _sanitize_multipart_filename(filename) + disposition += f'; filename="{ascii_fallback}"' + if rfc5987 is not None: + disposition += f"; filename*={rfc5987}" + return disposition + + @classmethod + def _multipart_part(cls, name: str, value: Any, boundary: str) -> bytes: + """Build a single MIME part for multipart encoding. + + Accepts strings, bytes, file-like objects, ``(filename, content)`` tuples, + and pydantic model instances. The per-part ``Content-Type`` is derived + from the filename extension via :mod:`mimetypes`, falling back to + ``application/octet-stream``. + + Args: + name: The field name. + value: The field value (str, bytes, file-like, tuple, or model object). + boundary: The multipart boundary string. + + Returns: + Encoded MIME part as bytes. + + Raises: + ValueError: If the filename contains CR, LF, or NUL characters. + TypeError: If a ``str`` is supplied where binary content is expected. + """ + # (filename, content) tuples explicitly carry a filename + if isinstance(value, tuple) and len(value) == 2: + filename, content = value + if isinstance(content, str): + raise TypeError( + f"multipart part {name!r}: str content with explicit filename is not supported; " + f"pass bytes for binary data" + ) + if hasattr(content, "read"): + try: + read_data = content.read() + finally: + if hasattr(content, "close"): + content.close() + if isinstance(read_data, str): + raise TypeError( + f'multipart part {name!r}: file opened in text mode; open with mode="rb"' + ) + if not isinstance(read_data, bytes): + raise TypeError( + f"multipart part {name!r}: file-like object did not return bytes from read()" + ) + file_data: bytes = read_data + elif isinstance(content, bytes): + file_data = content + else: + raise TypeError( + f"multipart part {name!r}: tuple content must be bytes or a binary file-like object" + ) + disposition = cls._build_disposition(name, filename) + content_type = _guess_content_type(filename) + header = ( + f"--{boundary}\r\n" + f"Content-Disposition: {disposition}\r\n" + f"Content-Type: {content_type}\r\n\r\n" + ) + return header.encode("utf-8") + file_data + b"\r\n" + + if hasattr(value, "read"): + filename = getattr(value, "name", None) + try: + raw_data = value.read() + finally: + if hasattr(value, "close"): + value.close() + if isinstance(raw_data, str): + # File was opened in text mode; refuse rather than silently + # round-tripping arbitrary bytes through UTF-8. + raise TypeError( + f'multipart part {name!r}: file opened in text mode; open with mode="rb"' + ) + if not isinstance(raw_data, bytes): + raise TypeError( + f"multipart part {name!r}: file-like object did not return bytes from read()" + ) + raw_bytes: bytes = raw_data + disposition = cls._build_disposition(name, filename) + content_type = _guess_content_type(filename) + header = ( + f"--{boundary}\r\n" + f"Content-Disposition: {disposition}\r\n" + f"Content-Type: {content_type}\r\n\r\n" + ) + return header.encode("utf-8") + raw_bytes + b"\r\n" + elif isinstance(value, bytes): + # Raw bytes carry no explicit filename, so reuse the field name as + # the filename and guess the Content-Type from its extension, + # falling back to application/octet-stream. This matches the + # cross-language contract shared with go/node/java. + disposition = cls._build_disposition(name, name) + content_type = _guess_content_type(name) + header = ( + f"--{boundary}\r\n" + f"Content-Disposition: {disposition}\r\n" + f"Content-Type: {content_type}\r\n\r\n" + ) + return header.encode("utf-8") + value + b"\r\n" + elif hasattr(value, "model_dump_json"): + # Route the model part through the SDK's configured ObjectSerializer + # rather than pydantic's model_dump_json directly. ObjectSerializer + # applies the SDK's canonical wire form: WIRE property names (field + # aliases, e.g. `isEnabled`/`recordedAt`, NOT snake_case) AND the SDK + # date-time format (millisecond precision, `...123Z`, NOT pydantic's + # native microsecond `...123000Z`). This keeps the JSON model part + # byte-identical to a JSON request body and matches the other 11 + # SDKs, whose ObjectSerializer.serialize is the single source of + # truth for the model part of a multipart body. Imported lazily to + # avoid a module-load cycle (object_serializer imports models). + from zitadel_client.object_serializer import ObjectSerializer + + json_str: str = ObjectSerializer().serialize(value) + disposition = cls._build_disposition(name, None) + header = ( + f"--{boundary}\r\n" + f"Content-Disposition: {disposition}\r\n" + f"Content-Type: application/json\r\n\r\n" + ) + return header.encode("utf-8") + json_str.encode("utf-8") + b"\r\n" + else: + disposition = cls._build_disposition(name, None) + part = ( + f"--{boundary}\r\nContent-Disposition: {disposition}\r\n\r\n{value}\r\n" + ) + return part.encode("utf-8") + + @staticmethod + def _decompress_body(data: bytes, encoding: str) -> bytes: + """Decompress response body based on Content-Encoding header. + + Supports gzip and deflate natively. Brotli and zstd are supported + when their respective packages (brotli, zstandard) are installed. + + Args: + data: Raw response bytes. + encoding: Content-Encoding header value. + + Returns: + Decompressed bytes. + """ + if not data: + return data + if encoding in ("gzip", "x-gzip"): + return gzip.decompress(data) + if encoding == "deflate": + return zlib.decompress(data) + if encoding == "br" and _brotli is not None: + br_result: bytes = _brotli.decompress(data) + return br_result + if encoding == "zstd" and _zstandard is not None: + zstd_result: bytes = _zstandard.ZstdDecompressor().decompress( + data, max_output_size=len(data) * 16 + ) + return zstd_result + return data diff --git a/zitadel_client/errors/__init__.py b/zitadel_client/errors/__init__.py new file mode 100644 index 00000000..d35baf80 --- /dev/null +++ b/zitadel_client/errors/__init__.py @@ -0,0 +1,229 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Dict, Mapping, Optional, Type, TypeVar + +T = TypeVar("T") + + +class ZitadelException(Exception): + """The branded root exception for every error raised by this SDK. + + All SDK exceptions -- transport/HTTP errors (:class:`ApiException` and + its typed subclasses), serde failures (:class:`SerializationException`) + and OAuth2 token failures (:class:`OAuth2ServerException`, + :class:`OAuth2TokenException`) -- inherit from this single root, so callers can catch everything with + one ``except ZitadelException``. + """ + + +class ApiException(ZitadelException): + """Exception thrown when an API call fails.""" + + def __init__( + self, + status_code: int = 0, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + # Forward the message to the base Exception so `args`, `str()` and + # standard logging/pickling behave like every other SDK's exceptions. + super().__init__(message) + # Stored privately and exposed through read-only @property getters so + # that a caught exception's fields cannot be mutated after the fact + # (e.g. rewriting status_code on a re-raised error). The typed + # subclasses (ClientException, ServerException, ...) inherit these. + self._status_code = status_code + self._message = message + self._response_headers = response_headers + self._response_body = response_body + self._error_body = error_body + + @property + def status_code(self) -> int: + return self._status_code + + @property + def message(self) -> Optional[str]: + return self._message + + @property + def response_headers(self) -> Optional[Any]: + return self._response_headers + + @property + def response_body(self) -> Optional[str]: + return self._response_body + + @property + def error_body(self) -> Optional[Any]: + return self._error_body + + @staticmethod + def from_response( + status_code: int, + headers: Optional[Mapping[str, str]], + body: Optional[str], + ) -> "ApiException": + """Build the exception that a non-2xx response with this status raises. + + This is the one status-to-exception mapping in the SDK: the API + classes and the OpenID Connect discovery both use it. + + Args: + status_code: The HTTP status code of the response. + headers: The response headers. + body: The raw response body, if any. + + Returns: + The status-specific subclass where there is one (for example + :class:`NotFoundException` for 404), else :class:`ClientException` + for any other 4xx, :class:`ServerException` for any other 5xx, and + :class:`ApiException` for everything else. + """ + message = f"API returned status code {status_code}" + # An empty header map is a real (if unusual) error response and is + # passed through as an empty dict; ``None`` means no response arrived + # at all and stays ``None``, as in every other SDK. + response_headers: Optional[Dict[str, str]] = ( + dict(headers) if headers is not None else None + ) + error_body: Any = None + if body: + # Imported lazily so this module stays the foundational one in the + # import graph: object_serializer imports SerializationException + # from this package, so importing it at module top would form a + # cycle. + from zitadel_client.object_serializer import ObjectSerializer + + try: + # F5: route through parse_json so the depth-cap rejects + # malicious 100k-deep error payloads before they exhaust the + # interpreter's recursion limit. + error_body = ObjectSerializer.parse_json(body) + except SerializationException: + error_body = None + by_status: Dict[int, Type[ClientException] | Type[ServerException]] = { + 400: BadRequestException, + 401: UnauthorizedException, + 403: ForbiddenException, + 404: NotFoundException, + 409: ConflictException, + 422: UnprocessableEntityException, + 500: InternalServerErrorException, + } + specific = by_status.get(status_code) + if specific is not None: + return specific( + message=message, + response_headers=response_headers, + response_body=body, + error_body=error_body, + ) + if 400 <= status_code < 500: + return ClientException( + status_code=status_code, + message=message, + response_headers=response_headers, + response_body=body, + error_body=error_body, + ) + if 500 <= status_code < 600: + return ServerException( + status_code=status_code, + message=message, + response_headers=response_headers, + response_body=body, + error_body=error_body, + ) + return ApiException( + status_code=status_code, + message=message, + response_headers=response_headers, + response_body=body, + error_body=error_body, + ) + + def get_typed_error_body(self, clazz: Type[T]) -> Optional[T]: + """Deserialize the response body into a typed object. + + Uses :class:`ObjectSerializer` to parse the raw response body + into an instance of the given class. + + Args: + clazz: The target type to deserialize to. + + Returns: + The deserialized object, or ``None`` if the body is empty. + """ + if not self.response_body: + return None + # Imported lazily so this module stays the foundational one in the + # import graph: object_serializer imports SerializationException from + # this package, so importing it at module top would form a cycle. + from zitadel_client.object_serializer import ObjectSerializer + + return ObjectSerializer().deserialize(self.response_body, clazz) + + def __str__(self) -> str: + """Build a human-readable error message from the stored attributes.""" + msg = ( + "Error message: the server returns an error" + if self.message is None + else self.message + ) + + if self.status_code: + msg += f"\nHTTP status code: {self.status_code}" + if self.response_headers: + msg += f"\nResponse headers: {self.response_headers}" + if self.response_body: + msg += f"\nResponse body: {self.response_body}" + + return msg + + +# Re-export exception subclasses for convenience +from zitadel_client.errors.client_exception import ClientException +from zitadel_client.errors.server_exception import ServerException +from zitadel_client.errors.bad_request_exception import BadRequestException +from zitadel_client.errors.unauthorized_exception import UnauthorizedException +from zitadel_client.errors.forbidden_exception import ForbiddenException +from zitadel_client.errors.not_found_exception import NotFoundException +from zitadel_client.errors.conflict_exception import ConflictException +from zitadel_client.errors.unprocessable_entity_exception import ( + UnprocessableEntityException, +) +from zitadel_client.errors.internal_server_error_exception import ( + InternalServerErrorException, +) +from zitadel_client.errors.network_exception import NetworkException +from zitadel_client.errors.network_timeout_exception import NetworkTimeoutException +from zitadel_client.errors.serialization_exception import SerializationException +from zitadel_client.errors.oauth2_server_exception import OAuth2ServerException +from zitadel_client.errors.oauth2_token_exception import OAuth2TokenException + +__all__ = [ + "ZitadelException", + "ApiException", + "ClientException", + "ServerException", + "BadRequestException", + "UnauthorizedException", + "ForbiddenException", + "NotFoundException", + "ConflictException", + "UnprocessableEntityException", + "InternalServerErrorException", + "NetworkException", + "NetworkTimeoutException", + "SerializationException", + "OAuth2ServerException", + "OAuth2TokenException", +] diff --git a/zitadel_client/errors/bad_request_exception.py b/zitadel_client/errors/bad_request_exception.py new file mode 100644 index 00000000..06c62e36 --- /dev/null +++ b/zitadel_client/errors/bad_request_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class BadRequestException(ClientException): + """Exception for HTTP 400 Bad Request.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=400, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/client_exception.py b/zitadel_client/errors/client_exception.py new file mode 100644 index 00000000..094b8e8e --- /dev/null +++ b/zitadel_client/errors/client_exception.py @@ -0,0 +1,14 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from zitadel_client.errors import ApiException + + +class ClientException(ApiException): + """Exception for HTTP 4xx client errors.""" + + pass diff --git a/zitadel_client/errors/conflict_exception.py b/zitadel_client/errors/conflict_exception.py new file mode 100644 index 00000000..3ac14e55 --- /dev/null +++ b/zitadel_client/errors/conflict_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class ConflictException(ClientException): + """Exception for HTTP 409 Conflict.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=409, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/forbidden_exception.py b/zitadel_client/errors/forbidden_exception.py new file mode 100644 index 00000000..b3f46957 --- /dev/null +++ b/zitadel_client/errors/forbidden_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class ForbiddenException(ClientException): + """Exception for HTTP 403 Forbidden.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=403, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/internal_server_error_exception.py b/zitadel_client/errors/internal_server_error_exception.py new file mode 100644 index 00000000..93d8d810 --- /dev/null +++ b/zitadel_client/errors/internal_server_error_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.server_exception import ServerException + + +class InternalServerErrorException(ServerException): + """Exception for HTTP 500 Internal Server Error.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=500, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/network_exception.py b/zitadel_client/errors/network_exception.py new file mode 100644 index 00000000..e68df025 --- /dev/null +++ b/zitadel_client/errors/network_exception.py @@ -0,0 +1,20 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Optional + +from zitadel_client.errors import ApiException + + +class NetworkException(ApiException): + """Exception for a request that got no HTTP response: connection + refused, DNS failure, TLS failure, or connection reset. The status code + is always ``0``; the underlying library error is kept as ``__cause__``. + """ + + def __init__(self, message: Optional[str] = None) -> None: + super().__init__(status_code=0, message=message) diff --git a/zitadel_client/errors/network_timeout_exception.py b/zitadel_client/errors/network_timeout_exception.py new file mode 100644 index 00000000..8f4464d3 --- /dev/null +++ b/zitadel_client/errors/network_timeout_exception.py @@ -0,0 +1,18 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from zitadel_client.errors.network_exception import NetworkException + + +class NetworkTimeoutException(NetworkException): + """Exception for a request that timed out. + + The status code is always ``0``; the underlying library error is kept + as ``__cause__``. + """ + + pass diff --git a/zitadel_client/errors/not_found_exception.py b/zitadel_client/errors/not_found_exception.py new file mode 100644 index 00000000..7173caed --- /dev/null +++ b/zitadel_client/errors/not_found_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class NotFoundException(ClientException): + """Exception for HTTP 404 Not Found.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=404, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/oauth2_server_exception.py b/zitadel_client/errors/oauth2_server_exception.py new file mode 100644 index 00000000..099bf7c0 --- /dev/null +++ b/zitadel_client/errors/oauth2_server_exception.py @@ -0,0 +1,69 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Optional + +from zitadel_client.errors import ZitadelException + + +class OAuth2ServerException(ZitadelException): + """Raised when the OAuth2 token endpoint answers with a non-2xx status, + including a 3xx redirect, which the token POST never follows. Typed + representation of an RFC 6749 §5.2 OAuth2 error response. + + Attributes: + status_code: The HTTP status code returned by the token endpoint. + code: The OAuth2 error code (e.g. ``invalid_grant``, + ``invalid_client``), or ``None`` when the body did not parse as + a valid OAuth2 error object. + description: Optional human-readable description. + uri: Optional URI to a page describing the error. + raw_body: The original response payload (for diagnostics). + """ + + def __init__( + self, + status_code: int, + code: Optional[str], + description: Optional[str], + uri: Optional[str], + raw_body: str, + ) -> None: + if code is None: + message = f"Token request failed with status {status_code}: {raw_body}" + elif description is not None: + message = f"Token request failed with status {status_code}: {code} -- {description}" + else: + message = f"Token request failed with status {status_code}: {code}" + super().__init__(message) + # Stored privately and exposed via read-only @property getters so a + # caught error's fields cannot be reassigned after construction. + self._status_code = status_code + self._code = code + self._description = description + self._uri = uri + self._raw_body = raw_body + + @property + def status_code(self) -> int: + return self._status_code + + @property + def code(self) -> Optional[str]: + return self._code + + @property + def description(self) -> Optional[str]: + return self._description + + @property + def uri(self) -> Optional[str]: + return self._uri + + @property + def raw_body(self) -> str: + return self._raw_body diff --git a/zitadel_client/errors/oauth2_token_exception.py b/zitadel_client/errors/oauth2_token_exception.py new file mode 100644 index 00000000..2d8112a0 --- /dev/null +++ b/zitadel_client/errors/oauth2_token_exception.py @@ -0,0 +1,22 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from zitadel_client.errors import ZitadelException + + +class OAuth2TokenException(ZitadelException): + """Raised when the OAuth2 token endpoint returns a 2xx response that + cannot be used: a body that is not a JSON object, or one whose + ``access_token`` field is missing or empty. Distinct from + :class:`OAuth2ServerException` (which represents non-2xx responses) so + callers can recover differently. + + A sibling of :class:`ApiException` under the branded + :class:`ZitadelException` root -- it is an OAuth2 token-acquisition + failure rather than an HTTP-status error, so it does not extend + ``ApiException``. Callers can still catch every SDK error with one + ``except ZitadelException``.""" diff --git a/zitadel_client/errors/serialization_exception.py b/zitadel_client/errors/serialization_exception.py new file mode 100644 index 00000000..c92765cb --- /dev/null +++ b/zitadel_client/errors/serialization_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Optional + +from zitadel_client.errors import ZitadelException + + +class SerializationException(ZitadelException): + """Exception raised when serialization or deserialization fails.""" + + def __init__(self, message: str, cause: Optional[Exception] = None): + super().__init__(message) + # Stored privately and exposed via read-only @property getters so a + # caught error's fields cannot be reassigned after construction. + self._message = message + self._cause = cause + + @property + def message(self) -> str: + return self._message + + @property + def cause(self) -> Optional[Exception]: + return self._cause diff --git a/zitadel_client/errors/server_exception.py b/zitadel_client/errors/server_exception.py new file mode 100644 index 00000000..3cb8f5e9 --- /dev/null +++ b/zitadel_client/errors/server_exception.py @@ -0,0 +1,14 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from zitadel_client.errors import ApiException + + +class ServerException(ApiException): + """Exception for HTTP 5xx server errors.""" + + pass diff --git a/zitadel_client/errors/unauthorized_exception.py b/zitadel_client/errors/unauthorized_exception.py new file mode 100644 index 00000000..967fb623 --- /dev/null +++ b/zitadel_client/errors/unauthorized_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class UnauthorizedException(ClientException): + """Exception for HTTP 401 Unauthorized.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=401, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/errors/unprocessable_entity_exception.py b/zitadel_client/errors/unprocessable_entity_exception.py new file mode 100644 index 00000000..d1912fb2 --- /dev/null +++ b/zitadel_client/errors/unprocessable_entity_exception.py @@ -0,0 +1,29 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Optional + +from zitadel_client.errors.client_exception import ClientException + + +class UnprocessableEntityException(ClientException): + """Exception for HTTP 422 Unprocessable Entity.""" + + def __init__( + self, + message: Optional[str] = None, + response_headers: Optional[Any] = None, + response_body: Optional[str] = None, + error_body: Optional[Any] = None, + ) -> None: + super().__init__( + status_code=422, + message=message, + response_headers=response_headers, + response_body=response_body, + error_body=error_body, + ) diff --git a/zitadel_client/exceptions.py b/zitadel_client/exceptions.py deleted file mode 100644 index 342e8af4..00000000 --- a/zitadel_client/exceptions.py +++ /dev/null @@ -1,27 +0,0 @@ -from typing import Any, Dict, Optional - - -class ZitadelError(Exception): - """Base exception for all Zitadel API errors.""" - - -class ApiError(ZitadelError): - """ - Represents an HTTP error from the Zitadel API. - - Attributes: - code int HTTP status code - response_headers Dict[str, str] HTTP response headers - response_body Any HTTP response body - """ - - def __init__( - self, - code: int, - response_headers: Dict[str, str], - response_body: Optional[Any], - ) -> None: - super().__init__(f"Error {code}") - self.code = code - self.response_headers = response_headers - self.response_body = response_body diff --git a/zitadel_client/header_selector.py b/zitadel_client/header_selector.py new file mode 100644 index 00000000..1151bad6 --- /dev/null +++ b/zitadel_client/header_selector.py @@ -0,0 +1,72 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +import re +from typing import Dict, List + + +class HeaderSelector: + """Selects Accept and Content-Type headers for API requests based on the MIME + types declared in the OpenAPI specification. + """ + + _JSON_MIME_PATTERN = re.compile( + r"^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)", re.IGNORECASE + ) + + def select_headers( + self, accept: List[str], content_type: str, is_multipart: bool + ) -> Dict[str, str]: + """Select headers for an API request. + + :param accept: list of acceptable MIME types for the response + :param content_type: the Content-Type for the request body + :param is_multipart: whether this is a multipart request + :return: dict of header names to values + """ + headers: Dict[str, str] = {} + + accept_header = self._select_accept_header(accept) + if accept_header: + headers["Accept"] = accept_header + + if not is_multipart: + if not content_type: + content_type = "application/json" + headers["Content-Type"] = content_type + + return headers + + def _select_accept_header(self, accept: List[str]) -> str: + """Return the header 'Accept' based on an array of Accept provided. + + The acceptable MIME types are joined in their original declaration + order with ", ". No quality weights are added and no reordering is + performed. + + :param accept: list of header + :return: Accept (e.g. "image/jpeg, image/png, application/json") + """ + if accept is None: + return "" + + filtered_accept = [s for s in accept if s is not None and s.strip()] + + if not filtered_accept: + return "" + + return ", ".join(filtered_accept) + + def is_json_mime(self, search_string: str) -> bool: + """Detects whether a string contains a valid JSON mime type. + + :param search_string: the MIME type string to check + :return: True if the string represents a JSON MIME type + """ + if search_string is None: + return False + return self._JSON_MIME_PATTERN.search(search_string) is not None diff --git a/zitadel_client/models/.openapi b/zitadel_client/models/.openapi deleted file mode 100644 index e69de29b..00000000 diff --git a/zitadel_client/models/__init__.py b/zitadel_client/models/__init__.py index 38314d68..04d02de8 100644 --- a/zitadel_client/models/__init__.py +++ b/zitadel_client/models/__init__.py @@ -1,1367 +1,4049 @@ -# coding: utf-8 - -# flake8: noqa -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech # import models into model package -from zitadel_client.models.action_service_activate_public_key_request import ActionServiceActivatePublicKeyRequest -from zitadel_client.models.action_service_activate_public_key_response import ActionServiceActivatePublicKeyResponse -from zitadel_client.models.action_service_add_public_key_request import ActionServiceAddPublicKeyRequest -from zitadel_client.models.action_service_add_public_key_response import ActionServiceAddPublicKeyResponse -from zitadel_client.models.action_service_any import ActionServiceAny -from zitadel_client.models.action_service_condition import ActionServiceCondition -from zitadel_client.models.action_service_connect_error import ActionServiceConnectError -from zitadel_client.models.action_service_create_target_request import ActionServiceCreateTargetRequest -from zitadel_client.models.action_service_create_target_response import ActionServiceCreateTargetResponse -from zitadel_client.models.action_service_deactivate_public_key_request import ActionServiceDeactivatePublicKeyRequest -from zitadel_client.models.action_service_deactivate_public_key_response import ActionServiceDeactivatePublicKeyResponse -from zitadel_client.models.action_service_delete_target_request import ActionServiceDeleteTargetRequest -from zitadel_client.models.action_service_delete_target_response import ActionServiceDeleteTargetResponse -from zitadel_client.models.action_service_event_execution import ActionServiceEventExecution -from zitadel_client.models.action_service_execution import ActionServiceExecution -from zitadel_client.models.action_service_execution_field_name import ActionServiceExecutionFieldName -from zitadel_client.models.action_service_execution_search_filter import ActionServiceExecutionSearchFilter -from zitadel_client.models.action_service_execution_type import ActionServiceExecutionType -from zitadel_client.models.action_service_execution_type_filter import ActionServiceExecutionTypeFilter -from zitadel_client.models.action_service_function_execution import ActionServiceFunctionExecution -from zitadel_client.models.action_service_get_target_request import ActionServiceGetTargetRequest -from zitadel_client.models.action_service_get_target_response import ActionServiceGetTargetResponse -from zitadel_client.models.action_service_in_conditions_filter import ActionServiceInConditionsFilter -from zitadel_client.models.action_service_in_ids_filter import ActionServiceInIDsFilter -from zitadel_client.models.action_service_in_target_ids_filter import ActionServiceInTargetIDsFilter -from zitadel_client.models.action_service_list_execution_functions_response import ActionServiceListExecutionFunctionsResponse -from zitadel_client.models.action_service_list_execution_methods_response import ActionServiceListExecutionMethodsResponse -from zitadel_client.models.action_service_list_execution_services_response import ActionServiceListExecutionServicesResponse -from zitadel_client.models.action_service_list_executions_request import ActionServiceListExecutionsRequest -from zitadel_client.models.action_service_list_executions_response import ActionServiceListExecutionsResponse -from zitadel_client.models.action_service_list_public_keys_request import ActionServiceListPublicKeysRequest -from zitadel_client.models.action_service_list_public_keys_response import ActionServiceListPublicKeysResponse -from zitadel_client.models.action_service_list_targets_request import ActionServiceListTargetsRequest -from zitadel_client.models.action_service_list_targets_response import ActionServiceListTargetsResponse -from zitadel_client.models.action_service_pagination_request import ActionServicePaginationRequest -from zitadel_client.models.action_service_pagination_response import ActionServicePaginationResponse -from zitadel_client.models.action_service_payload_type import ActionServicePayloadType -from zitadel_client.models.action_service_public_key import ActionServicePublicKey -from zitadel_client.models.action_service_public_key_field_name import ActionServicePublicKeyFieldName -from zitadel_client.models.action_service_public_key_search_filter import ActionServicePublicKeySearchFilter -from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall -from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook -from zitadel_client.models.action_service_remove_public_key_request import ActionServiceRemovePublicKeyRequest -from zitadel_client.models.action_service_remove_public_key_response import ActionServiceRemovePublicKeyResponse -from zitadel_client.models.action_service_request_execution import ActionServiceRequestExecution -from zitadel_client.models.action_service_response_execution import ActionServiceResponseExecution -from zitadel_client.models.action_service_set_execution_request import ActionServiceSetExecutionRequest -from zitadel_client.models.action_service_set_execution_response import ActionServiceSetExecutionResponse -from zitadel_client.models.action_service_target import ActionServiceTarget -from zitadel_client.models.action_service_target_field_name import ActionServiceTargetFieldName -from zitadel_client.models.action_service_target_filter import ActionServiceTargetFilter -from zitadel_client.models.action_service_target_name_filter import ActionServiceTargetNameFilter -from zitadel_client.models.action_service_target_search_filter import ActionServiceTargetSearchFilter -from zitadel_client.models.action_service_text_filter_method import ActionServiceTextFilterMethod -from zitadel_client.models.action_service_timestamp_filter import ActionServiceTimestampFilter -from zitadel_client.models.action_service_timestamp_filter_method import ActionServiceTimestampFilterMethod -from zitadel_client.models.action_service_update_target_request import ActionServiceUpdateTargetRequest -from zitadel_client.models.action_service_update_target_response import ActionServiceUpdateTargetResponse -from zitadel_client.models.application_service_api_auth_method_type import ApplicationServiceAPIAuthMethodType -from zitadel_client.models.application_service_api_configuration import ApplicationServiceAPIConfiguration -from zitadel_client.models.application_service_any import ApplicationServiceAny -from zitadel_client.models.application_service_application import ApplicationServiceApplication -from zitadel_client.models.application_service_application_key import ApplicationServiceApplicationKey -from zitadel_client.models.application_service_application_key_application_id_filter import ApplicationServiceApplicationKeyApplicationIDFilter -from zitadel_client.models.application_service_application_key_organization_id_filter import ApplicationServiceApplicationKeyOrganizationIDFilter -from zitadel_client.models.application_service_application_key_project_id_filter import ApplicationServiceApplicationKeyProjectIDFilter -from zitadel_client.models.application_service_application_key_search_filter import ApplicationServiceApplicationKeySearchFilter -from zitadel_client.models.application_service_application_keys_sorting import ApplicationServiceApplicationKeysSorting -from zitadel_client.models.application_service_application_name_filter import ApplicationServiceApplicationNameFilter -from zitadel_client.models.application_service_application_search_filter import ApplicationServiceApplicationSearchFilter -from zitadel_client.models.application_service_application_sorting import ApplicationServiceApplicationSorting -from zitadel_client.models.application_service_application_state import ApplicationServiceApplicationState -from zitadel_client.models.application_service_application_type import ApplicationServiceApplicationType -from zitadel_client.models.application_service_client_id_filter import ApplicationServiceClientIDFilter -from zitadel_client.models.application_service_connect_error import ApplicationServiceConnectError -from zitadel_client.models.application_service_create_api_application_request import ApplicationServiceCreateAPIApplicationRequest -from zitadel_client.models.application_service_create_api_application_response import ApplicationServiceCreateAPIApplicationResponse -from zitadel_client.models.application_service_create_application_key_request import ApplicationServiceCreateApplicationKeyRequest -from zitadel_client.models.application_service_create_application_key_response import ApplicationServiceCreateApplicationKeyResponse -from zitadel_client.models.application_service_create_application_request import ApplicationServiceCreateApplicationRequest -from zitadel_client.models.application_service_create_application_response import ApplicationServiceCreateApplicationResponse -from zitadel_client.models.application_service_create_oidc_application_request import ApplicationServiceCreateOIDCApplicationRequest -from zitadel_client.models.application_service_create_oidc_application_response import ApplicationServiceCreateOIDCApplicationResponse -from zitadel_client.models.application_service_create_saml_application_request import ApplicationServiceCreateSAMLApplicationRequest -from zitadel_client.models.application_service_deactivate_application_request import ApplicationServiceDeactivateApplicationRequest -from zitadel_client.models.application_service_deactivate_application_response import ApplicationServiceDeactivateApplicationResponse -from zitadel_client.models.application_service_delete_application_key_request import ApplicationServiceDeleteApplicationKeyRequest -from zitadel_client.models.application_service_delete_application_key_response import ApplicationServiceDeleteApplicationKeyResponse -from zitadel_client.models.application_service_delete_application_request import ApplicationServiceDeleteApplicationRequest -from zitadel_client.models.application_service_delete_application_response import ApplicationServiceDeleteApplicationResponse -from zitadel_client.models.application_service_entity_id_filter import ApplicationServiceEntityIDFilter -from zitadel_client.models.application_service_generate_client_secret_request import ApplicationServiceGenerateClientSecretRequest -from zitadel_client.models.application_service_generate_client_secret_response import ApplicationServiceGenerateClientSecretResponse -from zitadel_client.models.application_service_get_application_key_request import ApplicationServiceGetApplicationKeyRequest -from zitadel_client.models.application_service_get_application_key_response import ApplicationServiceGetApplicationKeyResponse -from zitadel_client.models.application_service_get_application_request import ApplicationServiceGetApplicationRequest -from zitadel_client.models.application_service_get_application_response import ApplicationServiceGetApplicationResponse -from zitadel_client.models.application_service_list_application_keys_request import ApplicationServiceListApplicationKeysRequest -from zitadel_client.models.application_service_list_application_keys_response import ApplicationServiceListApplicationKeysResponse -from zitadel_client.models.application_service_list_applications_request import ApplicationServiceListApplicationsRequest -from zitadel_client.models.application_service_list_applications_response import ApplicationServiceListApplicationsResponse -from zitadel_client.models.application_service_login_v2 import ApplicationServiceLoginV2 -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from zitadel_client.models.application_service_oidc_application_type import ApplicationServiceOIDCApplicationType -from zitadel_client.models.application_service_oidc_auth_method_type import ApplicationServiceOIDCAuthMethodType -from zitadel_client.models.application_service_oidc_configuration import ApplicationServiceOIDCConfiguration -from zitadel_client.models.application_service_oidc_grant_type import ApplicationServiceOIDCGrantType -from zitadel_client.models.application_service_oidc_localized_message import ApplicationServiceOIDCLocalizedMessage -from zitadel_client.models.application_service_oidc_response_type import ApplicationServiceOIDCResponseType -from zitadel_client.models.application_service_oidc_token_type import ApplicationServiceOIDCTokenType -from zitadel_client.models.application_service_oidc_version import ApplicationServiceOIDCVersion -from zitadel_client.models.application_service_pagination_request import ApplicationServicePaginationRequest -from zitadel_client.models.application_service_pagination_response import ApplicationServicePaginationResponse -from zitadel_client.models.application_service_project_id_filter import ApplicationServiceProjectIDFilter -from zitadel_client.models.application_service_reactivate_application_request import ApplicationServiceReactivateApplicationRequest -from zitadel_client.models.application_service_reactivate_application_response import ApplicationServiceReactivateApplicationResponse -from zitadel_client.models.application_service_saml_configuration import ApplicationServiceSAMLConfiguration -from zitadel_client.models.application_service_text_filter_method import ApplicationServiceTextFilterMethod -from zitadel_client.models.application_service_update_api_application_configuration_request import ApplicationServiceUpdateAPIApplicationConfigurationRequest -from zitadel_client.models.application_service_update_application_request import ApplicationServiceUpdateApplicationRequest -from zitadel_client.models.application_service_update_application_response import ApplicationServiceUpdateApplicationResponse -from zitadel_client.models.application_service_update_oidc_application_configuration_request import ApplicationServiceUpdateOIDCApplicationConfigurationRequest -from zitadel_client.models.application_service_update_saml_application_configuration_request import ApplicationServiceUpdateSAMLApplicationConfigurationRequest -from zitadel_client.models.authorization_service_activate_authorization_request import AuthorizationServiceActivateAuthorizationRequest -from zitadel_client.models.authorization_service_activate_authorization_response import AuthorizationServiceActivateAuthorizationResponse -from zitadel_client.models.authorization_service_any import AuthorizationServiceAny -from zitadel_client.models.authorization_service_authorization import AuthorizationServiceAuthorization -from zitadel_client.models.authorization_service_authorization_field_name import AuthorizationServiceAuthorizationFieldName -from zitadel_client.models.authorization_service_authorizations_search_filter import AuthorizationServiceAuthorizationsSearchFilter -from zitadel_client.models.authorization_service_connect_error import AuthorizationServiceConnectError -from zitadel_client.models.authorization_service_create_authorization_request import AuthorizationServiceCreateAuthorizationRequest -from zitadel_client.models.authorization_service_create_authorization_response import AuthorizationServiceCreateAuthorizationResponse -from zitadel_client.models.authorization_service_deactivate_authorization_request import AuthorizationServiceDeactivateAuthorizationRequest -from zitadel_client.models.authorization_service_deactivate_authorization_response import AuthorizationServiceDeactivateAuthorizationResponse -from zitadel_client.models.authorization_service_delete_authorization_request import AuthorizationServiceDeleteAuthorizationRequest -from zitadel_client.models.authorization_service_delete_authorization_response import AuthorizationServiceDeleteAuthorizationResponse -from zitadel_client.models.authorization_service_id_filter import AuthorizationServiceIDFilter -from zitadel_client.models.authorization_service_in_ids_filter import AuthorizationServiceInIDsFilter -from zitadel_client.models.authorization_service_list_authorizations_request import AuthorizationServiceListAuthorizationsRequest -from zitadel_client.models.authorization_service_list_authorizations_response import AuthorizationServiceListAuthorizationsResponse -from zitadel_client.models.authorization_service_organization import AuthorizationServiceOrganization -from zitadel_client.models.authorization_service_pagination_request import AuthorizationServicePaginationRequest -from zitadel_client.models.authorization_service_pagination_response import AuthorizationServicePaginationResponse -from zitadel_client.models.authorization_service_project import AuthorizationServiceProject -from zitadel_client.models.authorization_service_project_name_query import AuthorizationServiceProjectNameQuery -from zitadel_client.models.authorization_service_role import AuthorizationServiceRole -from zitadel_client.models.authorization_service_role_key_query import AuthorizationServiceRoleKeyQuery -from zitadel_client.models.authorization_service_state import AuthorizationServiceState -from zitadel_client.models.authorization_service_state_query import AuthorizationServiceStateQuery -from zitadel_client.models.authorization_service_text_filter_method import AuthorizationServiceTextFilterMethod -from zitadel_client.models.authorization_service_update_authorization_request import AuthorizationServiceUpdateAuthorizationRequest -from zitadel_client.models.authorization_service_update_authorization_response import AuthorizationServiceUpdateAuthorizationResponse -from zitadel_client.models.authorization_service_user import AuthorizationServiceUser -from zitadel_client.models.authorization_service_user_display_name_query import AuthorizationServiceUserDisplayNameQuery -from zitadel_client.models.authorization_service_user_preferred_login_name_query import AuthorizationServiceUserPreferredLoginNameQuery -from zitadel_client.models.beta_action_service_any import BetaActionServiceAny -from zitadel_client.models.beta_action_service_condition import BetaActionServiceCondition -from zitadel_client.models.beta_action_service_connect_error import BetaActionServiceConnectError -from zitadel_client.models.beta_action_service_create_target_request import BetaActionServiceCreateTargetRequest -from zitadel_client.models.beta_action_service_create_target_response import BetaActionServiceCreateTargetResponse -from zitadel_client.models.beta_action_service_delete_target_request import BetaActionServiceDeleteTargetRequest -from zitadel_client.models.beta_action_service_delete_target_response import BetaActionServiceDeleteTargetResponse -from zitadel_client.models.beta_action_service_event_execution import BetaActionServiceEventExecution -from zitadel_client.models.beta_action_service_execution import BetaActionServiceExecution -from zitadel_client.models.beta_action_service_execution_field_name import BetaActionServiceExecutionFieldName -from zitadel_client.models.beta_action_service_execution_search_filter import BetaActionServiceExecutionSearchFilter -from zitadel_client.models.beta_action_service_execution_type import BetaActionServiceExecutionType -from zitadel_client.models.beta_action_service_execution_type_filter import BetaActionServiceExecutionTypeFilter -from zitadel_client.models.beta_action_service_function_execution import BetaActionServiceFunctionExecution -from zitadel_client.models.beta_action_service_get_target_request import BetaActionServiceGetTargetRequest -from zitadel_client.models.beta_action_service_get_target_response import BetaActionServiceGetTargetResponse -from zitadel_client.models.beta_action_service_in_conditions_filter import BetaActionServiceInConditionsFilter -from zitadel_client.models.beta_action_service_in_target_ids_filter import BetaActionServiceInTargetIDsFilter -from zitadel_client.models.beta_action_service_list_execution_functions_response import BetaActionServiceListExecutionFunctionsResponse -from zitadel_client.models.beta_action_service_list_execution_methods_response import BetaActionServiceListExecutionMethodsResponse -from zitadel_client.models.beta_action_service_list_execution_services_response import BetaActionServiceListExecutionServicesResponse -from zitadel_client.models.beta_action_service_list_executions_request import BetaActionServiceListExecutionsRequest -from zitadel_client.models.beta_action_service_list_executions_response import BetaActionServiceListExecutionsResponse -from zitadel_client.models.beta_action_service_list_targets_request import BetaActionServiceListTargetsRequest -from zitadel_client.models.beta_action_service_list_targets_response import BetaActionServiceListTargetsResponse -from zitadel_client.models.beta_action_service_pagination_request import BetaActionServicePaginationRequest -from zitadel_client.models.beta_action_service_pagination_response import BetaActionServicePaginationResponse -from zitadel_client.models.beta_action_service_rest_call import BetaActionServiceRESTCall -from zitadel_client.models.beta_action_service_rest_webhook import BetaActionServiceRESTWebhook -from zitadel_client.models.beta_action_service_request_execution import BetaActionServiceRequestExecution -from zitadel_client.models.beta_action_service_response_execution import BetaActionServiceResponseExecution -from zitadel_client.models.beta_action_service_set_execution_request import BetaActionServiceSetExecutionRequest -from zitadel_client.models.beta_action_service_set_execution_response import BetaActionServiceSetExecutionResponse -from zitadel_client.models.beta_action_service_target import BetaActionServiceTarget -from zitadel_client.models.beta_action_service_target_field_name import BetaActionServiceTargetFieldName -from zitadel_client.models.beta_action_service_target_filter import BetaActionServiceTargetFilter -from zitadel_client.models.beta_action_service_target_name_filter import BetaActionServiceTargetNameFilter -from zitadel_client.models.beta_action_service_target_search_filter import BetaActionServiceTargetSearchFilter -from zitadel_client.models.beta_action_service_text_filter_method import BetaActionServiceTextFilterMethod -from zitadel_client.models.beta_action_service_update_target_request import BetaActionServiceUpdateTargetRequest -from zitadel_client.models.beta_action_service_update_target_response import BetaActionServiceUpdateTargetResponse -from zitadel_client.models.beta_app_service_api_auth_method_type import BetaAppServiceAPIAuthMethodType -from zitadel_client.models.beta_app_service_api_config import BetaAppServiceAPIConfig -from zitadel_client.models.beta_app_service_any import BetaAppServiceAny -from zitadel_client.models.beta_app_service_app_sorting import BetaAppServiceAppSorting -from zitadel_client.models.beta_app_service_app_state import BetaAppServiceAppState -from zitadel_client.models.beta_app_service_application import BetaAppServiceApplication -from zitadel_client.models.beta_app_service_application_key import BetaAppServiceApplicationKey -from zitadel_client.models.beta_app_service_application_keys_sorting import BetaAppServiceApplicationKeysSorting -from zitadel_client.models.beta_app_service_application_name_query import BetaAppServiceApplicationNameQuery -from zitadel_client.models.beta_app_service_application_search_filter import BetaAppServiceApplicationSearchFilter -from zitadel_client.models.beta_app_service_connect_error import BetaAppServiceConnectError -from zitadel_client.models.beta_app_service_create_api_application_request import BetaAppServiceCreateAPIApplicationRequest -from zitadel_client.models.beta_app_service_create_api_application_response import BetaAppServiceCreateAPIApplicationResponse -from zitadel_client.models.beta_app_service_create_application_key_request import BetaAppServiceCreateApplicationKeyRequest -from zitadel_client.models.beta_app_service_create_application_key_response import BetaAppServiceCreateApplicationKeyResponse -from zitadel_client.models.beta_app_service_create_application_request import BetaAppServiceCreateApplicationRequest -from zitadel_client.models.beta_app_service_create_application_response import BetaAppServiceCreateApplicationResponse -from zitadel_client.models.beta_app_service_create_oidc_application_request import BetaAppServiceCreateOIDCApplicationRequest -from zitadel_client.models.beta_app_service_create_oidc_application_response import BetaAppServiceCreateOIDCApplicationResponse -from zitadel_client.models.beta_app_service_create_saml_application_request import BetaAppServiceCreateSAMLApplicationRequest -from zitadel_client.models.beta_app_service_deactivate_application_request import BetaAppServiceDeactivateApplicationRequest -from zitadel_client.models.beta_app_service_deactivate_application_response import BetaAppServiceDeactivateApplicationResponse -from zitadel_client.models.beta_app_service_delete_application_key_request import BetaAppServiceDeleteApplicationKeyRequest -from zitadel_client.models.beta_app_service_delete_application_key_response import BetaAppServiceDeleteApplicationKeyResponse -from zitadel_client.models.beta_app_service_delete_application_request import BetaAppServiceDeleteApplicationRequest -from zitadel_client.models.beta_app_service_delete_application_response import BetaAppServiceDeleteApplicationResponse -from zitadel_client.models.beta_app_service_get_application_key_request import BetaAppServiceGetApplicationKeyRequest -from zitadel_client.models.beta_app_service_get_application_key_response import BetaAppServiceGetApplicationKeyResponse -from zitadel_client.models.beta_app_service_get_application_request import BetaAppServiceGetApplicationRequest -from zitadel_client.models.beta_app_service_get_application_response import BetaAppServiceGetApplicationResponse -from zitadel_client.models.beta_app_service_list_application_keys_request import BetaAppServiceListApplicationKeysRequest -from zitadel_client.models.beta_app_service_list_application_keys_response import BetaAppServiceListApplicationKeysResponse -from zitadel_client.models.beta_app_service_list_applications_request import BetaAppServiceListApplicationsRequest -from zitadel_client.models.beta_app_service_list_applications_response import BetaAppServiceListApplicationsResponse -from zitadel_client.models.beta_app_service_login_v2 import BetaAppServiceLoginV2 -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from zitadel_client.models.beta_app_service_oidc_app_type import BetaAppServiceOIDCAppType -from zitadel_client.models.beta_app_service_oidc_auth_method_type import BetaAppServiceOIDCAuthMethodType -from zitadel_client.models.beta_app_service_oidc_config import BetaAppServiceOIDCConfig -from zitadel_client.models.beta_app_service_oidc_grant_type import BetaAppServiceOIDCGrantType -from zitadel_client.models.beta_app_service_oidc_localized_message import BetaAppServiceOIDCLocalizedMessage -from zitadel_client.models.beta_app_service_oidc_response_type import BetaAppServiceOIDCResponseType -from zitadel_client.models.beta_app_service_oidc_token_type import BetaAppServiceOIDCTokenType -from zitadel_client.models.beta_app_service_oidc_version import BetaAppServiceOIDCVersion -from zitadel_client.models.beta_app_service_pagination_request import BetaAppServicePaginationRequest -from zitadel_client.models.beta_app_service_pagination_response import BetaAppServicePaginationResponse -from zitadel_client.models.beta_app_service_reactivate_application_request import BetaAppServiceReactivateApplicationRequest -from zitadel_client.models.beta_app_service_reactivate_application_response import BetaAppServiceReactivateApplicationResponse -from zitadel_client.models.beta_app_service_regenerate_client_secret_request import BetaAppServiceRegenerateClientSecretRequest -from zitadel_client.models.beta_app_service_regenerate_client_secret_response import BetaAppServiceRegenerateClientSecretResponse -from zitadel_client.models.beta_app_service_saml_config import BetaAppServiceSAMLConfig -from zitadel_client.models.beta_app_service_text_filter_method import BetaAppServiceTextFilterMethod -from zitadel_client.models.beta_app_service_update_api_application_configuration_request import BetaAppServiceUpdateAPIApplicationConfigurationRequest -from zitadel_client.models.beta_app_service_update_application_request import BetaAppServiceUpdateApplicationRequest -from zitadel_client.models.beta_app_service_update_application_response import BetaAppServiceUpdateApplicationResponse -from zitadel_client.models.beta_app_service_update_oidc_application_configuration_request import BetaAppServiceUpdateOIDCApplicationConfigurationRequest -from zitadel_client.models.beta_app_service_update_saml_application_configuration_request import BetaAppServiceUpdateSAMLApplicationConfigurationRequest -from zitadel_client.models.beta_authorization_service_activate_authorization_request import BetaAuthorizationServiceActivateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_activate_authorization_response import BetaAuthorizationServiceActivateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_any import BetaAuthorizationServiceAny -from zitadel_client.models.beta_authorization_service_authorization import BetaAuthorizationServiceAuthorization -from zitadel_client.models.beta_authorization_service_authorization_field_name import BetaAuthorizationServiceAuthorizationFieldName -from zitadel_client.models.beta_authorization_service_authorizations_search_filter import BetaAuthorizationServiceAuthorizationsSearchFilter -from zitadel_client.models.beta_authorization_service_connect_error import BetaAuthorizationServiceConnectError -from zitadel_client.models.beta_authorization_service_create_authorization_request import BetaAuthorizationServiceCreateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_create_authorization_response import BetaAuthorizationServiceCreateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_deactivate_authorization_request import BetaAuthorizationServiceDeactivateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_deactivate_authorization_response import BetaAuthorizationServiceDeactivateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_delete_authorization_request import BetaAuthorizationServiceDeleteAuthorizationRequest -from zitadel_client.models.beta_authorization_service_delete_authorization_response import BetaAuthorizationServiceDeleteAuthorizationResponse -from zitadel_client.models.beta_authorization_service_id_filter import BetaAuthorizationServiceIDFilter -from zitadel_client.models.beta_authorization_service_in_ids_filter import BetaAuthorizationServiceInIDsFilter -from zitadel_client.models.beta_authorization_service_list_authorizations_request import BetaAuthorizationServiceListAuthorizationsRequest -from zitadel_client.models.beta_authorization_service_list_authorizations_response import BetaAuthorizationServiceListAuthorizationsResponse -from zitadel_client.models.beta_authorization_service_pagination_request import BetaAuthorizationServicePaginationRequest -from zitadel_client.models.beta_authorization_service_pagination_response import BetaAuthorizationServicePaginationResponse -from zitadel_client.models.beta_authorization_service_project_name_query import BetaAuthorizationServiceProjectNameQuery -from zitadel_client.models.beta_authorization_service_role_key_query import BetaAuthorizationServiceRoleKeyQuery -from zitadel_client.models.beta_authorization_service_state import BetaAuthorizationServiceState -from zitadel_client.models.beta_authorization_service_state_query import BetaAuthorizationServiceStateQuery -from zitadel_client.models.beta_authorization_service_text_filter_method import BetaAuthorizationServiceTextFilterMethod -from zitadel_client.models.beta_authorization_service_update_authorization_request import BetaAuthorizationServiceUpdateAuthorizationRequest -from zitadel_client.models.beta_authorization_service_update_authorization_response import BetaAuthorizationServiceUpdateAuthorizationResponse -from zitadel_client.models.beta_authorization_service_user import BetaAuthorizationServiceUser -from zitadel_client.models.beta_authorization_service_user_display_name_query import BetaAuthorizationServiceUserDisplayNameQuery -from zitadel_client.models.beta_authorization_service_user_preferred_login_name_query import BetaAuthorizationServiceUserPreferredLoginNameQuery -from zitadel_client.models.beta_feature_service_any import BetaFeatureServiceAny -from zitadel_client.models.beta_feature_service_connect_error import BetaFeatureServiceConnectError -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from zitadel_client.models.beta_feature_service_feature_flag import BetaFeatureServiceFeatureFlag -from zitadel_client.models.beta_feature_service_get_instance_features_request import BetaFeatureServiceGetInstanceFeaturesRequest -from zitadel_client.models.beta_feature_service_get_instance_features_response import BetaFeatureServiceGetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_get_organization_features_request import BetaFeatureServiceGetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_get_organization_features_response import BetaFeatureServiceGetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_get_system_features_response import BetaFeatureServiceGetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_get_user_features_request import BetaFeatureServiceGetUserFeaturesRequest -from zitadel_client.models.beta_feature_service_get_user_features_response import BetaFeatureServiceGetUserFeaturesResponse -from zitadel_client.models.beta_feature_service_improved_performance import BetaFeatureServiceImprovedPerformance -from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import BetaFeatureServiceImprovedPerformanceFeatureFlag -from zitadel_client.models.beta_feature_service_reset_instance_features_response import BetaFeatureServiceResetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_organization_features_request import BetaFeatureServiceResetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_reset_organization_features_response import BetaFeatureServiceResetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_system_features_response import BetaFeatureServiceResetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_reset_user_features_request import BetaFeatureServiceResetUserFeaturesRequest -from zitadel_client.models.beta_feature_service_reset_user_features_response import BetaFeatureServiceResetUserFeaturesResponse -from zitadel_client.models.beta_feature_service_set_instance_features_request import BetaFeatureServiceSetInstanceFeaturesRequest -from zitadel_client.models.beta_feature_service_set_instance_features_response import BetaFeatureServiceSetInstanceFeaturesResponse -from zitadel_client.models.beta_feature_service_set_organization_features_request import BetaFeatureServiceSetOrganizationFeaturesRequest -from zitadel_client.models.beta_feature_service_set_organization_features_response import BetaFeatureServiceSetOrganizationFeaturesResponse -from zitadel_client.models.beta_feature_service_set_system_features_request import BetaFeatureServiceSetSystemFeaturesRequest -from zitadel_client.models.beta_feature_service_set_system_features_response import BetaFeatureServiceSetSystemFeaturesResponse -from zitadel_client.models.beta_feature_service_set_user_feature_request import BetaFeatureServiceSetUserFeatureRequest -from zitadel_client.models.beta_feature_service_set_user_features_response import BetaFeatureServiceSetUserFeaturesResponse -from zitadel_client.models.beta_feature_service_source import BetaFeatureServiceSource -from zitadel_client.models.beta_instance_service_add_custom_domain_request import BetaInstanceServiceAddCustomDomainRequest -from zitadel_client.models.beta_instance_service_add_custom_domain_response import BetaInstanceServiceAddCustomDomainResponse -from zitadel_client.models.beta_instance_service_add_trusted_domain_request import BetaInstanceServiceAddTrustedDomainRequest -from zitadel_client.models.beta_instance_service_add_trusted_domain_response import BetaInstanceServiceAddTrustedDomainResponse -from zitadel_client.models.beta_instance_service_any import BetaInstanceServiceAny -from zitadel_client.models.beta_instance_service_connect_error import BetaInstanceServiceConnectError -from zitadel_client.models.beta_instance_service_delete_instance_request import BetaInstanceServiceDeleteInstanceRequest -from zitadel_client.models.beta_instance_service_delete_instance_response import BetaInstanceServiceDeleteInstanceResponse -from zitadel_client.models.beta_instance_service_domain import BetaInstanceServiceDomain -from zitadel_client.models.beta_instance_service_domain_field_name import BetaInstanceServiceDomainFieldName -from zitadel_client.models.beta_instance_service_domain_generated_query import BetaInstanceServiceDomainGeneratedQuery -from zitadel_client.models.beta_instance_service_domain_primary_query import BetaInstanceServiceDomainPrimaryQuery -from zitadel_client.models.beta_instance_service_domain_query import BetaInstanceServiceDomainQuery -from zitadel_client.models.beta_instance_service_domain_search_query import BetaInstanceServiceDomainSearchQuery -from zitadel_client.models.beta_instance_service_domains_query import BetaInstanceServiceDomainsQuery -from zitadel_client.models.beta_instance_service_field_name import BetaInstanceServiceFieldName -from zitadel_client.models.beta_instance_service_get_instance_request import BetaInstanceServiceGetInstanceRequest -from zitadel_client.models.beta_instance_service_get_instance_response import BetaInstanceServiceGetInstanceResponse -from zitadel_client.models.beta_instance_service_ids_query import BetaInstanceServiceIdsQuery -from zitadel_client.models.beta_instance_service_instance import BetaInstanceServiceInstance -from zitadel_client.models.beta_instance_service_list_custom_domains_request import BetaInstanceServiceListCustomDomainsRequest -from zitadel_client.models.beta_instance_service_list_custom_domains_response import BetaInstanceServiceListCustomDomainsResponse -from zitadel_client.models.beta_instance_service_list_instances_request import BetaInstanceServiceListInstancesRequest -from zitadel_client.models.beta_instance_service_list_instances_response import BetaInstanceServiceListInstancesResponse -from zitadel_client.models.beta_instance_service_list_trusted_domains_request import BetaInstanceServiceListTrustedDomainsRequest -from zitadel_client.models.beta_instance_service_list_trusted_domains_response import BetaInstanceServiceListTrustedDomainsResponse -from zitadel_client.models.beta_instance_service_pagination_request import BetaInstanceServicePaginationRequest -from zitadel_client.models.beta_instance_service_pagination_response import BetaInstanceServicePaginationResponse -from zitadel_client.models.beta_instance_service_query import BetaInstanceServiceQuery -from zitadel_client.models.beta_instance_service_remove_custom_domain_request import BetaInstanceServiceRemoveCustomDomainRequest -from zitadel_client.models.beta_instance_service_remove_custom_domain_response import BetaInstanceServiceRemoveCustomDomainResponse -from zitadel_client.models.beta_instance_service_remove_trusted_domain_request import BetaInstanceServiceRemoveTrustedDomainRequest -from zitadel_client.models.beta_instance_service_remove_trusted_domain_response import BetaInstanceServiceRemoveTrustedDomainResponse -from zitadel_client.models.beta_instance_service_state import BetaInstanceServiceState -from zitadel_client.models.beta_instance_service_text_query_method import BetaInstanceServiceTextQueryMethod -from zitadel_client.models.beta_instance_service_trusted_domain import BetaInstanceServiceTrustedDomain -from zitadel_client.models.beta_instance_service_trusted_domain_field_name import BetaInstanceServiceTrustedDomainFieldName -from zitadel_client.models.beta_instance_service_trusted_domain_search_query import BetaInstanceServiceTrustedDomainSearchQuery -from zitadel_client.models.beta_instance_service_update_instance_request import BetaInstanceServiceUpdateInstanceRequest -from zitadel_client.models.beta_instance_service_update_instance_response import BetaInstanceServiceUpdateInstanceResponse -from zitadel_client.models.beta_internal_permission_service_administrator import BetaInternalPermissionServiceAdministrator -from zitadel_client.models.beta_internal_permission_service_administrator_field_name import BetaInternalPermissionServiceAdministratorFieldName -from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import BetaInternalPermissionServiceAdministratorSearchFilter -from zitadel_client.models.beta_internal_permission_service_and_filter import BetaInternalPermissionServiceAndFilter -from zitadel_client.models.beta_internal_permission_service_any import BetaInternalPermissionServiceAny -from zitadel_client.models.beta_internal_permission_service_connect_error import BetaInternalPermissionServiceConnectError -from zitadel_client.models.beta_internal_permission_service_create_administrator_request import BetaInternalPermissionServiceCreateAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_create_administrator_response import BetaInternalPermissionServiceCreateAdministratorResponse -from zitadel_client.models.beta_internal_permission_service_delete_administrator_request import BetaInternalPermissionServiceDeleteAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_delete_administrator_response import BetaInternalPermissionServiceDeleteAdministratorResponse -from zitadel_client.models.beta_internal_permission_service_id_filter import BetaInternalPermissionServiceIDFilter -from zitadel_client.models.beta_internal_permission_service_in_ids_filter import BetaInternalPermissionServiceInIDsFilter -from zitadel_client.models.beta_internal_permission_service_list_administrators_request import BetaInternalPermissionServiceListAdministratorsRequest -from zitadel_client.models.beta_internal_permission_service_list_administrators_response import BetaInternalPermissionServiceListAdministratorsResponse -from zitadel_client.models.beta_internal_permission_service_not_filter import BetaInternalPermissionServiceNotFilter -from zitadel_client.models.beta_internal_permission_service_or_filter import BetaInternalPermissionServiceOrFilter -from zitadel_client.models.beta_internal_permission_service_organization import BetaInternalPermissionServiceOrganization -from zitadel_client.models.beta_internal_permission_service_pagination_request import BetaInternalPermissionServicePaginationRequest -from zitadel_client.models.beta_internal_permission_service_pagination_response import BetaInternalPermissionServicePaginationResponse -from zitadel_client.models.beta_internal_permission_service_project import BetaInternalPermissionServiceProject -from zitadel_client.models.beta_internal_permission_service_project_grant import BetaInternalPermissionServiceProjectGrant -from zitadel_client.models.beta_internal_permission_service_resource_filter import BetaInternalPermissionServiceResourceFilter -from zitadel_client.models.beta_internal_permission_service_resource_type import BetaInternalPermissionServiceResourceType -from zitadel_client.models.beta_internal_permission_service_role_filter import BetaInternalPermissionServiceRoleFilter -from zitadel_client.models.beta_internal_permission_service_text_filter_method import BetaInternalPermissionServiceTextFilterMethod -from zitadel_client.models.beta_internal_permission_service_timestamp_filter import BetaInternalPermissionServiceTimestampFilter -from zitadel_client.models.beta_internal_permission_service_timestamp_filter_method import BetaInternalPermissionServiceTimestampFilterMethod -from zitadel_client.models.beta_internal_permission_service_update_administrator_request import BetaInternalPermissionServiceUpdateAdministratorRequest -from zitadel_client.models.beta_internal_permission_service_update_administrator_response import BetaInternalPermissionServiceUpdateAdministratorResponse -from zitadel_client.models.beta_internal_permission_service_user import BetaInternalPermissionServiceUser -from zitadel_client.models.beta_internal_permission_service_user_display_name_filter import BetaInternalPermissionServiceUserDisplayNameFilter -from zitadel_client.models.beta_internal_permission_service_user_preferred_login_name_filter import BetaInternalPermissionServiceUserPreferredLoginNameFilter -from zitadel_client.models.beta_oidc_service_any import BetaOIDCServiceAny -from zitadel_client.models.beta_oidc_service_auth_request import BetaOIDCServiceAuthRequest -from zitadel_client.models.beta_oidc_service_authorization_error import BetaOIDCServiceAuthorizationError -from zitadel_client.models.beta_oidc_service_connect_error import BetaOIDCServiceConnectError -from zitadel_client.models.beta_oidc_service_create_callback_request import BetaOIDCServiceCreateCallbackRequest -from zitadel_client.models.beta_oidc_service_create_callback_response import BetaOIDCServiceCreateCallbackResponse -from zitadel_client.models.beta_oidc_service_details import BetaOIDCServiceDetails -from zitadel_client.models.beta_oidc_service_error_reason import BetaOIDCServiceErrorReason -from zitadel_client.models.beta_oidc_service_get_auth_request_request import BetaOIDCServiceGetAuthRequestRequest -from zitadel_client.models.beta_oidc_service_get_auth_request_response import BetaOIDCServiceGetAuthRequestResponse -from zitadel_client.models.beta_oidc_service_prompt import BetaOIDCServicePrompt -from zitadel_client.models.beta_oidc_service_session import BetaOIDCServiceSession -from zitadel_client.models.beta_organization_service_activate_organization_request import BetaOrganizationServiceActivateOrganizationRequest -from zitadel_client.models.beta_organization_service_activate_organization_response import BetaOrganizationServiceActivateOrganizationResponse -from zitadel_client.models.beta_organization_service_add_human_user_request import BetaOrganizationServiceAddHumanUserRequest -from zitadel_client.models.beta_organization_service_add_organization_domain_request import BetaOrganizationServiceAddOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_add_organization_domain_response import BetaOrganizationServiceAddOrganizationDomainResponse -from zitadel_client.models.beta_organization_service_admin import BetaOrganizationServiceAdmin -from zitadel_client.models.beta_organization_service_any import BetaOrganizationServiceAny -from zitadel_client.models.beta_organization_service_assigned_admin import BetaOrganizationServiceAssignedAdmin -from zitadel_client.models.beta_organization_service_connect_error import BetaOrganizationServiceConnectError -from zitadel_client.models.beta_organization_service_create_organization_request import BetaOrganizationServiceCreateOrganizationRequest -from zitadel_client.models.beta_organization_service_create_organization_response import BetaOrganizationServiceCreateOrganizationResponse -from zitadel_client.models.beta_organization_service_created_admin import BetaOrganizationServiceCreatedAdmin -from zitadel_client.models.beta_organization_service_deactivate_organization_request import BetaOrganizationServiceDeactivateOrganizationRequest -from zitadel_client.models.beta_organization_service_deactivate_organization_response import BetaOrganizationServiceDeactivateOrganizationResponse -from zitadel_client.models.beta_organization_service_delete_organization_domain_request import BetaOrganizationServiceDeleteOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_delete_organization_domain_response import BetaOrganizationServiceDeleteOrganizationDomainResponse -from zitadel_client.models.beta_organization_service_delete_organization_metadata_request import BetaOrganizationServiceDeleteOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_delete_organization_metadata_response import BetaOrganizationServiceDeleteOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_delete_organization_request import BetaOrganizationServiceDeleteOrganizationRequest -from zitadel_client.models.beta_organization_service_delete_organization_response import BetaOrganizationServiceDeleteOrganizationResponse -from zitadel_client.models.beta_organization_service_domain import BetaOrganizationServiceDomain -from zitadel_client.models.beta_organization_service_domain_name_filter import BetaOrganizationServiceDomainNameFilter -from zitadel_client.models.beta_organization_service_domain_search_filter import BetaOrganizationServiceDomainSearchFilter -from zitadel_client.models.beta_organization_service_domain_validation_type import BetaOrganizationServiceDomainValidationType -from zitadel_client.models.beta_organization_service_gender import BetaOrganizationServiceGender -from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_request import BetaOrganizationServiceGenerateOrganizationDomainValidationRequest -from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_response import BetaOrganizationServiceGenerateOrganizationDomainValidationResponse -from zitadel_client.models.beta_organization_service_hashed_password import BetaOrganizationServiceHashedPassword -from zitadel_client.models.beta_organization_service_idp_link import BetaOrganizationServiceIDPLink -from zitadel_client.models.beta_organization_service_list_organization_domains_request import BetaOrganizationServiceListOrganizationDomainsRequest -from zitadel_client.models.beta_organization_service_list_organization_domains_response import BetaOrganizationServiceListOrganizationDomainsResponse -from zitadel_client.models.beta_organization_service_list_organization_metadata_request import BetaOrganizationServiceListOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_list_organization_metadata_response import BetaOrganizationServiceListOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_list_organizations_request import BetaOrganizationServiceListOrganizationsRequest -from zitadel_client.models.beta_organization_service_list_organizations_response import BetaOrganizationServiceListOrganizationsResponse -from zitadel_client.models.beta_organization_service_metadata import BetaOrganizationServiceMetadata -from zitadel_client.models.beta_organization_service_metadata_key_query import BetaOrganizationServiceMetadataKeyQuery -from zitadel_client.models.beta_organization_service_metadata_query import BetaOrganizationServiceMetadataQuery -from zitadel_client.models.beta_organization_service_org_domain_filter import BetaOrganizationServiceOrgDomainFilter -from zitadel_client.models.beta_organization_service_org_field_name import BetaOrganizationServiceOrgFieldName -from zitadel_client.models.beta_organization_service_org_id_filter import BetaOrganizationServiceOrgIDFilter -from zitadel_client.models.beta_organization_service_org_name_filter import BetaOrganizationServiceOrgNameFilter -from zitadel_client.models.beta_organization_service_org_state import BetaOrganizationServiceOrgState -from zitadel_client.models.beta_organization_service_org_state_filter import BetaOrganizationServiceOrgStateFilter -from zitadel_client.models.beta_organization_service_organization import BetaOrganizationServiceOrganization -from zitadel_client.models.beta_organization_service_organization_admin import BetaOrganizationServiceOrganizationAdmin -from zitadel_client.models.beta_organization_service_organization_search_filter import BetaOrganizationServiceOrganizationSearchFilter -from zitadel_client.models.beta_organization_service_pagination_request import BetaOrganizationServicePaginationRequest -from zitadel_client.models.beta_organization_service_pagination_response import BetaOrganizationServicePaginationResponse -from zitadel_client.models.beta_organization_service_password import BetaOrganizationServicePassword -from zitadel_client.models.beta_organization_service_send_email_verification_code import BetaOrganizationServiceSendEmailVerificationCode -from zitadel_client.models.beta_organization_service_set_human_email import BetaOrganizationServiceSetHumanEmail -from zitadel_client.models.beta_organization_service_set_human_phone import BetaOrganizationServiceSetHumanPhone -from zitadel_client.models.beta_organization_service_set_human_profile import BetaOrganizationServiceSetHumanProfile -from zitadel_client.models.beta_organization_service_set_metadata_entry import BetaOrganizationServiceSetMetadataEntry -from zitadel_client.models.beta_organization_service_set_organization_metadata_request import BetaOrganizationServiceSetOrganizationMetadataRequest -from zitadel_client.models.beta_organization_service_set_organization_metadata_response import BetaOrganizationServiceSetOrganizationMetadataResponse -from zitadel_client.models.beta_organization_service_text_query_method import BetaOrganizationServiceTextQueryMethod -from zitadel_client.models.beta_organization_service_update_organization_request import BetaOrganizationServiceUpdateOrganizationRequest -from zitadel_client.models.beta_organization_service_update_organization_response import BetaOrganizationServiceUpdateOrganizationResponse -from zitadel_client.models.beta_organization_service_verify_organization_domain_request import BetaOrganizationServiceVerifyOrganizationDomainRequest -from zitadel_client.models.beta_organization_service_verify_organization_domain_response import BetaOrganizationServiceVerifyOrganizationDomainResponse -from zitadel_client.models.beta_project_service_activate_project_grant_request import BetaProjectServiceActivateProjectGrantRequest -from zitadel_client.models.beta_project_service_activate_project_grant_response import BetaProjectServiceActivateProjectGrantResponse -from zitadel_client.models.beta_project_service_activate_project_request import BetaProjectServiceActivateProjectRequest -from zitadel_client.models.beta_project_service_activate_project_response import BetaProjectServiceActivateProjectResponse -from zitadel_client.models.beta_project_service_add_project_role_request import BetaProjectServiceAddProjectRoleRequest -from zitadel_client.models.beta_project_service_add_project_role_response import BetaProjectServiceAddProjectRoleResponse -from zitadel_client.models.beta_project_service_admin import BetaProjectServiceAdmin -from zitadel_client.models.beta_project_service_any import BetaProjectServiceAny -from zitadel_client.models.beta_project_service_connect_error import BetaProjectServiceConnectError -from zitadel_client.models.beta_project_service_create_project_grant_request import BetaProjectServiceCreateProjectGrantRequest -from zitadel_client.models.beta_project_service_create_project_grant_response import BetaProjectServiceCreateProjectGrantResponse -from zitadel_client.models.beta_project_service_create_project_request import BetaProjectServiceCreateProjectRequest -from zitadel_client.models.beta_project_service_create_project_response import BetaProjectServiceCreateProjectResponse -from zitadel_client.models.beta_project_service_deactivate_project_grant_request import BetaProjectServiceDeactivateProjectGrantRequest -from zitadel_client.models.beta_project_service_deactivate_project_grant_response import BetaProjectServiceDeactivateProjectGrantResponse -from zitadel_client.models.beta_project_service_deactivate_project_request import BetaProjectServiceDeactivateProjectRequest -from zitadel_client.models.beta_project_service_deactivate_project_response import BetaProjectServiceDeactivateProjectResponse -from zitadel_client.models.beta_project_service_delete_project_grant_request import BetaProjectServiceDeleteProjectGrantRequest -from zitadel_client.models.beta_project_service_delete_project_grant_response import BetaProjectServiceDeleteProjectGrantResponse -from zitadel_client.models.beta_project_service_delete_project_request import BetaProjectServiceDeleteProjectRequest -from zitadel_client.models.beta_project_service_delete_project_response import BetaProjectServiceDeleteProjectResponse -from zitadel_client.models.beta_project_service_get_project_request import BetaProjectServiceGetProjectRequest -from zitadel_client.models.beta_project_service_get_project_response import BetaProjectServiceGetProjectResponse -from zitadel_client.models.beta_project_service_granted_project_state import BetaProjectServiceGrantedProjectState -from zitadel_client.models.beta_project_service_id_filter import BetaProjectServiceIDFilter -from zitadel_client.models.beta_project_service_in_ids_filter import BetaProjectServiceInIDsFilter -from zitadel_client.models.beta_project_service_list_project_grants_request import BetaProjectServiceListProjectGrantsRequest -from zitadel_client.models.beta_project_service_list_project_grants_response import BetaProjectServiceListProjectGrantsResponse -from zitadel_client.models.beta_project_service_list_project_roles_request import BetaProjectServiceListProjectRolesRequest -from zitadel_client.models.beta_project_service_list_project_roles_response import BetaProjectServiceListProjectRolesResponse -from zitadel_client.models.beta_project_service_list_projects_request import BetaProjectServiceListProjectsRequest -from zitadel_client.models.beta_project_service_list_projects_response import BetaProjectServiceListProjectsResponse -from zitadel_client.models.beta_project_service_pagination_request import BetaProjectServicePaginationRequest -from zitadel_client.models.beta_project_service_pagination_response import BetaProjectServicePaginationResponse -from zitadel_client.models.beta_project_service_private_labeling_setting import BetaProjectServicePrivateLabelingSetting -from zitadel_client.models.beta_project_service_project import BetaProjectServiceProject -from zitadel_client.models.beta_project_service_project_field_name import BetaProjectServiceProjectFieldName -from zitadel_client.models.beta_project_service_project_grant import BetaProjectServiceProjectGrant -from zitadel_client.models.beta_project_service_project_grant_field_name import BetaProjectServiceProjectGrantFieldName -from zitadel_client.models.beta_project_service_project_grant_search_filter import BetaProjectServiceProjectGrantSearchFilter -from zitadel_client.models.beta_project_service_project_grant_state import BetaProjectServiceProjectGrantState -from zitadel_client.models.beta_project_service_project_name_filter import BetaProjectServiceProjectNameFilter -from zitadel_client.models.beta_project_service_project_role import BetaProjectServiceProjectRole -from zitadel_client.models.beta_project_service_project_role_display_name_filter import BetaProjectServiceProjectRoleDisplayNameFilter -from zitadel_client.models.beta_project_service_project_role_field_name import BetaProjectServiceProjectRoleFieldName -from zitadel_client.models.beta_project_service_project_role_key_filter import BetaProjectServiceProjectRoleKeyFilter -from zitadel_client.models.beta_project_service_project_role_search_filter import BetaProjectServiceProjectRoleSearchFilter -from zitadel_client.models.beta_project_service_project_search_filter import BetaProjectServiceProjectSearchFilter -from zitadel_client.models.beta_project_service_project_state import BetaProjectServiceProjectState -from zitadel_client.models.beta_project_service_remove_project_role_request import BetaProjectServiceRemoveProjectRoleRequest -from zitadel_client.models.beta_project_service_remove_project_role_response import BetaProjectServiceRemoveProjectRoleResponse -from zitadel_client.models.beta_project_service_text_filter_method import BetaProjectServiceTextFilterMethod -from zitadel_client.models.beta_project_service_update_project_grant_request import BetaProjectServiceUpdateProjectGrantRequest -from zitadel_client.models.beta_project_service_update_project_grant_response import BetaProjectServiceUpdateProjectGrantResponse -from zitadel_client.models.beta_project_service_update_project_request import BetaProjectServiceUpdateProjectRequest -from zitadel_client.models.beta_project_service_update_project_response import BetaProjectServiceUpdateProjectResponse -from zitadel_client.models.beta_project_service_update_project_role_request import BetaProjectServiceUpdateProjectRoleRequest -from zitadel_client.models.beta_project_service_update_project_role_response import BetaProjectServiceUpdateProjectRoleResponse -from zitadel_client.models.beta_session_service_any import BetaSessionServiceAny -from zitadel_client.models.beta_session_service_challenges import BetaSessionServiceChallenges -from zitadel_client.models.beta_session_service_check_idp_intent import BetaSessionServiceCheckIDPIntent -from zitadel_client.models.beta_session_service_check_otp import BetaSessionServiceCheckOTP -from zitadel_client.models.beta_session_service_check_password import BetaSessionServiceCheckPassword -from zitadel_client.models.beta_session_service_check_totp import BetaSessionServiceCheckTOTP -from zitadel_client.models.beta_session_service_check_user import BetaSessionServiceCheckUser -from zitadel_client.models.beta_session_service_check_web_auth_n import BetaSessionServiceCheckWebAuthN -from zitadel_client.models.beta_session_service_checks import BetaSessionServiceChecks -from zitadel_client.models.beta_session_service_connect_error import BetaSessionServiceConnectError -from zitadel_client.models.beta_session_service_create_session_request import BetaSessionServiceCreateSessionRequest -from zitadel_client.models.beta_session_service_create_session_response import BetaSessionServiceCreateSessionResponse -from zitadel_client.models.beta_session_service_creation_date_query import BetaSessionServiceCreationDateQuery -from zitadel_client.models.beta_session_service_delete_session_request import BetaSessionServiceDeleteSessionRequest -from zitadel_client.models.beta_session_service_delete_session_response import BetaSessionServiceDeleteSessionResponse -from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails -from zitadel_client.models.beta_session_service_factors import BetaSessionServiceFactors -from zitadel_client.models.beta_session_service_get_session_request import BetaSessionServiceGetSessionRequest -from zitadel_client.models.beta_session_service_get_session_response import BetaSessionServiceGetSessionResponse -from zitadel_client.models.beta_session_service_header_values import BetaSessionServiceHeaderValues -from zitadel_client.models.beta_session_service_ids_query import BetaSessionServiceIDsQuery -from zitadel_client.models.beta_session_service_intent_factor import BetaSessionServiceIntentFactor -from zitadel_client.models.beta_session_service_list_details import BetaSessionServiceListDetails -from zitadel_client.models.beta_session_service_list_query import BetaSessionServiceListQuery -from zitadel_client.models.beta_session_service_list_sessions_request import BetaSessionServiceListSessionsRequest -from zitadel_client.models.beta_session_service_list_sessions_response import BetaSessionServiceListSessionsResponse -from zitadel_client.models.beta_session_service_otp_email import BetaSessionServiceOTPEmail -from zitadel_client.models.beta_session_service_otp_factor import BetaSessionServiceOTPFactor -from zitadel_client.models.beta_session_service_otpsms import BetaSessionServiceOTPSMS -from zitadel_client.models.beta_session_service_password_factor import BetaSessionServicePasswordFactor -from zitadel_client.models.beta_session_service_request_challenges import BetaSessionServiceRequestChallenges -from zitadel_client.models.beta_session_service_search_query import BetaSessionServiceSearchQuery -from zitadel_client.models.beta_session_service_send_code import BetaSessionServiceSendCode -from zitadel_client.models.beta_session_service_session import BetaSessionServiceSession -from zitadel_client.models.beta_session_service_session_field_name import BetaSessionServiceSessionFieldName -from zitadel_client.models.beta_session_service_set_session_request import BetaSessionServiceSetSessionRequest -from zitadel_client.models.beta_session_service_set_session_response import BetaSessionServiceSetSessionResponse -from zitadel_client.models.beta_session_service_totp_factor import BetaSessionServiceTOTPFactor -from zitadel_client.models.beta_session_service_timestamp_query_method import BetaSessionServiceTimestampQueryMethod -from zitadel_client.models.beta_session_service_user_agent import BetaSessionServiceUserAgent -from zitadel_client.models.beta_session_service_user_factor import BetaSessionServiceUserFactor -from zitadel_client.models.beta_session_service_user_id_query import BetaSessionServiceUserIDQuery -from zitadel_client.models.beta_session_service_user_verification_requirement import BetaSessionServiceUserVerificationRequirement -from zitadel_client.models.beta_session_service_web_auth_n import BetaSessionServiceWebAuthN -from zitadel_client.models.beta_session_service_web_auth_n_factor import BetaSessionServiceWebAuthNFactor -from zitadel_client.models.beta_settings_service_any import BetaSettingsServiceAny -from zitadel_client.models.beta_settings_service_branding_settings import BetaSettingsServiceBrandingSettings -from zitadel_client.models.beta_settings_service_connect_error import BetaSettingsServiceConnectError -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_domain_settings import BetaSettingsServiceDomainSettings -from zitadel_client.models.beta_settings_service_embedded_iframe_settings import BetaSettingsServiceEmbeddedIframeSettings -from zitadel_client.models.beta_settings_service_get_active_identity_providers_request import BetaSettingsServiceGetActiveIdentityProvidersRequest -from zitadel_client.models.beta_settings_service_get_active_identity_providers_response import BetaSettingsServiceGetActiveIdentityProvidersResponse -from zitadel_client.models.beta_settings_service_get_branding_settings_request import BetaSettingsServiceGetBrandingSettingsRequest -from zitadel_client.models.beta_settings_service_get_branding_settings_response import BetaSettingsServiceGetBrandingSettingsResponse -from zitadel_client.models.beta_settings_service_get_domain_settings_request import BetaSettingsServiceGetDomainSettingsRequest -from zitadel_client.models.beta_settings_service_get_domain_settings_response import BetaSettingsServiceGetDomainSettingsResponse -from zitadel_client.models.beta_settings_service_get_general_settings_response import BetaSettingsServiceGetGeneralSettingsResponse -from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_request import BetaSettingsServiceGetLegalAndSupportSettingsRequest -from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_response import BetaSettingsServiceGetLegalAndSupportSettingsResponse -from zitadel_client.models.beta_settings_service_get_lockout_settings_request import BetaSettingsServiceGetLockoutSettingsRequest -from zitadel_client.models.beta_settings_service_get_lockout_settings_response import BetaSettingsServiceGetLockoutSettingsResponse -from zitadel_client.models.beta_settings_service_get_login_settings_request import BetaSettingsServiceGetLoginSettingsRequest -from zitadel_client.models.beta_settings_service_get_login_settings_response import BetaSettingsServiceGetLoginSettingsResponse -from zitadel_client.models.beta_settings_service_get_password_complexity_settings_request import BetaSettingsServiceGetPasswordComplexitySettingsRequest -from zitadel_client.models.beta_settings_service_get_password_complexity_settings_response import BetaSettingsServiceGetPasswordComplexitySettingsResponse -from zitadel_client.models.beta_settings_service_get_password_expiry_settings_request import BetaSettingsServiceGetPasswordExpirySettingsRequest -from zitadel_client.models.beta_settings_service_get_password_expiry_settings_response import BetaSettingsServiceGetPasswordExpirySettingsResponse -from zitadel_client.models.beta_settings_service_get_security_settings_response import BetaSettingsServiceGetSecuritySettingsResponse -from zitadel_client.models.beta_settings_service_identity_provider import BetaSettingsServiceIdentityProvider -from zitadel_client.models.beta_settings_service_identity_provider_type import BetaSettingsServiceIdentityProviderType -from zitadel_client.models.beta_settings_service_legal_and_support_settings import BetaSettingsServiceLegalAndSupportSettings -from zitadel_client.models.beta_settings_service_list_details import BetaSettingsServiceListDetails -from zitadel_client.models.beta_settings_service_lockout_settings import BetaSettingsServiceLockoutSettings -from zitadel_client.models.beta_settings_service_login_settings import BetaSettingsServiceLoginSettings -from zitadel_client.models.beta_settings_service_multi_factor_type import BetaSettingsServiceMultiFactorType -from zitadel_client.models.beta_settings_service_passkeys_type import BetaSettingsServicePasskeysType -from zitadel_client.models.beta_settings_service_password_complexity_settings import BetaSettingsServicePasswordComplexitySettings -from zitadel_client.models.beta_settings_service_password_expiry_settings import BetaSettingsServicePasswordExpirySettings -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from zitadel_client.models.beta_settings_service_second_factor_type import BetaSettingsServiceSecondFactorType -from zitadel_client.models.beta_settings_service_security_settings import BetaSettingsServiceSecuritySettings -from zitadel_client.models.beta_settings_service_set_security_settings_request import BetaSettingsServiceSetSecuritySettingsRequest -from zitadel_client.models.beta_settings_service_set_security_settings_response import BetaSettingsServiceSetSecuritySettingsResponse -from zitadel_client.models.beta_settings_service_theme import BetaSettingsServiceTheme -from zitadel_client.models.beta_settings_service_theme_mode import BetaSettingsServiceThemeMode -from zitadel_client.models.beta_telemetry_service_any import BetaTelemetryServiceAny -from zitadel_client.models.beta_telemetry_service_connect_error import BetaTelemetryServiceConnectError -from zitadel_client.models.beta_telemetry_service_count_parent_type import BetaTelemetryServiceCountParentType -from zitadel_client.models.beta_telemetry_service_instance_information import BetaTelemetryServiceInstanceInformation -from zitadel_client.models.beta_telemetry_service_report_base_information_request import BetaTelemetryServiceReportBaseInformationRequest -from zitadel_client.models.beta_telemetry_service_report_base_information_response import BetaTelemetryServiceReportBaseInformationResponse -from zitadel_client.models.beta_telemetry_service_report_resource_counts_request import BetaTelemetryServiceReportResourceCountsRequest -from zitadel_client.models.beta_telemetry_service_report_resource_counts_response import BetaTelemetryServiceReportResourceCountsResponse -from zitadel_client.models.beta_telemetry_service_resource_count import BetaTelemetryServiceResourceCount -from zitadel_client.models.beta_user_service_access_token_type import BetaUserServiceAccessTokenType -from zitadel_client.models.beta_user_service_add_human_user_request import BetaUserServiceAddHumanUserRequest -from zitadel_client.models.beta_user_service_add_human_user_response import BetaUserServiceAddHumanUserResponse -from zitadel_client.models.beta_user_service_add_idp_link_request import BetaUserServiceAddIDPLinkRequest -from zitadel_client.models.beta_user_service_add_idp_link_response import BetaUserServiceAddIDPLinkResponse -from zitadel_client.models.beta_user_service_add_otp_email_request import BetaUserServiceAddOTPEmailRequest -from zitadel_client.models.beta_user_service_add_otp_email_response import BetaUserServiceAddOTPEmailResponse -from zitadel_client.models.beta_user_service_add_otpsms_request import BetaUserServiceAddOTPSMSRequest -from zitadel_client.models.beta_user_service_add_otpsms_response import BetaUserServiceAddOTPSMSResponse -from zitadel_client.models.beta_user_service_and_query import BetaUserServiceAndQuery -from zitadel_client.models.beta_user_service_any import BetaUserServiceAny -from zitadel_client.models.beta_user_service_authentication_method_type import BetaUserServiceAuthenticationMethodType -from zitadel_client.models.beta_user_service_connect_error import BetaUserServiceConnectError -from zitadel_client.models.beta_user_service_create_passkey_registration_link_request import BetaUserServiceCreatePasskeyRegistrationLinkRequest -from zitadel_client.models.beta_user_service_create_passkey_registration_link_response import BetaUserServiceCreatePasskeyRegistrationLinkResponse -from zitadel_client.models.beta_user_service_deactivate_user_request import BetaUserServiceDeactivateUserRequest -from zitadel_client.models.beta_user_service_deactivate_user_response import BetaUserServiceDeactivateUserResponse -from zitadel_client.models.beta_user_service_delete_user_request import BetaUserServiceDeleteUserRequest -from zitadel_client.models.beta_user_service_delete_user_response import BetaUserServiceDeleteUserResponse -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_display_name_query import BetaUserServiceDisplayNameQuery -from zitadel_client.models.beta_user_service_email_query import BetaUserServiceEmailQuery -from zitadel_client.models.beta_user_service_first_name_query import BetaUserServiceFirstNameQuery -from zitadel_client.models.beta_user_service_form_data import BetaUserServiceFormData -from zitadel_client.models.beta_user_service_gender import BetaUserServiceGender -from zitadel_client.models.beta_user_service_get_user_by_id_request import BetaUserServiceGetUserByIDRequest -from zitadel_client.models.beta_user_service_get_user_by_id_response import BetaUserServiceGetUserByIDResponse -from zitadel_client.models.beta_user_service_hashed_password import BetaUserServiceHashedPassword -from zitadel_client.models.beta_user_service_human_email import BetaUserServiceHumanEmail -from zitadel_client.models.beta_user_service_human_phone import BetaUserServiceHumanPhone -from zitadel_client.models.beta_user_service_human_profile import BetaUserServiceHumanProfile -from zitadel_client.models.beta_user_service_human_user import BetaUserServiceHumanUser -from zitadel_client.models.beta_user_service_idp_information import BetaUserServiceIDPInformation -from zitadel_client.models.beta_user_service_idp_intent import BetaUserServiceIDPIntent -from zitadel_client.models.beta_user_service_idpldap_access_information import BetaUserServiceIDPLDAPAccessInformation -from zitadel_client.models.beta_user_service_idp_link import BetaUserServiceIDPLink -from zitadel_client.models.beta_user_service_idpo_auth_access_information import BetaUserServiceIDPOAuthAccessInformation -from zitadel_client.models.beta_user_service_idpsaml_access_information import BetaUserServiceIDPSAMLAccessInformation -from zitadel_client.models.beta_user_service_in_user_emails_query import BetaUserServiceInUserEmailsQuery -from zitadel_client.models.beta_user_service_in_user_id_query import BetaUserServiceInUserIDQuery -from zitadel_client.models.beta_user_service_ldap_credentials import BetaUserServiceLDAPCredentials -from zitadel_client.models.beta_user_service_last_name_query import BetaUserServiceLastNameQuery -from zitadel_client.models.beta_user_service_list_authentication_method_types_request import BetaUserServiceListAuthenticationMethodTypesRequest -from zitadel_client.models.beta_user_service_list_authentication_method_types_response import BetaUserServiceListAuthenticationMethodTypesResponse -from zitadel_client.models.beta_user_service_list_details import BetaUserServiceListDetails -from zitadel_client.models.beta_user_service_list_query import BetaUserServiceListQuery -from zitadel_client.models.beta_user_service_list_users_request import BetaUserServiceListUsersRequest -from zitadel_client.models.beta_user_service_list_users_response import BetaUserServiceListUsersResponse -from zitadel_client.models.beta_user_service_lock_user_request import BetaUserServiceLockUserRequest -from zitadel_client.models.beta_user_service_lock_user_response import BetaUserServiceLockUserResponse -from zitadel_client.models.beta_user_service_login_name_query import BetaUserServiceLoginNameQuery -from zitadel_client.models.beta_user_service_machine_user import BetaUserServiceMachineUser -from zitadel_client.models.beta_user_service_nick_name_query import BetaUserServiceNickNameQuery -from zitadel_client.models.beta_user_service_not_query import BetaUserServiceNotQuery -from zitadel_client.models.beta_user_service_notification_type import BetaUserServiceNotificationType -from zitadel_client.models.beta_user_service_or_query import BetaUserServiceOrQuery -from zitadel_client.models.beta_user_service_organization import BetaUserServiceOrganization -from zitadel_client.models.beta_user_service_organization_id_query import BetaUserServiceOrganizationIdQuery -from zitadel_client.models.beta_user_service_passkey_authenticator import BetaUserServicePasskeyAuthenticator -from zitadel_client.models.beta_user_service_passkey_registration_code import BetaUserServicePasskeyRegistrationCode -from zitadel_client.models.beta_user_service_password import BetaUserServicePassword -from zitadel_client.models.beta_user_service_password_reset_request import BetaUserServicePasswordResetRequest -from zitadel_client.models.beta_user_service_password_reset_response import BetaUserServicePasswordResetResponse -from zitadel_client.models.beta_user_service_phone_query import BetaUserServicePhoneQuery -from zitadel_client.models.beta_user_service_reactivate_user_request import BetaUserServiceReactivateUserRequest -from zitadel_client.models.beta_user_service_reactivate_user_response import BetaUserServiceReactivateUserResponse -from zitadel_client.models.beta_user_service_redirect_urls import BetaUserServiceRedirectURLs -from zitadel_client.models.beta_user_service_register_passkey_request import BetaUserServiceRegisterPasskeyRequest -from zitadel_client.models.beta_user_service_register_passkey_response import BetaUserServiceRegisterPasskeyResponse -from zitadel_client.models.beta_user_service_register_totp_request import BetaUserServiceRegisterTOTPRequest -from zitadel_client.models.beta_user_service_register_totp_response import BetaUserServiceRegisterTOTPResponse -from zitadel_client.models.beta_user_service_register_u2_f_request import BetaUserServiceRegisterU2FRequest -from zitadel_client.models.beta_user_service_register_u2_f_response import BetaUserServiceRegisterU2FResponse -from zitadel_client.models.beta_user_service_remove_otp_email_request import BetaUserServiceRemoveOTPEmailRequest -from zitadel_client.models.beta_user_service_remove_otp_email_response import BetaUserServiceRemoveOTPEmailResponse -from zitadel_client.models.beta_user_service_remove_otpsms_request import BetaUserServiceRemoveOTPSMSRequest -from zitadel_client.models.beta_user_service_remove_otpsms_response import BetaUserServiceRemoveOTPSMSResponse -from zitadel_client.models.beta_user_service_remove_phone_request import BetaUserServiceRemovePhoneRequest -from zitadel_client.models.beta_user_service_remove_phone_response import BetaUserServiceRemovePhoneResponse -from zitadel_client.models.beta_user_service_remove_totp_request import BetaUserServiceRemoveTOTPRequest -from zitadel_client.models.beta_user_service_remove_totp_response import BetaUserServiceRemoveTOTPResponse -from zitadel_client.models.beta_user_service_resend_email_code_request import BetaUserServiceResendEmailCodeRequest -from zitadel_client.models.beta_user_service_resend_email_code_response import BetaUserServiceResendEmailCodeResponse -from zitadel_client.models.beta_user_service_resend_phone_code_request import BetaUserServiceResendPhoneCodeRequest -from zitadel_client.models.beta_user_service_resend_phone_code_response import BetaUserServiceResendPhoneCodeResponse -from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_request import BetaUserServiceRetrieveIdentityProviderIntentRequest -from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_response import BetaUserServiceRetrieveIdentityProviderIntentResponse -from zitadel_client.models.beta_user_service_search_query import BetaUserServiceSearchQuery -from zitadel_client.models.beta_user_service_send_email_verification_code import BetaUserServiceSendEmailVerificationCode -from zitadel_client.models.beta_user_service_send_passkey_registration_link import BetaUserServiceSendPasskeyRegistrationLink -from zitadel_client.models.beta_user_service_send_password_reset_link import BetaUserServiceSendPasswordResetLink -from zitadel_client.models.beta_user_service_set_email_request import BetaUserServiceSetEmailRequest -from zitadel_client.models.beta_user_service_set_email_response import BetaUserServiceSetEmailResponse -from zitadel_client.models.beta_user_service_set_human_email import BetaUserServiceSetHumanEmail -from zitadel_client.models.beta_user_service_set_human_phone import BetaUserServiceSetHumanPhone -from zitadel_client.models.beta_user_service_set_human_profile import BetaUserServiceSetHumanProfile -from zitadel_client.models.beta_user_service_set_metadata_entry import BetaUserServiceSetMetadataEntry -from zitadel_client.models.beta_user_service_set_password import BetaUserServiceSetPassword -from zitadel_client.models.beta_user_service_set_password_request import BetaUserServiceSetPasswordRequest -from zitadel_client.models.beta_user_service_set_password_response import BetaUserServiceSetPasswordResponse -from zitadel_client.models.beta_user_service_set_phone_request import BetaUserServiceSetPhoneRequest -from zitadel_client.models.beta_user_service_set_phone_response import BetaUserServiceSetPhoneResponse -from zitadel_client.models.beta_user_service_start_identity_provider_intent_request import BetaUserServiceStartIdentityProviderIntentRequest -from zitadel_client.models.beta_user_service_start_identity_provider_intent_response import BetaUserServiceStartIdentityProviderIntentResponse -from zitadel_client.models.beta_user_service_state_query import BetaUserServiceStateQuery -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from zitadel_client.models.beta_user_service_type import BetaUserServiceType -from zitadel_client.models.beta_user_service_type_query import BetaUserServiceTypeQuery -from zitadel_client.models.beta_user_service_unlock_user_request import BetaUserServiceUnlockUserRequest -from zitadel_client.models.beta_user_service_unlock_user_response import BetaUserServiceUnlockUserResponse -from zitadel_client.models.beta_user_service_update_human_user_request import BetaUserServiceUpdateHumanUserRequest -from zitadel_client.models.beta_user_service_update_human_user_response import BetaUserServiceUpdateHumanUserResponse -from zitadel_client.models.beta_user_service_user import BetaUserServiceUser -from zitadel_client.models.beta_user_service_user_field_name import BetaUserServiceUserFieldName -from zitadel_client.models.beta_user_service_user_name_query import BetaUserServiceUserNameQuery -from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState -from zitadel_client.models.beta_user_service_verify_email_request import BetaUserServiceVerifyEmailRequest -from zitadel_client.models.beta_user_service_verify_email_response import BetaUserServiceVerifyEmailResponse -from zitadel_client.models.beta_user_service_verify_passkey_registration_request import BetaUserServiceVerifyPasskeyRegistrationRequest -from zitadel_client.models.beta_user_service_verify_passkey_registration_response import BetaUserServiceVerifyPasskeyRegistrationResponse -from zitadel_client.models.beta_user_service_verify_phone_request import BetaUserServiceVerifyPhoneRequest -from zitadel_client.models.beta_user_service_verify_phone_response import BetaUserServiceVerifyPhoneResponse -from zitadel_client.models.beta_user_service_verify_totp_registration_request import BetaUserServiceVerifyTOTPRegistrationRequest -from zitadel_client.models.beta_user_service_verify_totp_registration_response import BetaUserServiceVerifyTOTPRegistrationResponse -from zitadel_client.models.beta_user_service_verify_u2_f_registration_request import BetaUserServiceVerifyU2FRegistrationRequest -from zitadel_client.models.beta_user_service_verify_u2_f_registration_response import BetaUserServiceVerifyU2FRegistrationResponse -from zitadel_client.models.beta_web_key_service_activate_web_key_request import BetaWebKeyServiceActivateWebKeyRequest -from zitadel_client.models.beta_web_key_service_activate_web_key_response import BetaWebKeyServiceActivateWebKeyResponse -from zitadel_client.models.beta_web_key_service_any import BetaWebKeyServiceAny -from zitadel_client.models.beta_web_key_service_connect_error import BetaWebKeyServiceConnectError -from zitadel_client.models.beta_web_key_service_create_web_key_request import BetaWebKeyServiceCreateWebKeyRequest -from zitadel_client.models.beta_web_key_service_create_web_key_response import BetaWebKeyServiceCreateWebKeyResponse -from zitadel_client.models.beta_web_key_service_delete_web_key_request import BetaWebKeyServiceDeleteWebKeyRequest -from zitadel_client.models.beta_web_key_service_delete_web_key_response import BetaWebKeyServiceDeleteWebKeyResponse -from zitadel_client.models.beta_web_key_service_ecdsa import BetaWebKeyServiceECDSA -from zitadel_client.models.beta_web_key_service_ecdsa_curve import BetaWebKeyServiceECDSACurve -from zitadel_client.models.beta_web_key_service_list_web_keys_response import BetaWebKeyServiceListWebKeysResponse -from zitadel_client.models.beta_web_key_service_rsa import BetaWebKeyServiceRSA -from zitadel_client.models.beta_web_key_service_rsa_bits import BetaWebKeyServiceRSABits -from zitadel_client.models.beta_web_key_service_rsa_hasher import BetaWebKeyServiceRSAHasher -from zitadel_client.models.beta_web_key_service_state import BetaWebKeyServiceState -from zitadel_client.models.beta_web_key_service_web_key import BetaWebKeyServiceWebKey -from zitadel_client.models.feature_service_any import FeatureServiceAny -from zitadel_client.models.feature_service_connect_error import FeatureServiceConnectError -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from zitadel_client.models.feature_service_feature_flag import FeatureServiceFeatureFlag -from zitadel_client.models.feature_service_get_instance_features_request import FeatureServiceGetInstanceFeaturesRequest -from zitadel_client.models.feature_service_get_instance_features_response import FeatureServiceGetInstanceFeaturesResponse -from zitadel_client.models.feature_service_get_organization_features_request import FeatureServiceGetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_get_organization_features_response import FeatureServiceGetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_get_system_features_response import FeatureServiceGetSystemFeaturesResponse -from zitadel_client.models.feature_service_get_user_features_request import FeatureServiceGetUserFeaturesRequest -from zitadel_client.models.feature_service_get_user_features_response import FeatureServiceGetUserFeaturesResponse -from zitadel_client.models.feature_service_improved_performance import FeatureServiceImprovedPerformance -from zitadel_client.models.feature_service_improved_performance_feature_flag import FeatureServiceImprovedPerformanceFeatureFlag -from zitadel_client.models.feature_service_login_v2 import FeatureServiceLoginV2 -from zitadel_client.models.feature_service_login_v2_feature_flag import FeatureServiceLoginV2FeatureFlag -from zitadel_client.models.feature_service_reset_instance_features_response import FeatureServiceResetInstanceFeaturesResponse -from zitadel_client.models.feature_service_reset_organization_features_request import FeatureServiceResetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_reset_organization_features_response import FeatureServiceResetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_reset_system_features_response import FeatureServiceResetSystemFeaturesResponse -from zitadel_client.models.feature_service_reset_user_features_request import FeatureServiceResetUserFeaturesRequest -from zitadel_client.models.feature_service_reset_user_features_response import FeatureServiceResetUserFeaturesResponse -from zitadel_client.models.feature_service_set_instance_features_request import FeatureServiceSetInstanceFeaturesRequest -from zitadel_client.models.feature_service_set_instance_features_response import FeatureServiceSetInstanceFeaturesResponse -from zitadel_client.models.feature_service_set_organization_features_request import FeatureServiceSetOrganizationFeaturesRequest -from zitadel_client.models.feature_service_set_organization_features_response import FeatureServiceSetOrganizationFeaturesResponse -from zitadel_client.models.feature_service_set_system_features_request import FeatureServiceSetSystemFeaturesRequest -from zitadel_client.models.feature_service_set_system_features_response import FeatureServiceSetSystemFeaturesResponse -from zitadel_client.models.feature_service_set_user_feature_request import FeatureServiceSetUserFeatureRequest -from zitadel_client.models.feature_service_set_user_features_response import FeatureServiceSetUserFeaturesResponse -from zitadel_client.models.feature_service_source import FeatureServiceSource -from zitadel_client.models.identity_provider_service_any import IdentityProviderServiceAny -from zitadel_client.models.identity_provider_service_apple_config import IdentityProviderServiceAppleConfig -from zitadel_client.models.identity_provider_service_auto_linking_option import IdentityProviderServiceAutoLinkingOption -from zitadel_client.models.identity_provider_service_azure_ad_config import IdentityProviderServiceAzureADConfig -from zitadel_client.models.identity_provider_service_azure_ad_tenant import IdentityProviderServiceAzureADTenant -from zitadel_client.models.identity_provider_service_azure_ad_tenant_type import IdentityProviderServiceAzureADTenantType -from zitadel_client.models.identity_provider_service_connect_error import IdentityProviderServiceConnectError -from zitadel_client.models.identity_provider_service_details import IdentityProviderServiceDetails -from zitadel_client.models.identity_provider_service_generic_oidc_config import IdentityProviderServiceGenericOIDCConfig -from zitadel_client.models.identity_provider_service_get_idpby_id_request import IdentityProviderServiceGetIDPByIDRequest -from zitadel_client.models.identity_provider_service_get_idpby_id_response import IdentityProviderServiceGetIDPByIDResponse -from zitadel_client.models.identity_provider_service_git_hub_config import IdentityProviderServiceGitHubConfig -from zitadel_client.models.identity_provider_service_git_hub_enterprise_server_config import IdentityProviderServiceGitHubEnterpriseServerConfig -from zitadel_client.models.identity_provider_service_git_lab_config import IdentityProviderServiceGitLabConfig -from zitadel_client.models.identity_provider_service_git_lab_self_hosted_config import IdentityProviderServiceGitLabSelfHostedConfig -from zitadel_client.models.identity_provider_service_google_config import IdentityProviderServiceGoogleConfig -from zitadel_client.models.identity_provider_service_idp import IdentityProviderServiceIDP -from zitadel_client.models.identity_provider_service_idp_config import IdentityProviderServiceIDPConfig -from zitadel_client.models.identity_provider_service_idp_state import IdentityProviderServiceIDPState -from zitadel_client.models.identity_provider_service_idp_type import IdentityProviderServiceIDPType -from zitadel_client.models.identity_provider_service_jwt_config import IdentityProviderServiceJWTConfig -from zitadel_client.models.identity_provider_service_ldap_attributes import IdentityProviderServiceLDAPAttributes -from zitadel_client.models.identity_provider_service_ldap_config import IdentityProviderServiceLDAPConfig -from zitadel_client.models.identity_provider_service_o_auth_config import IdentityProviderServiceOAuthConfig -from zitadel_client.models.identity_provider_service_options import IdentityProviderServiceOptions -from zitadel_client.models.identity_provider_service_saml_binding import IdentityProviderServiceSAMLBinding -from zitadel_client.models.identity_provider_service_saml_config import IdentityProviderServiceSAMLConfig -from zitadel_client.models.identity_provider_service_saml_name_id_format import IdentityProviderServiceSAMLNameIDFormat -from zitadel_client.models.identity_provider_service_saml_signature_algorithm import IdentityProviderServiceSAMLSignatureAlgorithm -from zitadel_client.models.instance_service_add_custom_domain_request import InstanceServiceAddCustomDomainRequest -from zitadel_client.models.instance_service_add_custom_domain_response import InstanceServiceAddCustomDomainResponse -from zitadel_client.models.instance_service_add_trusted_domain_request import InstanceServiceAddTrustedDomainRequest -from zitadel_client.models.instance_service_add_trusted_domain_response import InstanceServiceAddTrustedDomainResponse -from zitadel_client.models.instance_service_any import InstanceServiceAny -from zitadel_client.models.instance_service_connect_error import InstanceServiceConnectError -from zitadel_client.models.instance_service_custom_domain import InstanceServiceCustomDomain -from zitadel_client.models.instance_service_custom_domain_filter import InstanceServiceCustomDomainFilter -from zitadel_client.models.instance_service_custom_domains_filter import InstanceServiceCustomDomainsFilter -from zitadel_client.models.instance_service_delete_instance_request import InstanceServiceDeleteInstanceRequest -from zitadel_client.models.instance_service_delete_instance_response import InstanceServiceDeleteInstanceResponse -from zitadel_client.models.instance_service_domain_field_name import InstanceServiceDomainFieldName -from zitadel_client.models.instance_service_domain_filter import InstanceServiceDomainFilter -from zitadel_client.models.instance_service_field_name import InstanceServiceFieldName -from zitadel_client.models.instance_service_filter import InstanceServiceFilter -from zitadel_client.models.instance_service_get_instance_request import InstanceServiceGetInstanceRequest -from zitadel_client.models.instance_service_get_instance_response import InstanceServiceGetInstanceResponse -from zitadel_client.models.instance_service_in_ids_filter import InstanceServiceInIDsFilter -from zitadel_client.models.instance_service_instance import InstanceServiceInstance -from zitadel_client.models.instance_service_list_custom_domains_request import InstanceServiceListCustomDomainsRequest -from zitadel_client.models.instance_service_list_custom_domains_response import InstanceServiceListCustomDomainsResponse -from zitadel_client.models.instance_service_list_instances_request import InstanceServiceListInstancesRequest -from zitadel_client.models.instance_service_list_instances_response import InstanceServiceListInstancesResponse -from zitadel_client.models.instance_service_list_trusted_domains_request import InstanceServiceListTrustedDomainsRequest -from zitadel_client.models.instance_service_list_trusted_domains_response import InstanceServiceListTrustedDomainsResponse -from zitadel_client.models.instance_service_pagination_request import InstanceServicePaginationRequest -from zitadel_client.models.instance_service_pagination_response import InstanceServicePaginationResponse -from zitadel_client.models.instance_service_remove_custom_domain_request import InstanceServiceRemoveCustomDomainRequest -from zitadel_client.models.instance_service_remove_custom_domain_response import InstanceServiceRemoveCustomDomainResponse -from zitadel_client.models.instance_service_remove_trusted_domain_request import InstanceServiceRemoveTrustedDomainRequest -from zitadel_client.models.instance_service_remove_trusted_domain_response import InstanceServiceRemoveTrustedDomainResponse -from zitadel_client.models.instance_service_state import InstanceServiceState -from zitadel_client.models.instance_service_text_query_method import InstanceServiceTextQueryMethod -from zitadel_client.models.instance_service_trusted_domain import InstanceServiceTrustedDomain -from zitadel_client.models.instance_service_trusted_domain_field_name import InstanceServiceTrustedDomainFieldName -from zitadel_client.models.instance_service_trusted_domain_filter import InstanceServiceTrustedDomainFilter -from zitadel_client.models.instance_service_update_instance_request import InstanceServiceUpdateInstanceRequest -from zitadel_client.models.instance_service_update_instance_response import InstanceServiceUpdateInstanceResponse -from zitadel_client.models.internal_permission_service_administrator import InternalPermissionServiceAdministrator -from zitadel_client.models.internal_permission_service_administrator_field_name import InternalPermissionServiceAdministratorFieldName -from zitadel_client.models.internal_permission_service_administrator_search_filter import InternalPermissionServiceAdministratorSearchFilter -from zitadel_client.models.internal_permission_service_and_filter import InternalPermissionServiceAndFilter -from zitadel_client.models.internal_permission_service_any import InternalPermissionServiceAny -from zitadel_client.models.internal_permission_service_connect_error import InternalPermissionServiceConnectError -from zitadel_client.models.internal_permission_service_create_administrator_request import InternalPermissionServiceCreateAdministratorRequest -from zitadel_client.models.internal_permission_service_create_administrator_response import InternalPermissionServiceCreateAdministratorResponse -from zitadel_client.models.internal_permission_service_delete_administrator_request import InternalPermissionServiceDeleteAdministratorRequest -from zitadel_client.models.internal_permission_service_delete_administrator_response import InternalPermissionServiceDeleteAdministratorResponse -from zitadel_client.models.internal_permission_service_id_filter import InternalPermissionServiceIDFilter -from zitadel_client.models.internal_permission_service_in_ids_filter import InternalPermissionServiceInIDsFilter -from zitadel_client.models.internal_permission_service_list_administrators_request import InternalPermissionServiceListAdministratorsRequest -from zitadel_client.models.internal_permission_service_list_administrators_response import InternalPermissionServiceListAdministratorsResponse -from zitadel_client.models.internal_permission_service_not_filter import InternalPermissionServiceNotFilter -from zitadel_client.models.internal_permission_service_or_filter import InternalPermissionServiceOrFilter -from zitadel_client.models.internal_permission_service_organization import InternalPermissionServiceOrganization -from zitadel_client.models.internal_permission_service_pagination_request import InternalPermissionServicePaginationRequest -from zitadel_client.models.internal_permission_service_pagination_response import InternalPermissionServicePaginationResponse -from zitadel_client.models.internal_permission_service_project import InternalPermissionServiceProject -from zitadel_client.models.internal_permission_service_project_grant import InternalPermissionServiceProjectGrant -from zitadel_client.models.internal_permission_service_resource_filter import InternalPermissionServiceResourceFilter -from zitadel_client.models.internal_permission_service_resource_type import InternalPermissionServiceResourceType -from zitadel_client.models.internal_permission_service_role_filter import InternalPermissionServiceRoleFilter -from zitadel_client.models.internal_permission_service_text_filter_method import InternalPermissionServiceTextFilterMethod -from zitadel_client.models.internal_permission_service_timestamp_filter import InternalPermissionServiceTimestampFilter -from zitadel_client.models.internal_permission_service_timestamp_filter_method import InternalPermissionServiceTimestampFilterMethod -from zitadel_client.models.internal_permission_service_update_administrator_request import InternalPermissionServiceUpdateAdministratorRequest -from zitadel_client.models.internal_permission_service_update_administrator_response import InternalPermissionServiceUpdateAdministratorResponse -from zitadel_client.models.internal_permission_service_user import InternalPermissionServiceUser -from zitadel_client.models.internal_permission_service_user_display_name_filter import InternalPermissionServiceUserDisplayNameFilter -from zitadel_client.models.internal_permission_service_user_preferred_login_name_filter import InternalPermissionServiceUserPreferredLoginNameFilter -from zitadel_client.models.oidc_service_any import OIDCServiceAny -from zitadel_client.models.oidc_service_auth_request import OIDCServiceAuthRequest -from zitadel_client.models.oidc_service_authorization_error import OIDCServiceAuthorizationError -from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest -from zitadel_client.models.oidc_service_connect_error import OIDCServiceConnectError -from zitadel_client.models.oidc_service_create_callback_request import OIDCServiceCreateCallbackRequest -from zitadel_client.models.oidc_service_create_callback_response import OIDCServiceCreateCallbackResponse -from zitadel_client.models.oidc_service_details import OIDCServiceDetails -from zitadel_client.models.oidc_service_device_authorization_request import OIDCServiceDeviceAuthorizationRequest -from zitadel_client.models.oidc_service_error_reason import OIDCServiceErrorReason -from zitadel_client.models.oidc_service_get_auth_request_request import OIDCServiceGetAuthRequestRequest -from zitadel_client.models.oidc_service_get_auth_request_response import OIDCServiceGetAuthRequestResponse -from zitadel_client.models.oidc_service_get_device_authorization_request_request import OIDCServiceGetDeviceAuthorizationRequestRequest -from zitadel_client.models.oidc_service_get_device_authorization_request_response import OIDCServiceGetDeviceAuthorizationRequestResponse -from zitadel_client.models.oidc_service_prompt import OIDCServicePrompt -from zitadel_client.models.oidc_service_session import OIDCServiceSession -from zitadel_client.models.organization_service_activate_organization_request import OrganizationServiceActivateOrganizationRequest -from zitadel_client.models.organization_service_activate_organization_response import OrganizationServiceActivateOrganizationResponse -from zitadel_client.models.organization_service_add_human_user_request import OrganizationServiceAddHumanUserRequest -from zitadel_client.models.organization_service_add_organization_domain_request import OrganizationServiceAddOrganizationDomainRequest -from zitadel_client.models.organization_service_add_organization_domain_response import OrganizationServiceAddOrganizationDomainResponse -from zitadel_client.models.organization_service_add_organization_request import OrganizationServiceAddOrganizationRequest -from zitadel_client.models.organization_service_add_organization_response import OrganizationServiceAddOrganizationResponse -from zitadel_client.models.organization_service_admin import OrganizationServiceAdmin -from zitadel_client.models.organization_service_any import OrganizationServiceAny -from zitadel_client.models.organization_service_connect_error import OrganizationServiceConnectError -from zitadel_client.models.organization_service_created_admin import OrganizationServiceCreatedAdmin -from zitadel_client.models.organization_service_deactivate_organization_request import OrganizationServiceDeactivateOrganizationRequest -from zitadel_client.models.organization_service_deactivate_organization_response import OrganizationServiceDeactivateOrganizationResponse -from zitadel_client.models.organization_service_delete_organization_domain_request import OrganizationServiceDeleteOrganizationDomainRequest -from zitadel_client.models.organization_service_delete_organization_domain_response import OrganizationServiceDeleteOrganizationDomainResponse -from zitadel_client.models.organization_service_delete_organization_metadata_request import OrganizationServiceDeleteOrganizationMetadataRequest -from zitadel_client.models.organization_service_delete_organization_metadata_response import OrganizationServiceDeleteOrganizationMetadataResponse -from zitadel_client.models.organization_service_delete_organization_request import OrganizationServiceDeleteOrganizationRequest -from zitadel_client.models.organization_service_delete_organization_response import OrganizationServiceDeleteOrganizationResponse -from zitadel_client.models.organization_service_details import OrganizationServiceDetails -from zitadel_client.models.organization_service_domain import OrganizationServiceDomain -from zitadel_client.models.organization_service_domain_field_name import OrganizationServiceDomainFieldName -from zitadel_client.models.organization_service_domain_search_filter import OrganizationServiceDomainSearchFilter -from zitadel_client.models.organization_service_domain_validation_type import OrganizationServiceDomainValidationType -from zitadel_client.models.organization_service_gender import OrganizationServiceGender -from zitadel_client.models.organization_service_generate_organization_domain_validation_request import OrganizationServiceGenerateOrganizationDomainValidationRequest -from zitadel_client.models.organization_service_generate_organization_domain_validation_response import OrganizationServiceGenerateOrganizationDomainValidationResponse -from zitadel_client.models.organization_service_hashed_password import OrganizationServiceHashedPassword -from zitadel_client.models.organization_service_idp_link import OrganizationServiceIDPLink -from zitadel_client.models.organization_service_list_details import OrganizationServiceListDetails -from zitadel_client.models.organization_service_list_organization_domains_request import OrganizationServiceListOrganizationDomainsRequest -from zitadel_client.models.organization_service_list_organization_domains_response import OrganizationServiceListOrganizationDomainsResponse -from zitadel_client.models.organization_service_list_organization_metadata_request import OrganizationServiceListOrganizationMetadataRequest -from zitadel_client.models.organization_service_list_organization_metadata_response import OrganizationServiceListOrganizationMetadataResponse -from zitadel_client.models.organization_service_list_organizations_request import OrganizationServiceListOrganizationsRequest -from zitadel_client.models.organization_service_list_organizations_response import OrganizationServiceListOrganizationsResponse -from zitadel_client.models.organization_service_list_query import OrganizationServiceListQuery -from zitadel_client.models.organization_service_metadata import OrganizationServiceMetadata -from zitadel_client.models.organization_service_metadata_key_filter import OrganizationServiceMetadataKeyFilter -from zitadel_client.models.organization_service_metadata_search_filter import OrganizationServiceMetadataSearchFilter -from zitadel_client.models.organization_service_organization import OrganizationServiceOrganization -from zitadel_client.models.organization_service_organization_domain_query import OrganizationServiceOrganizationDomainQuery -from zitadel_client.models.organization_service_organization_field_name import OrganizationServiceOrganizationFieldName -from zitadel_client.models.organization_service_organization_id_query import OrganizationServiceOrganizationIDQuery -from zitadel_client.models.organization_service_organization_name_query import OrganizationServiceOrganizationNameQuery -from zitadel_client.models.organization_service_organization_state import OrganizationServiceOrganizationState -from zitadel_client.models.organization_service_organization_state_query import OrganizationServiceOrganizationStateQuery -from zitadel_client.models.organization_service_pagination_request import OrganizationServicePaginationRequest -from zitadel_client.models.organization_service_pagination_response import OrganizationServicePaginationResponse -from zitadel_client.models.organization_service_password import OrganizationServicePassword -from zitadel_client.models.organization_service_search_query import OrganizationServiceSearchQuery -from zitadel_client.models.organization_service_send_email_verification_code import OrganizationServiceSendEmailVerificationCode -from zitadel_client.models.organization_service_set_human_email import OrganizationServiceSetHumanEmail -from zitadel_client.models.organization_service_set_human_phone import OrganizationServiceSetHumanPhone -from zitadel_client.models.organization_service_set_human_profile import OrganizationServiceSetHumanProfile -from zitadel_client.models.organization_service_set_metadata_entry import OrganizationServiceSetMetadataEntry -from zitadel_client.models.organization_service_set_organization_metadata_request import OrganizationServiceSetOrganizationMetadataRequest -from zitadel_client.models.organization_service_set_organization_metadata_response import OrganizationServiceSetOrganizationMetadataResponse -from zitadel_client.models.organization_service_text_filter_method import OrganizationServiceTextFilterMethod -from zitadel_client.models.organization_service_text_query_method import OrganizationServiceTextQueryMethod -from zitadel_client.models.organization_service_update_organization_request import OrganizationServiceUpdateOrganizationRequest -from zitadel_client.models.organization_service_update_organization_response import OrganizationServiceUpdateOrganizationResponse -from zitadel_client.models.organization_service_verify_organization_domain_request import OrganizationServiceVerifyOrganizationDomainRequest -from zitadel_client.models.organization_service_verify_organization_domain_response import OrganizationServiceVerifyOrganizationDomainResponse -from zitadel_client.models.project_service_activate_project_grant_request import ProjectServiceActivateProjectGrantRequest -from zitadel_client.models.project_service_activate_project_grant_response import ProjectServiceActivateProjectGrantResponse -from zitadel_client.models.project_service_activate_project_request import ProjectServiceActivateProjectRequest -from zitadel_client.models.project_service_activate_project_response import ProjectServiceActivateProjectResponse -from zitadel_client.models.project_service_add_project_role_request import ProjectServiceAddProjectRoleRequest -from zitadel_client.models.project_service_add_project_role_response import ProjectServiceAddProjectRoleResponse -from zitadel_client.models.project_service_any import ProjectServiceAny -from zitadel_client.models.project_service_connect_error import ProjectServiceConnectError -from zitadel_client.models.project_service_create_project_grant_request import ProjectServiceCreateProjectGrantRequest -from zitadel_client.models.project_service_create_project_grant_response import ProjectServiceCreateProjectGrantResponse -from zitadel_client.models.project_service_create_project_request import ProjectServiceCreateProjectRequest -from zitadel_client.models.project_service_create_project_response import ProjectServiceCreateProjectResponse -from zitadel_client.models.project_service_deactivate_project_grant_request import ProjectServiceDeactivateProjectGrantRequest -from zitadel_client.models.project_service_deactivate_project_grant_response import ProjectServiceDeactivateProjectGrantResponse -from zitadel_client.models.project_service_deactivate_project_request import ProjectServiceDeactivateProjectRequest -from zitadel_client.models.project_service_deactivate_project_response import ProjectServiceDeactivateProjectResponse -from zitadel_client.models.project_service_delete_project_grant_request import ProjectServiceDeleteProjectGrantRequest -from zitadel_client.models.project_service_delete_project_grant_response import ProjectServiceDeleteProjectGrantResponse -from zitadel_client.models.project_service_delete_project_request import ProjectServiceDeleteProjectRequest -from zitadel_client.models.project_service_delete_project_response import ProjectServiceDeleteProjectResponse -from zitadel_client.models.project_service_get_project_request import ProjectServiceGetProjectRequest -from zitadel_client.models.project_service_get_project_response import ProjectServiceGetProjectResponse -from zitadel_client.models.project_service_granted_project_state import ProjectServiceGrantedProjectState -from zitadel_client.models.project_service_id_filter import ProjectServiceIDFilter -from zitadel_client.models.project_service_in_ids_filter import ProjectServiceInIDsFilter -from zitadel_client.models.project_service_list_project_grants_request import ProjectServiceListProjectGrantsRequest -from zitadel_client.models.project_service_list_project_grants_response import ProjectServiceListProjectGrantsResponse -from zitadel_client.models.project_service_list_project_roles_request import ProjectServiceListProjectRolesRequest -from zitadel_client.models.project_service_list_project_roles_response import ProjectServiceListProjectRolesResponse -from zitadel_client.models.project_service_list_projects_request import ProjectServiceListProjectsRequest -from zitadel_client.models.project_service_list_projects_response import ProjectServiceListProjectsResponse -from zitadel_client.models.project_service_pagination_request import ProjectServicePaginationRequest -from zitadel_client.models.project_service_pagination_response import ProjectServicePaginationResponse -from zitadel_client.models.project_service_private_labeling_setting import ProjectServicePrivateLabelingSetting -from zitadel_client.models.project_service_project import ProjectServiceProject -from zitadel_client.models.project_service_project_field_name import ProjectServiceProjectFieldName -from zitadel_client.models.project_service_project_grant import ProjectServiceProjectGrant -from zitadel_client.models.project_service_project_grant_field_name import ProjectServiceProjectGrantFieldName -from zitadel_client.models.project_service_project_grant_search_filter import ProjectServiceProjectGrantSearchFilter -from zitadel_client.models.project_service_project_grant_state import ProjectServiceProjectGrantState -from zitadel_client.models.project_service_project_name_filter import ProjectServiceProjectNameFilter -from zitadel_client.models.project_service_project_organization_id_filter import ProjectServiceProjectOrganizationIDFilter -from zitadel_client.models.project_service_project_role import ProjectServiceProjectRole -from zitadel_client.models.project_service_project_role_display_name_filter import ProjectServiceProjectRoleDisplayNameFilter -from zitadel_client.models.project_service_project_role_field_name import ProjectServiceProjectRoleFieldName -from zitadel_client.models.project_service_project_role_key_filter import ProjectServiceProjectRoleKeyFilter -from zitadel_client.models.project_service_project_role_search_filter import ProjectServiceProjectRoleSearchFilter -from zitadel_client.models.project_service_project_search_filter import ProjectServiceProjectSearchFilter -from zitadel_client.models.project_service_project_state import ProjectServiceProjectState -from zitadel_client.models.project_service_remove_project_role_request import ProjectServiceRemoveProjectRoleRequest -from zitadel_client.models.project_service_remove_project_role_response import ProjectServiceRemoveProjectRoleResponse -from zitadel_client.models.project_service_text_filter_method import ProjectServiceTextFilterMethod -from zitadel_client.models.project_service_type import ProjectServiceType -from zitadel_client.models.project_service_update_project_grant_request import ProjectServiceUpdateProjectGrantRequest -from zitadel_client.models.project_service_update_project_grant_response import ProjectServiceUpdateProjectGrantResponse -from zitadel_client.models.project_service_update_project_request import ProjectServiceUpdateProjectRequest -from zitadel_client.models.project_service_update_project_response import ProjectServiceUpdateProjectResponse -from zitadel_client.models.project_service_update_project_role_request import ProjectServiceUpdateProjectRoleRequest -from zitadel_client.models.project_service_update_project_role_response import ProjectServiceUpdateProjectRoleResponse -from zitadel_client.models.saml_service_any import SAMLServiceAny -from zitadel_client.models.saml_service_authorization_error import SAMLServiceAuthorizationError -from zitadel_client.models.saml_service_connect_error import SAMLServiceConnectError -from zitadel_client.models.saml_service_create_response_request import SAMLServiceCreateResponseRequest -from zitadel_client.models.saml_service_create_response_response import SAMLServiceCreateResponseResponse -from zitadel_client.models.saml_service_details import SAMLServiceDetails -from zitadel_client.models.saml_service_error_reason import SAMLServiceErrorReason -from zitadel_client.models.saml_service_get_saml_request_request import SAMLServiceGetSAMLRequestRequest -from zitadel_client.models.saml_service_get_saml_request_response import SAMLServiceGetSAMLRequestResponse -from zitadel_client.models.saml_service_post_response import SAMLServicePostResponse -from zitadel_client.models.saml_service_saml_request import SAMLServiceSAMLRequest -from zitadel_client.models.saml_service_session import SAMLServiceSession -from zitadel_client.models.session_service_any import SessionServiceAny -from zitadel_client.models.session_service_challenges import SessionServiceChallenges -from zitadel_client.models.session_service_check_idp_intent import SessionServiceCheckIDPIntent -from zitadel_client.models.session_service_check_otp import SessionServiceCheckOTP -from zitadel_client.models.session_service_check_password import SessionServiceCheckPassword -from zitadel_client.models.session_service_check_recovery_code import SessionServiceCheckRecoveryCode -from zitadel_client.models.session_service_check_totp import SessionServiceCheckTOTP -from zitadel_client.models.session_service_check_user import SessionServiceCheckUser -from zitadel_client.models.session_service_check_web_auth_n import SessionServiceCheckWebAuthN -from zitadel_client.models.session_service_checks import SessionServiceChecks -from zitadel_client.models.session_service_connect_error import SessionServiceConnectError -from zitadel_client.models.session_service_create_session_request import SessionServiceCreateSessionRequest -from zitadel_client.models.session_service_create_session_response import SessionServiceCreateSessionResponse -from zitadel_client.models.session_service_creation_date_query import SessionServiceCreationDateQuery -from zitadel_client.models.session_service_creator_query import SessionServiceCreatorQuery -from zitadel_client.models.session_service_delete_session_request import SessionServiceDeleteSessionRequest -from zitadel_client.models.session_service_delete_session_response import SessionServiceDeleteSessionResponse -from zitadel_client.models.session_service_details import SessionServiceDetails -from zitadel_client.models.session_service_expiration_date_query import SessionServiceExpirationDateQuery -from zitadel_client.models.session_service_factors import SessionServiceFactors -from zitadel_client.models.session_service_get_session_request import SessionServiceGetSessionRequest -from zitadel_client.models.session_service_get_session_response import SessionServiceGetSessionResponse -from zitadel_client.models.session_service_header_values import SessionServiceHeaderValues -from zitadel_client.models.session_service_ids_query import SessionServiceIDsQuery -from zitadel_client.models.session_service_intent_factor import SessionServiceIntentFactor -from zitadel_client.models.session_service_list_details import SessionServiceListDetails -from zitadel_client.models.session_service_list_query import SessionServiceListQuery -from zitadel_client.models.session_service_list_sessions_request import SessionServiceListSessionsRequest -from zitadel_client.models.session_service_list_sessions_response import SessionServiceListSessionsResponse -from zitadel_client.models.session_service_otp_email import SessionServiceOTPEmail -from zitadel_client.models.session_service_otp_factor import SessionServiceOTPFactor -from zitadel_client.models.session_service_otpsms import SessionServiceOTPSMS -from zitadel_client.models.session_service_password_factor import SessionServicePasswordFactor -from zitadel_client.models.session_service_recovery_code_factor import SessionServiceRecoveryCodeFactor -from zitadel_client.models.session_service_request_challenges import SessionServiceRequestChallenges -from zitadel_client.models.session_service_search_query import SessionServiceSearchQuery -from zitadel_client.models.session_service_send_code import SessionServiceSendCode -from zitadel_client.models.session_service_session import SessionServiceSession -from zitadel_client.models.session_service_session_field_name import SessionServiceSessionFieldName -from zitadel_client.models.session_service_set_session_request import SessionServiceSetSessionRequest -from zitadel_client.models.session_service_set_session_response import SessionServiceSetSessionResponse -from zitadel_client.models.session_service_totp_factor import SessionServiceTOTPFactor -from zitadel_client.models.session_service_timestamp_query_method import SessionServiceTimestampQueryMethod -from zitadel_client.models.session_service_user_agent import SessionServiceUserAgent -from zitadel_client.models.session_service_user_agent_query import SessionServiceUserAgentQuery -from zitadel_client.models.session_service_user_factor import SessionServiceUserFactor -from zitadel_client.models.session_service_user_id_query import SessionServiceUserIDQuery -from zitadel_client.models.session_service_user_verification_requirement import SessionServiceUserVerificationRequirement -from zitadel_client.models.session_service_web_auth_n import SessionServiceWebAuthN -from zitadel_client.models.session_service_web_auth_n_factor import SessionServiceWebAuthNFactor -from zitadel_client.models.settings_service_any import SettingsServiceAny -from zitadel_client.models.settings_service_auto_linking_option import SettingsServiceAutoLinkingOption -from zitadel_client.models.settings_service_branding_settings import SettingsServiceBrandingSettings -from zitadel_client.models.settings_service_connect_error import SettingsServiceConnectError -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_domain_settings import SettingsServiceDomainSettings -from zitadel_client.models.settings_service_embedded_iframe_settings import SettingsServiceEmbeddedIframeSettings -from zitadel_client.models.settings_service_get_active_identity_providers_request import SettingsServiceGetActiveIdentityProvidersRequest -from zitadel_client.models.settings_service_get_active_identity_providers_response import SettingsServiceGetActiveIdentityProvidersResponse -from zitadel_client.models.settings_service_get_branding_settings_request import SettingsServiceGetBrandingSettingsRequest -from zitadel_client.models.settings_service_get_branding_settings_response import SettingsServiceGetBrandingSettingsResponse -from zitadel_client.models.settings_service_get_domain_settings_request import SettingsServiceGetDomainSettingsRequest -from zitadel_client.models.settings_service_get_domain_settings_response import SettingsServiceGetDomainSettingsResponse -from zitadel_client.models.settings_service_get_general_settings_response import SettingsServiceGetGeneralSettingsResponse -from zitadel_client.models.settings_service_get_hosted_login_translation_request import SettingsServiceGetHostedLoginTranslationRequest -from zitadel_client.models.settings_service_get_hosted_login_translation_response import SettingsServiceGetHostedLoginTranslationResponse -from zitadel_client.models.settings_service_get_legal_and_support_settings_request import SettingsServiceGetLegalAndSupportSettingsRequest -from zitadel_client.models.settings_service_get_legal_and_support_settings_response import SettingsServiceGetLegalAndSupportSettingsResponse -from zitadel_client.models.settings_service_get_lockout_settings_request import SettingsServiceGetLockoutSettingsRequest -from zitadel_client.models.settings_service_get_lockout_settings_response import SettingsServiceGetLockoutSettingsResponse -from zitadel_client.models.settings_service_get_login_settings_request import SettingsServiceGetLoginSettingsRequest -from zitadel_client.models.settings_service_get_login_settings_response import SettingsServiceGetLoginSettingsResponse -from zitadel_client.models.settings_service_get_password_complexity_settings_request import SettingsServiceGetPasswordComplexitySettingsRequest -from zitadel_client.models.settings_service_get_password_complexity_settings_response import SettingsServiceGetPasswordComplexitySettingsResponse -from zitadel_client.models.settings_service_get_password_expiry_settings_request import SettingsServiceGetPasswordExpirySettingsRequest -from zitadel_client.models.settings_service_get_password_expiry_settings_response import SettingsServiceGetPasswordExpirySettingsResponse -from zitadel_client.models.settings_service_get_security_settings_response import SettingsServiceGetSecuritySettingsResponse -from zitadel_client.models.settings_service_identity_provider import SettingsServiceIdentityProvider -from zitadel_client.models.settings_service_identity_provider_type import SettingsServiceIdentityProviderType -from zitadel_client.models.settings_service_legal_and_support_settings import SettingsServiceLegalAndSupportSettings -from zitadel_client.models.settings_service_list_details import SettingsServiceListDetails -from zitadel_client.models.settings_service_lockout_settings import SettingsServiceLockoutSettings -from zitadel_client.models.settings_service_login_settings import SettingsServiceLoginSettings -from zitadel_client.models.settings_service_multi_factor_type import SettingsServiceMultiFactorType -from zitadel_client.models.settings_service_options import SettingsServiceOptions -from zitadel_client.models.settings_service_passkeys_type import SettingsServicePasskeysType -from zitadel_client.models.settings_service_password_complexity_settings import SettingsServicePasswordComplexitySettings -from zitadel_client.models.settings_service_password_expiry_settings import SettingsServicePasswordExpirySettings -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from zitadel_client.models.settings_service_second_factor_type import SettingsServiceSecondFactorType -from zitadel_client.models.settings_service_security_settings import SettingsServiceSecuritySettings -from zitadel_client.models.settings_service_set_hosted_login_translation_request import SettingsServiceSetHostedLoginTranslationRequest -from zitadel_client.models.settings_service_set_hosted_login_translation_response import SettingsServiceSetHostedLoginTranslationResponse -from zitadel_client.models.settings_service_set_security_settings_request import SettingsServiceSetSecuritySettingsRequest -from zitadel_client.models.settings_service_set_security_settings_response import SettingsServiceSetSecuritySettingsResponse -from zitadel_client.models.settings_service_theme import SettingsServiceTheme -from zitadel_client.models.settings_service_theme_mode import SettingsServiceThemeMode -from zitadel_client.models.user_service_access_token_type import UserServiceAccessTokenType -from zitadel_client.models.user_service_add_human_user_request import UserServiceAddHumanUserRequest -from zitadel_client.models.user_service_add_human_user_response import UserServiceAddHumanUserResponse -from zitadel_client.models.user_service_add_idp_link_request import UserServiceAddIDPLinkRequest -from zitadel_client.models.user_service_add_idp_link_response import UserServiceAddIDPLinkResponse -from zitadel_client.models.user_service_add_key_request import UserServiceAddKeyRequest -from zitadel_client.models.user_service_add_key_response import UserServiceAddKeyResponse -from zitadel_client.models.user_service_add_otp_email_request import UserServiceAddOTPEmailRequest -from zitadel_client.models.user_service_add_otp_email_response import UserServiceAddOTPEmailResponse -from zitadel_client.models.user_service_add_otpsms_request import UserServiceAddOTPSMSRequest -from zitadel_client.models.user_service_add_otpsms_response import UserServiceAddOTPSMSResponse -from zitadel_client.models.user_service_add_personal_access_token_request import UserServiceAddPersonalAccessTokenRequest -from zitadel_client.models.user_service_add_personal_access_token_response import UserServiceAddPersonalAccessTokenResponse -from zitadel_client.models.user_service_add_secret_request import UserServiceAddSecretRequest -from zitadel_client.models.user_service_add_secret_response import UserServiceAddSecretResponse -from zitadel_client.models.user_service_and_query import UserServiceAndQuery -from zitadel_client.models.user_service_any import UserServiceAny -from zitadel_client.models.user_service_auth_factor import UserServiceAuthFactor -from zitadel_client.models.user_service_auth_factor_state import UserServiceAuthFactorState -from zitadel_client.models.user_service_auth_factor_u2_f import UserServiceAuthFactorU2F -from zitadel_client.models.user_service_auth_factors import UserServiceAuthFactors -from zitadel_client.models.user_service_authentication_method_type import UserServiceAuthenticationMethodType -from zitadel_client.models.user_service_byte_filter_method import UserServiceByteFilterMethod -from zitadel_client.models.user_service_connect_error import UserServiceConnectError -from zitadel_client.models.user_service_create_invite_code_request import UserServiceCreateInviteCodeRequest -from zitadel_client.models.user_service_create_invite_code_response import UserServiceCreateInviteCodeResponse -from zitadel_client.models.user_service_create_passkey_registration_link_request import UserServiceCreatePasskeyRegistrationLinkRequest -from zitadel_client.models.user_service_create_passkey_registration_link_response import UserServiceCreatePasskeyRegistrationLinkResponse -from zitadel_client.models.user_service_create_user_request import UserServiceCreateUserRequest -from zitadel_client.models.user_service_create_user_response import UserServiceCreateUserResponse -from zitadel_client.models.user_service_deactivate_user_request import UserServiceDeactivateUserRequest -from zitadel_client.models.user_service_deactivate_user_response import UserServiceDeactivateUserResponse -from zitadel_client.models.user_service_delete_user_metadata_request import UserServiceDeleteUserMetadataRequest -from zitadel_client.models.user_service_delete_user_metadata_response import UserServiceDeleteUserMetadataResponse -from zitadel_client.models.user_service_delete_user_request import UserServiceDeleteUserRequest -from zitadel_client.models.user_service_delete_user_response import UserServiceDeleteUserResponse -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_display_name_query import UserServiceDisplayNameQuery -from zitadel_client.models.user_service_domain_query import UserServiceDomainQuery -from zitadel_client.models.user_service_email_query import UserServiceEmailQuery -from zitadel_client.models.user_service_first_name_query import UserServiceFirstNameQuery -from zitadel_client.models.user_service_form_data import UserServiceFormData -from zitadel_client.models.user_service_gender import UserServiceGender -from zitadel_client.models.user_service_generate_recovery_codes_request import UserServiceGenerateRecoveryCodesRequest -from zitadel_client.models.user_service_generate_recovery_codes_response import UserServiceGenerateRecoveryCodesResponse -from zitadel_client.models.user_service_get_user_by_id_request import UserServiceGetUserByIDRequest -from zitadel_client.models.user_service_get_user_by_id_response import UserServiceGetUserByIDResponse -from zitadel_client.models.user_service_hashed_password import UserServiceHashedPassword -from zitadel_client.models.user_service_human import UserServiceHuman -from zitadel_client.models.user_service_human_email import UserServiceHumanEmail -from zitadel_client.models.user_service_human_mfa_init_skipped_request import UserServiceHumanMFAInitSkippedRequest -from zitadel_client.models.user_service_human_mfa_init_skipped_response import UserServiceHumanMFAInitSkippedResponse -from zitadel_client.models.user_service_human_phone import UserServiceHumanPhone -from zitadel_client.models.user_service_human_profile import UserServiceHumanProfile -from zitadel_client.models.user_service_human_user import UserServiceHumanUser -from zitadel_client.models.user_service_id_filter import UserServiceIDFilter -from zitadel_client.models.user_service_idp_information import UserServiceIDPInformation -from zitadel_client.models.user_service_idp_intent import UserServiceIDPIntent -from zitadel_client.models.user_service_idpldap_access_information import UserServiceIDPLDAPAccessInformation -from zitadel_client.models.user_service_idp_link import UserServiceIDPLink -from zitadel_client.models.user_service_idpo_auth_access_information import UserServiceIDPOAuthAccessInformation -from zitadel_client.models.user_service_idpsaml_access_information import UserServiceIDPSAMLAccessInformation -from zitadel_client.models.user_service_in_user_emails_query import UserServiceInUserEmailsQuery -from zitadel_client.models.user_service_in_user_id_query import UserServiceInUserIDQuery -from zitadel_client.models.user_service_key import UserServiceKey -from zitadel_client.models.user_service_key_field_name import UserServiceKeyFieldName -from zitadel_client.models.user_service_keys_search_filter import UserServiceKeysSearchFilter -from zitadel_client.models.user_service_ldap_credentials import UserServiceLDAPCredentials -from zitadel_client.models.user_service_last_name_query import UserServiceLastNameQuery -from zitadel_client.models.user_service_list_authentication_factors_request import UserServiceListAuthenticationFactorsRequest -from zitadel_client.models.user_service_list_authentication_factors_response import UserServiceListAuthenticationFactorsResponse -from zitadel_client.models.user_service_list_authentication_method_types_request import UserServiceListAuthenticationMethodTypesRequest -from zitadel_client.models.user_service_list_authentication_method_types_response import UserServiceListAuthenticationMethodTypesResponse -from zitadel_client.models.user_service_list_details import UserServiceListDetails -from zitadel_client.models.user_service_list_idp_links_request import UserServiceListIDPLinksRequest -from zitadel_client.models.user_service_list_idp_links_response import UserServiceListIDPLinksResponse -from zitadel_client.models.user_service_list_keys_request import UserServiceListKeysRequest -from zitadel_client.models.user_service_list_keys_response import UserServiceListKeysResponse -from zitadel_client.models.user_service_list_passkeys_request import UserServiceListPasskeysRequest -from zitadel_client.models.user_service_list_passkeys_response import UserServiceListPasskeysResponse -from zitadel_client.models.user_service_list_personal_access_tokens_request import UserServiceListPersonalAccessTokensRequest -from zitadel_client.models.user_service_list_personal_access_tokens_response import UserServiceListPersonalAccessTokensResponse -from zitadel_client.models.user_service_list_query import UserServiceListQuery -from zitadel_client.models.user_service_list_user_metadata_request import UserServiceListUserMetadataRequest -from zitadel_client.models.user_service_list_user_metadata_response import UserServiceListUserMetadataResponse -from zitadel_client.models.user_service_list_users_request import UserServiceListUsersRequest -from zitadel_client.models.user_service_list_users_response import UserServiceListUsersResponse -from zitadel_client.models.user_service_lock_user_request import UserServiceLockUserRequest -from zitadel_client.models.user_service_lock_user_response import UserServiceLockUserResponse -from zitadel_client.models.user_service_login_name_query import UserServiceLoginNameQuery -from zitadel_client.models.user_service_machine import UserServiceMachine -from zitadel_client.models.user_service_machine_user import UserServiceMachineUser -from zitadel_client.models.user_service_metadata import UserServiceMetadata -from zitadel_client.models.user_service_metadata_key_filter import UserServiceMetadataKeyFilter -from zitadel_client.models.user_service_metadata_search_filter import UserServiceMetadataSearchFilter -from zitadel_client.models.user_service_metadata_value_filter import UserServiceMetadataValueFilter -from zitadel_client.models.user_service_nick_name_query import UserServiceNickNameQuery -from zitadel_client.models.user_service_not_query import UserServiceNotQuery -from zitadel_client.models.user_service_notification_type import UserServiceNotificationType -from zitadel_client.models.user_service_or_query import UserServiceOrQuery -from zitadel_client.models.user_service_organization import UserServiceOrganization -from zitadel_client.models.user_service_organization_id_query import UserServiceOrganizationIdQuery -from zitadel_client.models.user_service_pagination_request import UserServicePaginationRequest -from zitadel_client.models.user_service_pagination_response import UserServicePaginationResponse -from zitadel_client.models.user_service_passkey import UserServicePasskey -from zitadel_client.models.user_service_passkey_authenticator import UserServicePasskeyAuthenticator -from zitadel_client.models.user_service_passkey_registration_code import UserServicePasskeyRegistrationCode -from zitadel_client.models.user_service_password import UserServicePassword -from zitadel_client.models.user_service_password_reset_request import UserServicePasswordResetRequest -from zitadel_client.models.user_service_password_reset_response import UserServicePasswordResetResponse -from zitadel_client.models.user_service_personal_access_token import UserServicePersonalAccessToken -from zitadel_client.models.user_service_personal_access_token_field_name import UserServicePersonalAccessTokenFieldName -from zitadel_client.models.user_service_personal_access_tokens_search_filter import UserServicePersonalAccessTokensSearchFilter -from zitadel_client.models.user_service_phone_query import UserServicePhoneQuery -from zitadel_client.models.user_service_profile import UserServiceProfile -from zitadel_client.models.user_service_reactivate_user_request import UserServiceReactivateUserRequest -from zitadel_client.models.user_service_reactivate_user_response import UserServiceReactivateUserResponse -from zitadel_client.models.user_service_redirect_urls import UserServiceRedirectURLs -from zitadel_client.models.user_service_register_passkey_request import UserServiceRegisterPasskeyRequest -from zitadel_client.models.user_service_register_passkey_response import UserServiceRegisterPasskeyResponse -from zitadel_client.models.user_service_register_totp_request import UserServiceRegisterTOTPRequest -from zitadel_client.models.user_service_register_totp_response import UserServiceRegisterTOTPResponse -from zitadel_client.models.user_service_register_u2_f_request import UserServiceRegisterU2FRequest -from zitadel_client.models.user_service_register_u2_f_response import UserServiceRegisterU2FResponse -from zitadel_client.models.user_service_remove_idp_link_request import UserServiceRemoveIDPLinkRequest -from zitadel_client.models.user_service_remove_idp_link_response import UserServiceRemoveIDPLinkResponse -from zitadel_client.models.user_service_remove_key_request import UserServiceRemoveKeyRequest -from zitadel_client.models.user_service_remove_key_response import UserServiceRemoveKeyResponse -from zitadel_client.models.user_service_remove_otp_email_request import UserServiceRemoveOTPEmailRequest -from zitadel_client.models.user_service_remove_otp_email_response import UserServiceRemoveOTPEmailResponse -from zitadel_client.models.user_service_remove_otpsms_request import UserServiceRemoveOTPSMSRequest -from zitadel_client.models.user_service_remove_otpsms_response import UserServiceRemoveOTPSMSResponse -from zitadel_client.models.user_service_remove_passkey_request import UserServiceRemovePasskeyRequest -from zitadel_client.models.user_service_remove_passkey_response import UserServiceRemovePasskeyResponse -from zitadel_client.models.user_service_remove_personal_access_token_request import UserServiceRemovePersonalAccessTokenRequest -from zitadel_client.models.user_service_remove_personal_access_token_response import UserServiceRemovePersonalAccessTokenResponse -from zitadel_client.models.user_service_remove_phone_request import UserServiceRemovePhoneRequest -from zitadel_client.models.user_service_remove_phone_response import UserServiceRemovePhoneResponse -from zitadel_client.models.user_service_remove_recovery_codes_request import UserServiceRemoveRecoveryCodesRequest -from zitadel_client.models.user_service_remove_recovery_codes_response import UserServiceRemoveRecoveryCodesResponse -from zitadel_client.models.user_service_remove_secret_request import UserServiceRemoveSecretRequest -from zitadel_client.models.user_service_remove_secret_response import UserServiceRemoveSecretResponse -from zitadel_client.models.user_service_remove_totp_request import UserServiceRemoveTOTPRequest -from zitadel_client.models.user_service_remove_totp_response import UserServiceRemoveTOTPResponse -from zitadel_client.models.user_service_remove_u2_f_request import UserServiceRemoveU2FRequest -from zitadel_client.models.user_service_remove_u2_f_response import UserServiceRemoveU2FResponse -from zitadel_client.models.user_service_resend_email_code_request import UserServiceResendEmailCodeRequest -from zitadel_client.models.user_service_resend_email_code_response import UserServiceResendEmailCodeResponse -from zitadel_client.models.user_service_resend_invite_code_request import UserServiceResendInviteCodeRequest -from zitadel_client.models.user_service_resend_invite_code_response import UserServiceResendInviteCodeResponse -from zitadel_client.models.user_service_resend_phone_code_request import UserServiceResendPhoneCodeRequest -from zitadel_client.models.user_service_resend_phone_code_response import UserServiceResendPhoneCodeResponse -from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import UserServiceRetrieveIdentityProviderIntentRequest -from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import UserServiceRetrieveIdentityProviderIntentResponse -from zitadel_client.models.user_service_search_query import UserServiceSearchQuery -from zitadel_client.models.user_service_send_email_code_request import UserServiceSendEmailCodeRequest -from zitadel_client.models.user_service_send_email_code_response import UserServiceSendEmailCodeResponse -from zitadel_client.models.user_service_send_email_verification_code import UserServiceSendEmailVerificationCode -from zitadel_client.models.user_service_send_invite_code import UserServiceSendInviteCode -from zitadel_client.models.user_service_send_passkey_registration_link import UserServiceSendPasskeyRegistrationLink -from zitadel_client.models.user_service_send_password_reset_link import UserServiceSendPasswordResetLink -from zitadel_client.models.user_service_set_email_request import UserServiceSetEmailRequest -from zitadel_client.models.user_service_set_email_response import UserServiceSetEmailResponse -from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail -from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone -from zitadel_client.models.user_service_set_human_profile import UserServiceSetHumanProfile -from zitadel_client.models.user_service_set_metadata_entry import UserServiceSetMetadataEntry -from zitadel_client.models.user_service_set_password import UserServiceSetPassword -from zitadel_client.models.user_service_set_password_request import UserServiceSetPasswordRequest -from zitadel_client.models.user_service_set_password_response import UserServiceSetPasswordResponse -from zitadel_client.models.user_service_set_phone_request import UserServiceSetPhoneRequest -from zitadel_client.models.user_service_set_phone_response import UserServiceSetPhoneResponse -from zitadel_client.models.user_service_set_user_metadata_request import UserServiceSetUserMetadataRequest -from zitadel_client.models.user_service_set_user_metadata_response import UserServiceSetUserMetadataResponse -from zitadel_client.models.user_service_start_identity_provider_intent_request import UserServiceStartIdentityProviderIntentRequest -from zitadel_client.models.user_service_start_identity_provider_intent_response import UserServiceStartIdentityProviderIntentResponse -from zitadel_client.models.user_service_state_query import UserServiceStateQuery -from zitadel_client.models.user_service_text_filter_method import UserServiceTextFilterMethod -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from zitadel_client.models.user_service_timestamp_filter import UserServiceTimestampFilter -from zitadel_client.models.user_service_timestamp_filter_method import UserServiceTimestampFilterMethod -from zitadel_client.models.user_service_type import UserServiceType -from zitadel_client.models.user_service_type_query import UserServiceTypeQuery -from zitadel_client.models.user_service_unlock_user_request import UserServiceUnlockUserRequest -from zitadel_client.models.user_service_unlock_user_response import UserServiceUnlockUserResponse -from zitadel_client.models.user_service_update_human_user_request import UserServiceUpdateHumanUserRequest -from zitadel_client.models.user_service_update_human_user_response import UserServiceUpdateHumanUserResponse -from zitadel_client.models.user_service_update_user_request import UserServiceUpdateUserRequest -from zitadel_client.models.user_service_update_user_response import UserServiceUpdateUserResponse -from zitadel_client.models.user_service_user import UserServiceUser -from zitadel_client.models.user_service_user_field_name import UserServiceUserFieldName -from zitadel_client.models.user_service_user_name_query import UserServiceUserNameQuery -from zitadel_client.models.user_service_user_state import UserServiceUserState -from zitadel_client.models.user_service_verify_email_request import UserServiceVerifyEmailRequest -from zitadel_client.models.user_service_verify_email_response import UserServiceVerifyEmailResponse -from zitadel_client.models.user_service_verify_invite_code_request import UserServiceVerifyInviteCodeRequest -from zitadel_client.models.user_service_verify_invite_code_response import UserServiceVerifyInviteCodeResponse -from zitadel_client.models.user_service_verify_passkey_registration_request import UserServiceVerifyPasskeyRegistrationRequest -from zitadel_client.models.user_service_verify_passkey_registration_response import UserServiceVerifyPasskeyRegistrationResponse -from zitadel_client.models.user_service_verify_phone_request import UserServiceVerifyPhoneRequest -from zitadel_client.models.user_service_verify_phone_response import UserServiceVerifyPhoneResponse -from zitadel_client.models.user_service_verify_totp_registration_request import UserServiceVerifyTOTPRegistrationRequest -from zitadel_client.models.user_service_verify_totp_registration_response import UserServiceVerifyTOTPRegistrationResponse -from zitadel_client.models.user_service_verify_u2_f_registration_request import UserServiceVerifyU2FRegistrationRequest -from zitadel_client.models.user_service_verify_u2_f_registration_response import UserServiceVerifyU2FRegistrationResponse -from zitadel_client.models.web_key_service_activate_web_key_request import WebKeyServiceActivateWebKeyRequest -from zitadel_client.models.web_key_service_activate_web_key_response import WebKeyServiceActivateWebKeyResponse -from zitadel_client.models.web_key_service_any import WebKeyServiceAny -from zitadel_client.models.web_key_service_connect_error import WebKeyServiceConnectError -from zitadel_client.models.web_key_service_create_web_key_request import WebKeyServiceCreateWebKeyRequest -from zitadel_client.models.web_key_service_create_web_key_response import WebKeyServiceCreateWebKeyResponse -from zitadel_client.models.web_key_service_delete_web_key_request import WebKeyServiceDeleteWebKeyRequest -from zitadel_client.models.web_key_service_delete_web_key_response import WebKeyServiceDeleteWebKeyResponse -from zitadel_client.models.web_key_service_ecdsa import WebKeyServiceECDSA -from zitadel_client.models.web_key_service_ecdsa_curve import WebKeyServiceECDSACurve -from zitadel_client.models.web_key_service_list_web_keys_response import WebKeyServiceListWebKeysResponse -from zitadel_client.models.web_key_service_rsa import WebKeyServiceRSA -from zitadel_client.models.web_key_service_rsa_bits import WebKeyServiceRSABits -from zitadel_client.models.web_key_service_rsa_hasher import WebKeyServiceRSAHasher -from zitadel_client.models.web_key_service_state import WebKeyServiceState -from zitadel_client.models.web_key_service_web_key import WebKeyServiceWebKey +from zitadel_client.models.action_service_activate_public_key_request import ( + ActionServiceActivatePublicKeyRequest as ActionServiceActivatePublicKeyRequest, +) +from zitadel_client.models.action_service_activate_public_key_response import ( + ActionServiceActivatePublicKeyResponse as ActionServiceActivatePublicKeyResponse, +) +from zitadel_client.models.action_service_add_public_key_request import ( + ActionServiceAddPublicKeyRequest as ActionServiceAddPublicKeyRequest, +) +from zitadel_client.models.action_service_add_public_key_response import ( + ActionServiceAddPublicKeyResponse as ActionServiceAddPublicKeyResponse, +) +from zitadel_client.models.action_service_any import ( + ActionServiceAny as ActionServiceAny, +) +from zitadel_client.models.action_service_condition import ( + ActionServiceCondition as ActionServiceCondition, +) +from zitadel_client.models.action_service_connect_error import ( + ActionServiceConnectError as ActionServiceConnectError, +) +from zitadel_client.models.action_service_create_target_request import ( + ActionServiceCreateTargetRequest as ActionServiceCreateTargetRequest, +) +from zitadel_client.models.action_service_create_target_response import ( + ActionServiceCreateTargetResponse as ActionServiceCreateTargetResponse, +) +from zitadel_client.models.action_service_deactivate_public_key_request import ( + ActionServiceDeactivatePublicKeyRequest as ActionServiceDeactivatePublicKeyRequest, +) +from zitadel_client.models.action_service_deactivate_public_key_response import ( + ActionServiceDeactivatePublicKeyResponse as ActionServiceDeactivatePublicKeyResponse, +) +from zitadel_client.models.action_service_delete_target_request import ( + ActionServiceDeleteTargetRequest as ActionServiceDeleteTargetRequest, +) +from zitadel_client.models.action_service_delete_target_response import ( + ActionServiceDeleteTargetResponse as ActionServiceDeleteTargetResponse, +) +from zitadel_client.models.action_service_event_execution import ( + ActionServiceEventExecution as ActionServiceEventExecution, +) +from zitadel_client.models.action_service_execution import ( + ActionServiceExecution as ActionServiceExecution, +) +from zitadel_client.models.action_service_execution_field_name import ( + ActionServiceExecutionFieldName as ActionServiceExecutionFieldName, +) +from zitadel_client.models.action_service_execution_search_filter import ( + ActionServiceExecutionSearchFilter as ActionServiceExecutionSearchFilter, +) +from zitadel_client.models.action_service_execution_type import ( + ActionServiceExecutionType as ActionServiceExecutionType, +) +from zitadel_client.models.action_service_execution_type_filter import ( + ActionServiceExecutionTypeFilter as ActionServiceExecutionTypeFilter, +) +from zitadel_client.models.action_service_function_execution import ( + ActionServiceFunctionExecution as ActionServiceFunctionExecution, +) +from zitadel_client.models.action_service_get_target_request import ( + ActionServiceGetTargetRequest as ActionServiceGetTargetRequest, +) +from zitadel_client.models.action_service_get_target_response import ( + ActionServiceGetTargetResponse as ActionServiceGetTargetResponse, +) +from zitadel_client.models.action_service_in_conditions_filter import ( + ActionServiceInConditionsFilter as ActionServiceInConditionsFilter, +) +from zitadel_client.models.action_service_in_ids_filter import ( + ActionServiceInIDsFilter as ActionServiceInIDsFilter, +) +from zitadel_client.models.action_service_in_target_ids_filter import ( + ActionServiceInTargetIDsFilter as ActionServiceInTargetIDsFilter, +) +from zitadel_client.models.action_service_list_execution_functions_response import ( + ActionServiceListExecutionFunctionsResponse as ActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.action_service_list_execution_methods_response import ( + ActionServiceListExecutionMethodsResponse as ActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.action_service_list_execution_services_response import ( + ActionServiceListExecutionServicesResponse as ActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.action_service_list_executions_request import ( + ActionServiceListExecutionsRequest as ActionServiceListExecutionsRequest, +) +from zitadel_client.models.action_service_list_executions_response import ( + ActionServiceListExecutionsResponse as ActionServiceListExecutionsResponse, +) +from zitadel_client.models.action_service_list_public_keys_request import ( + ActionServiceListPublicKeysRequest as ActionServiceListPublicKeysRequest, +) +from zitadel_client.models.action_service_list_public_keys_response import ( + ActionServiceListPublicKeysResponse as ActionServiceListPublicKeysResponse, +) +from zitadel_client.models.action_service_list_targets_request import ( + ActionServiceListTargetsRequest as ActionServiceListTargetsRequest, +) +from zitadel_client.models.action_service_list_targets_response import ( + ActionServiceListTargetsResponse as ActionServiceListTargetsResponse, +) +from zitadel_client.models.action_service_pagination_request import ( + ActionServicePaginationRequest as ActionServicePaginationRequest, +) +from zitadel_client.models.action_service_pagination_response import ( + ActionServicePaginationResponse as ActionServicePaginationResponse, +) +from zitadel_client.models.action_service_payload_type import ( + ActionServicePayloadType as ActionServicePayloadType, +) +from zitadel_client.models.action_service_public_key import ( + ActionServicePublicKey as ActionServicePublicKey, +) +from zitadel_client.models.action_service_public_key_field_name import ( + ActionServicePublicKeyFieldName as ActionServicePublicKeyFieldName, +) +from zitadel_client.models.action_service_public_key_search_filter import ( + ActionServicePublicKeySearchFilter as ActionServicePublicKeySearchFilter, +) +from zitadel_client.models.action_service_rest_call import ( + ActionServiceRESTCall as ActionServiceRESTCall, +) +from zitadel_client.models.action_service_rest_webhook import ( + ActionServiceRESTWebhook as ActionServiceRESTWebhook, +) +from zitadel_client.models.action_service_remove_public_key_request import ( + ActionServiceRemovePublicKeyRequest as ActionServiceRemovePublicKeyRequest, +) +from zitadel_client.models.action_service_remove_public_key_response import ( + ActionServiceRemovePublicKeyResponse as ActionServiceRemovePublicKeyResponse, +) +from zitadel_client.models.action_service_request_execution import ( + ActionServiceRequestExecution as ActionServiceRequestExecution, +) +from zitadel_client.models.action_service_response_execution import ( + ActionServiceResponseExecution as ActionServiceResponseExecution, +) +from zitadel_client.models.action_service_set_execution_request import ( + ActionServiceSetExecutionRequest as ActionServiceSetExecutionRequest, +) +from zitadel_client.models.action_service_set_execution_response import ( + ActionServiceSetExecutionResponse as ActionServiceSetExecutionResponse, +) +from zitadel_client.models.action_service_target import ( + ActionServiceTarget as ActionServiceTarget, +) +from zitadel_client.models.action_service_target_field_name import ( + ActionServiceTargetFieldName as ActionServiceTargetFieldName, +) +from zitadel_client.models.action_service_target_filter import ( + ActionServiceTargetFilter as ActionServiceTargetFilter, +) +from zitadel_client.models.action_service_target_name_filter import ( + ActionServiceTargetNameFilter as ActionServiceTargetNameFilter, +) +from zitadel_client.models.action_service_target_search_filter import ( + ActionServiceTargetSearchFilter as ActionServiceTargetSearchFilter, +) +from zitadel_client.models.action_service_text_filter_method import ( + ActionServiceTextFilterMethod as ActionServiceTextFilterMethod, +) +from zitadel_client.models.action_service_timestamp_filter import ( + ActionServiceTimestampFilter as ActionServiceTimestampFilter, +) +from zitadel_client.models.action_service_timestamp_filter_method import ( + ActionServiceTimestampFilterMethod as ActionServiceTimestampFilterMethod, +) +from zitadel_client.models.action_service_update_target_request import ( + ActionServiceUpdateTargetRequest as ActionServiceUpdateTargetRequest, +) +from zitadel_client.models.action_service_update_target_response import ( + ActionServiceUpdateTargetResponse as ActionServiceUpdateTargetResponse, +) +from zitadel_client.models.application_service_api_auth_method_type import ( + ApplicationServiceAPIAuthMethodType as ApplicationServiceAPIAuthMethodType, +) +from zitadel_client.models.application_service_api_configuration import ( + ApplicationServiceAPIConfiguration as ApplicationServiceAPIConfiguration, +) +from zitadel_client.models.application_service_any import ( + ApplicationServiceAny as ApplicationServiceAny, +) +from zitadel_client.models.application_service_application import ( + ApplicationServiceApplication as ApplicationServiceApplication, +) +from zitadel_client.models.application_service_application_key import ( + ApplicationServiceApplicationKey as ApplicationServiceApplicationKey, +) +from zitadel_client.models.application_service_application_key_application_id_filter import ( + ApplicationServiceApplicationKeyApplicationIDFilter as ApplicationServiceApplicationKeyApplicationIDFilter, +) +from zitadel_client.models.application_service_application_key_organization_id_filter import ( + ApplicationServiceApplicationKeyOrganizationIDFilter as ApplicationServiceApplicationKeyOrganizationIDFilter, +) +from zitadel_client.models.application_service_application_key_project_id_filter import ( + ApplicationServiceApplicationKeyProjectIDFilter as ApplicationServiceApplicationKeyProjectIDFilter, +) +from zitadel_client.models.application_service_application_key_search_filter import ( + ApplicationServiceApplicationKeySearchFilter as ApplicationServiceApplicationKeySearchFilter, +) +from zitadel_client.models.application_service_application_keys_sorting import ( + ApplicationServiceApplicationKeysSorting as ApplicationServiceApplicationKeysSorting, +) +from zitadel_client.models.application_service_application_name_filter import ( + ApplicationServiceApplicationNameFilter as ApplicationServiceApplicationNameFilter, +) +from zitadel_client.models.application_service_application_search_filter import ( + ApplicationServiceApplicationSearchFilter as ApplicationServiceApplicationSearchFilter, +) +from zitadel_client.models.application_service_application_sorting import ( + ApplicationServiceApplicationSorting as ApplicationServiceApplicationSorting, +) +from zitadel_client.models.application_service_application_state import ( + ApplicationServiceApplicationState as ApplicationServiceApplicationState, +) +from zitadel_client.models.application_service_application_type import ( + ApplicationServiceApplicationType as ApplicationServiceApplicationType, +) +from zitadel_client.models.application_service_client_id_filter import ( + ApplicationServiceClientIDFilter as ApplicationServiceClientIDFilter, +) +from zitadel_client.models.application_service_connect_error import ( + ApplicationServiceConnectError as ApplicationServiceConnectError, +) +from zitadel_client.models.application_service_create_api_application_request import ( + ApplicationServiceCreateAPIApplicationRequest as ApplicationServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.application_service_create_api_application_response import ( + ApplicationServiceCreateAPIApplicationResponse as ApplicationServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.application_service_create_application_key_request import ( + ApplicationServiceCreateApplicationKeyRequest as ApplicationServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.application_service_create_application_key_response import ( + ApplicationServiceCreateApplicationKeyResponse as ApplicationServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.application_service_create_application_request import ( + ApplicationServiceCreateApplicationRequest as ApplicationServiceCreateApplicationRequest, +) +from zitadel_client.models.application_service_create_application_response import ( + ApplicationServiceCreateApplicationResponse as ApplicationServiceCreateApplicationResponse, +) +from zitadel_client.models.application_service_create_oidc_application_request import ( + ApplicationServiceCreateOIDCApplicationRequest as ApplicationServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.application_service_create_oidc_application_response import ( + ApplicationServiceCreateOIDCApplicationResponse as ApplicationServiceCreateOIDCApplicationResponse, +) +from zitadel_client.models.application_service_create_saml_application_request import ( + ApplicationServiceCreateSAMLApplicationRequest as ApplicationServiceCreateSAMLApplicationRequest, +) +from zitadel_client.models.application_service_deactivate_application_request import ( + ApplicationServiceDeactivateApplicationRequest as ApplicationServiceDeactivateApplicationRequest, +) +from zitadel_client.models.application_service_deactivate_application_response import ( + ApplicationServiceDeactivateApplicationResponse as ApplicationServiceDeactivateApplicationResponse, +) +from zitadel_client.models.application_service_delete_application_key_request import ( + ApplicationServiceDeleteApplicationKeyRequest as ApplicationServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.application_service_delete_application_key_response import ( + ApplicationServiceDeleteApplicationKeyResponse as ApplicationServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.application_service_delete_application_request import ( + ApplicationServiceDeleteApplicationRequest as ApplicationServiceDeleteApplicationRequest, +) +from zitadel_client.models.application_service_delete_application_response import ( + ApplicationServiceDeleteApplicationResponse as ApplicationServiceDeleteApplicationResponse, +) +from zitadel_client.models.application_service_entity_id_filter import ( + ApplicationServiceEntityIDFilter as ApplicationServiceEntityIDFilter, +) +from zitadel_client.models.application_service_generate_client_secret_request import ( + ApplicationServiceGenerateClientSecretRequest as ApplicationServiceGenerateClientSecretRequest, +) +from zitadel_client.models.application_service_generate_client_secret_response import ( + ApplicationServiceGenerateClientSecretResponse as ApplicationServiceGenerateClientSecretResponse, +) +from zitadel_client.models.application_service_get_application_key_request import ( + ApplicationServiceGetApplicationKeyRequest as ApplicationServiceGetApplicationKeyRequest, +) +from zitadel_client.models.application_service_get_application_key_response import ( + ApplicationServiceGetApplicationKeyResponse as ApplicationServiceGetApplicationKeyResponse, +) +from zitadel_client.models.application_service_get_application_request import ( + ApplicationServiceGetApplicationRequest as ApplicationServiceGetApplicationRequest, +) +from zitadel_client.models.application_service_get_application_response import ( + ApplicationServiceGetApplicationResponse as ApplicationServiceGetApplicationResponse, +) +from zitadel_client.models.application_service_list_application_keys_request import ( + ApplicationServiceListApplicationKeysRequest as ApplicationServiceListApplicationKeysRequest, +) +from zitadel_client.models.application_service_list_application_keys_response import ( + ApplicationServiceListApplicationKeysResponse as ApplicationServiceListApplicationKeysResponse, +) +from zitadel_client.models.application_service_list_applications_request import ( + ApplicationServiceListApplicationsRequest as ApplicationServiceListApplicationsRequest, +) +from zitadel_client.models.application_service_list_applications_response import ( + ApplicationServiceListApplicationsResponse as ApplicationServiceListApplicationsResponse, +) +from zitadel_client.models.application_service_login_v2 import ( + ApplicationServiceLoginV2 as ApplicationServiceLoginV2, +) +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion as ApplicationServiceLoginVersion, +) +from zitadel_client.models.application_service_oidc_application_type import ( + ApplicationServiceOIDCApplicationType as ApplicationServiceOIDCApplicationType, +) +from zitadel_client.models.application_service_oidc_auth_method_type import ( + ApplicationServiceOIDCAuthMethodType as ApplicationServiceOIDCAuthMethodType, +) +from zitadel_client.models.application_service_oidc_configuration import ( + ApplicationServiceOIDCConfiguration as ApplicationServiceOIDCConfiguration, +) +from zitadel_client.models.application_service_oidc_grant_type import ( + ApplicationServiceOIDCGrantType as ApplicationServiceOIDCGrantType, +) +from zitadel_client.models.application_service_oidc_localized_message import ( + ApplicationServiceOIDCLocalizedMessage as ApplicationServiceOIDCLocalizedMessage, +) +from zitadel_client.models.application_service_oidc_response_type import ( + ApplicationServiceOIDCResponseType as ApplicationServiceOIDCResponseType, +) +from zitadel_client.models.application_service_oidc_token_type import ( + ApplicationServiceOIDCTokenType as ApplicationServiceOIDCTokenType, +) +from zitadel_client.models.application_service_oidc_version import ( + ApplicationServiceOIDCVersion as ApplicationServiceOIDCVersion, +) +from zitadel_client.models.application_service_pagination_request import ( + ApplicationServicePaginationRequest as ApplicationServicePaginationRequest, +) +from zitadel_client.models.application_service_pagination_response import ( + ApplicationServicePaginationResponse as ApplicationServicePaginationResponse, +) +from zitadel_client.models.application_service_project_id_filter import ( + ApplicationServiceProjectIDFilter as ApplicationServiceProjectIDFilter, +) +from zitadel_client.models.application_service_reactivate_application_request import ( + ApplicationServiceReactivateApplicationRequest as ApplicationServiceReactivateApplicationRequest, +) +from zitadel_client.models.application_service_reactivate_application_response import ( + ApplicationServiceReactivateApplicationResponse as ApplicationServiceReactivateApplicationResponse, +) +from zitadel_client.models.application_service_saml_configuration import ( + ApplicationServiceSAMLConfiguration as ApplicationServiceSAMLConfiguration, +) +from zitadel_client.models.application_service_text_filter_method import ( + ApplicationServiceTextFilterMethod as ApplicationServiceTextFilterMethod, +) +from zitadel_client.models.application_service_update_api_application_configuration_request import ( + ApplicationServiceUpdateAPIApplicationConfigurationRequest as ApplicationServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_application_request import ( + ApplicationServiceUpdateApplicationRequest as ApplicationServiceUpdateApplicationRequest, +) +from zitadel_client.models.application_service_update_application_response import ( + ApplicationServiceUpdateApplicationResponse as ApplicationServiceUpdateApplicationResponse, +) +from zitadel_client.models.application_service_update_oidc_application_configuration_request import ( + ApplicationServiceUpdateOIDCApplicationConfigurationRequest as ApplicationServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_saml_application_configuration_request import ( + ApplicationServiceUpdateSAMLApplicationConfigurationRequest as ApplicationServiceUpdateSAMLApplicationConfigurationRequest, +) +from zitadel_client.models.authorization_service_activate_authorization_request import ( + AuthorizationServiceActivateAuthorizationRequest as AuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_activate_authorization_response import ( + AuthorizationServiceActivateAuthorizationResponse as AuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_any import ( + AuthorizationServiceAny as AuthorizationServiceAny, +) +from zitadel_client.models.authorization_service_authorization import ( + AuthorizationServiceAuthorization as AuthorizationServiceAuthorization, +) +from zitadel_client.models.authorization_service_authorization_field_name import ( + AuthorizationServiceAuthorizationFieldName as AuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.authorization_service_authorizations_search_filter import ( + AuthorizationServiceAuthorizationsSearchFilter as AuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.authorization_service_connect_error import ( + AuthorizationServiceConnectError as AuthorizationServiceConnectError, +) +from zitadel_client.models.authorization_service_create_authorization_request import ( + AuthorizationServiceCreateAuthorizationRequest as AuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_create_authorization_response import ( + AuthorizationServiceCreateAuthorizationResponse as AuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_deactivate_authorization_request import ( + AuthorizationServiceDeactivateAuthorizationRequest as AuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_deactivate_authorization_response import ( + AuthorizationServiceDeactivateAuthorizationResponse as AuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_delete_authorization_request import ( + AuthorizationServiceDeleteAuthorizationRequest as AuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.authorization_service_delete_authorization_response import ( + AuthorizationServiceDeleteAuthorizationResponse as AuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.authorization_service_id_filter import ( + AuthorizationServiceIDFilter as AuthorizationServiceIDFilter, +) +from zitadel_client.models.authorization_service_in_ids_filter import ( + AuthorizationServiceInIDsFilter as AuthorizationServiceInIDsFilter, +) +from zitadel_client.models.authorization_service_list_authorizations_request import ( + AuthorizationServiceListAuthorizationsRequest as AuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.authorization_service_list_authorizations_response import ( + AuthorizationServiceListAuthorizationsResponse as AuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.authorization_service_organization import ( + AuthorizationServiceOrganization as AuthorizationServiceOrganization, +) +from zitadel_client.models.authorization_service_pagination_request import ( + AuthorizationServicePaginationRequest as AuthorizationServicePaginationRequest, +) +from zitadel_client.models.authorization_service_pagination_response import ( + AuthorizationServicePaginationResponse as AuthorizationServicePaginationResponse, +) +from zitadel_client.models.authorization_service_project import ( + AuthorizationServiceProject as AuthorizationServiceProject, +) +from zitadel_client.models.authorization_service_project_name_query import ( + AuthorizationServiceProjectNameQuery as AuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.authorization_service_role import ( + AuthorizationServiceRole as AuthorizationServiceRole, +) +from zitadel_client.models.authorization_service_role_key_query import ( + AuthorizationServiceRoleKeyQuery as AuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.authorization_service_state import ( + AuthorizationServiceState as AuthorizationServiceState, +) +from zitadel_client.models.authorization_service_state_query import ( + AuthorizationServiceStateQuery as AuthorizationServiceStateQuery, +) +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod as AuthorizationServiceTextFilterMethod, +) +from zitadel_client.models.authorization_service_update_authorization_request import ( + AuthorizationServiceUpdateAuthorizationRequest as AuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.authorization_service_update_authorization_response import ( + AuthorizationServiceUpdateAuthorizationResponse as AuthorizationServiceUpdateAuthorizationResponse, +) +from zitadel_client.models.authorization_service_user import ( + AuthorizationServiceUser as AuthorizationServiceUser, +) +from zitadel_client.models.authorization_service_user_display_name_query import ( + AuthorizationServiceUserDisplayNameQuery as AuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.authorization_service_user_preferred_login_name_query import ( + AuthorizationServiceUserPreferredLoginNameQuery as AuthorizationServiceUserPreferredLoginNameQuery, +) +from zitadel_client.models.beta_action_service_any import ( + BetaActionServiceAny as BetaActionServiceAny, +) +from zitadel_client.models.beta_action_service_condition import ( + BetaActionServiceCondition as BetaActionServiceCondition, +) +from zitadel_client.models.beta_action_service_connect_error import ( + BetaActionServiceConnectError as BetaActionServiceConnectError, +) +from zitadel_client.models.beta_action_service_create_target_request import ( + BetaActionServiceCreateTargetRequest as BetaActionServiceCreateTargetRequest, +) +from zitadel_client.models.beta_action_service_create_target_response import ( + BetaActionServiceCreateTargetResponse as BetaActionServiceCreateTargetResponse, +) +from zitadel_client.models.beta_action_service_delete_target_request import ( + BetaActionServiceDeleteTargetRequest as BetaActionServiceDeleteTargetRequest, +) +from zitadel_client.models.beta_action_service_delete_target_response import ( + BetaActionServiceDeleteTargetResponse as BetaActionServiceDeleteTargetResponse, +) +from zitadel_client.models.beta_action_service_event_execution import ( + BetaActionServiceEventExecution as BetaActionServiceEventExecution, +) +from zitadel_client.models.beta_action_service_execution import ( + BetaActionServiceExecution as BetaActionServiceExecution, +) +from zitadel_client.models.beta_action_service_execution_field_name import ( + BetaActionServiceExecutionFieldName as BetaActionServiceExecutionFieldName, +) +from zitadel_client.models.beta_action_service_execution_search_filter import ( + BetaActionServiceExecutionSearchFilter as BetaActionServiceExecutionSearchFilter, +) +from zitadel_client.models.beta_action_service_execution_type import ( + BetaActionServiceExecutionType as BetaActionServiceExecutionType, +) +from zitadel_client.models.beta_action_service_execution_type_filter import ( + BetaActionServiceExecutionTypeFilter as BetaActionServiceExecutionTypeFilter, +) +from zitadel_client.models.beta_action_service_function_execution import ( + BetaActionServiceFunctionExecution as BetaActionServiceFunctionExecution, +) +from zitadel_client.models.beta_action_service_get_target_request import ( + BetaActionServiceGetTargetRequest as BetaActionServiceGetTargetRequest, +) +from zitadel_client.models.beta_action_service_get_target_response import ( + BetaActionServiceGetTargetResponse as BetaActionServiceGetTargetResponse, +) +from zitadel_client.models.beta_action_service_in_conditions_filter import ( + BetaActionServiceInConditionsFilter as BetaActionServiceInConditionsFilter, +) +from zitadel_client.models.beta_action_service_in_target_ids_filter import ( + BetaActionServiceInTargetIDsFilter as BetaActionServiceInTargetIDsFilter, +) +from zitadel_client.models.beta_action_service_list_execution_functions_response import ( + BetaActionServiceListExecutionFunctionsResponse as BetaActionServiceListExecutionFunctionsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_methods_response import ( + BetaActionServiceListExecutionMethodsResponse as BetaActionServiceListExecutionMethodsResponse, +) +from zitadel_client.models.beta_action_service_list_execution_services_response import ( + BetaActionServiceListExecutionServicesResponse as BetaActionServiceListExecutionServicesResponse, +) +from zitadel_client.models.beta_action_service_list_executions_request import ( + BetaActionServiceListExecutionsRequest as BetaActionServiceListExecutionsRequest, +) +from zitadel_client.models.beta_action_service_list_executions_response import ( + BetaActionServiceListExecutionsResponse as BetaActionServiceListExecutionsResponse, +) +from zitadel_client.models.beta_action_service_list_targets_request import ( + BetaActionServiceListTargetsRequest as BetaActionServiceListTargetsRequest, +) +from zitadel_client.models.beta_action_service_list_targets_response import ( + BetaActionServiceListTargetsResponse as BetaActionServiceListTargetsResponse, +) +from zitadel_client.models.beta_action_service_pagination_request import ( + BetaActionServicePaginationRequest as BetaActionServicePaginationRequest, +) +from zitadel_client.models.beta_action_service_pagination_response import ( + BetaActionServicePaginationResponse as BetaActionServicePaginationResponse, +) +from zitadel_client.models.beta_action_service_rest_call import ( + BetaActionServiceRESTCall as BetaActionServiceRESTCall, +) +from zitadel_client.models.beta_action_service_rest_webhook import ( + BetaActionServiceRESTWebhook as BetaActionServiceRESTWebhook, +) +from zitadel_client.models.beta_action_service_request_execution import ( + BetaActionServiceRequestExecution as BetaActionServiceRequestExecution, +) +from zitadel_client.models.beta_action_service_response_execution import ( + BetaActionServiceResponseExecution as BetaActionServiceResponseExecution, +) +from zitadel_client.models.beta_action_service_set_execution_request import ( + BetaActionServiceSetExecutionRequest as BetaActionServiceSetExecutionRequest, +) +from zitadel_client.models.beta_action_service_set_execution_response import ( + BetaActionServiceSetExecutionResponse as BetaActionServiceSetExecutionResponse, +) +from zitadel_client.models.beta_action_service_target import ( + BetaActionServiceTarget as BetaActionServiceTarget, +) +from zitadel_client.models.beta_action_service_target_field_name import ( + BetaActionServiceTargetFieldName as BetaActionServiceTargetFieldName, +) +from zitadel_client.models.beta_action_service_target_filter import ( + BetaActionServiceTargetFilter as BetaActionServiceTargetFilter, +) +from zitadel_client.models.beta_action_service_target_name_filter import ( + BetaActionServiceTargetNameFilter as BetaActionServiceTargetNameFilter, +) +from zitadel_client.models.beta_action_service_target_search_filter import ( + BetaActionServiceTargetSearchFilter as BetaActionServiceTargetSearchFilter, +) +from zitadel_client.models.beta_action_service_text_filter_method import ( + BetaActionServiceTextFilterMethod as BetaActionServiceTextFilterMethod, +) +from zitadel_client.models.beta_action_service_update_target_request import ( + BetaActionServiceUpdateTargetRequest as BetaActionServiceUpdateTargetRequest, +) +from zitadel_client.models.beta_action_service_update_target_response import ( + BetaActionServiceUpdateTargetResponse as BetaActionServiceUpdateTargetResponse, +) +from zitadel_client.models.beta_app_service_api_auth_method_type import ( + BetaAppServiceAPIAuthMethodType as BetaAppServiceAPIAuthMethodType, +) +from zitadel_client.models.beta_app_service_api_config import ( + BetaAppServiceAPIConfig as BetaAppServiceAPIConfig, +) +from zitadel_client.models.beta_app_service_any import ( + BetaAppServiceAny as BetaAppServiceAny, +) +from zitadel_client.models.beta_app_service_app_sorting import ( + BetaAppServiceAppSorting as BetaAppServiceAppSorting, +) +from zitadel_client.models.beta_app_service_app_state import ( + BetaAppServiceAppState as BetaAppServiceAppState, +) +from zitadel_client.models.beta_app_service_application import ( + BetaAppServiceApplication as BetaAppServiceApplication, +) +from zitadel_client.models.beta_app_service_application_key import ( + BetaAppServiceApplicationKey as BetaAppServiceApplicationKey, +) +from zitadel_client.models.beta_app_service_application_keys_sorting import ( + BetaAppServiceApplicationKeysSorting as BetaAppServiceApplicationKeysSorting, +) +from zitadel_client.models.beta_app_service_application_name_query import ( + BetaAppServiceApplicationNameQuery as BetaAppServiceApplicationNameQuery, +) +from zitadel_client.models.beta_app_service_application_search_filter import ( + BetaAppServiceApplicationSearchFilter as BetaAppServiceApplicationSearchFilter, +) +from zitadel_client.models.beta_app_service_connect_error import ( + BetaAppServiceConnectError as BetaAppServiceConnectError, +) +from zitadel_client.models.beta_app_service_create_api_application_request import ( + BetaAppServiceCreateAPIApplicationRequest as BetaAppServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_api_application_response import ( + BetaAppServiceCreateAPIApplicationResponse as BetaAppServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_application_key_request import ( + BetaAppServiceCreateApplicationKeyRequest as BetaAppServiceCreateApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_create_application_key_response import ( + BetaAppServiceCreateApplicationKeyResponse as BetaAppServiceCreateApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_create_application_request import ( + BetaAppServiceCreateApplicationRequest as BetaAppServiceCreateApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_application_response import ( + BetaAppServiceCreateApplicationResponse as BetaAppServiceCreateApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_oidc_application_request import ( + BetaAppServiceCreateOIDCApplicationRequest as BetaAppServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_oidc_application_response import ( + BetaAppServiceCreateOIDCApplicationResponse as BetaAppServiceCreateOIDCApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_saml_application_request import ( + BetaAppServiceCreateSAMLApplicationRequest as BetaAppServiceCreateSAMLApplicationRequest, +) +from zitadel_client.models.beta_app_service_deactivate_application_request import ( + BetaAppServiceDeactivateApplicationRequest as BetaAppServiceDeactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_deactivate_application_response import ( + BetaAppServiceDeactivateApplicationResponse as BetaAppServiceDeactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_delete_application_key_request import ( + BetaAppServiceDeleteApplicationKeyRequest as BetaAppServiceDeleteApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_delete_application_key_response import ( + BetaAppServiceDeleteApplicationKeyResponse as BetaAppServiceDeleteApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_delete_application_request import ( + BetaAppServiceDeleteApplicationRequest as BetaAppServiceDeleteApplicationRequest, +) +from zitadel_client.models.beta_app_service_delete_application_response import ( + BetaAppServiceDeleteApplicationResponse as BetaAppServiceDeleteApplicationResponse, +) +from zitadel_client.models.beta_app_service_get_application_key_request import ( + BetaAppServiceGetApplicationKeyRequest as BetaAppServiceGetApplicationKeyRequest, +) +from zitadel_client.models.beta_app_service_get_application_key_response import ( + BetaAppServiceGetApplicationKeyResponse as BetaAppServiceGetApplicationKeyResponse, +) +from zitadel_client.models.beta_app_service_get_application_request import ( + BetaAppServiceGetApplicationRequest as BetaAppServiceGetApplicationRequest, +) +from zitadel_client.models.beta_app_service_get_application_response import ( + BetaAppServiceGetApplicationResponse as BetaAppServiceGetApplicationResponse, +) +from zitadel_client.models.beta_app_service_list_application_keys_request import ( + BetaAppServiceListApplicationKeysRequest as BetaAppServiceListApplicationKeysRequest, +) +from zitadel_client.models.beta_app_service_list_application_keys_response import ( + BetaAppServiceListApplicationKeysResponse as BetaAppServiceListApplicationKeysResponse, +) +from zitadel_client.models.beta_app_service_list_applications_request import ( + BetaAppServiceListApplicationsRequest as BetaAppServiceListApplicationsRequest, +) +from zitadel_client.models.beta_app_service_list_applications_response import ( + BetaAppServiceListApplicationsResponse as BetaAppServiceListApplicationsResponse, +) +from zitadel_client.models.beta_app_service_login_v2 import ( + BetaAppServiceLoginV2 as BetaAppServiceLoginV2, +) +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion as BetaAppServiceLoginVersion, +) +from zitadel_client.models.beta_app_service_oidc_app_type import ( + BetaAppServiceOIDCAppType as BetaAppServiceOIDCAppType, +) +from zitadel_client.models.beta_app_service_oidc_auth_method_type import ( + BetaAppServiceOIDCAuthMethodType as BetaAppServiceOIDCAuthMethodType, +) +from zitadel_client.models.beta_app_service_oidc_config import ( + BetaAppServiceOIDCConfig as BetaAppServiceOIDCConfig, +) +from zitadel_client.models.beta_app_service_oidc_grant_type import ( + BetaAppServiceOIDCGrantType as BetaAppServiceOIDCGrantType, +) +from zitadel_client.models.beta_app_service_oidc_localized_message import ( + BetaAppServiceOIDCLocalizedMessage as BetaAppServiceOIDCLocalizedMessage, +) +from zitadel_client.models.beta_app_service_oidc_response_type import ( + BetaAppServiceOIDCResponseType as BetaAppServiceOIDCResponseType, +) +from zitadel_client.models.beta_app_service_oidc_token_type import ( + BetaAppServiceOIDCTokenType as BetaAppServiceOIDCTokenType, +) +from zitadel_client.models.beta_app_service_oidc_version import ( + BetaAppServiceOIDCVersion as BetaAppServiceOIDCVersion, +) +from zitadel_client.models.beta_app_service_pagination_request import ( + BetaAppServicePaginationRequest as BetaAppServicePaginationRequest, +) +from zitadel_client.models.beta_app_service_pagination_response import ( + BetaAppServicePaginationResponse as BetaAppServicePaginationResponse, +) +from zitadel_client.models.beta_app_service_reactivate_application_request import ( + BetaAppServiceReactivateApplicationRequest as BetaAppServiceReactivateApplicationRequest, +) +from zitadel_client.models.beta_app_service_reactivate_application_response import ( + BetaAppServiceReactivateApplicationResponse as BetaAppServiceReactivateApplicationResponse, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_request import ( + BetaAppServiceRegenerateClientSecretRequest as BetaAppServiceRegenerateClientSecretRequest, +) +from zitadel_client.models.beta_app_service_regenerate_client_secret_response import ( + BetaAppServiceRegenerateClientSecretResponse as BetaAppServiceRegenerateClientSecretResponse, +) +from zitadel_client.models.beta_app_service_saml_config import ( + BetaAppServiceSAMLConfig as BetaAppServiceSAMLConfig, +) +from zitadel_client.models.beta_app_service_text_filter_method import ( + BetaAppServiceTextFilterMethod as BetaAppServiceTextFilterMethod, +) +from zitadel_client.models.beta_app_service_update_api_application_configuration_request import ( + BetaAppServiceUpdateAPIApplicationConfigurationRequest as BetaAppServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_application_request import ( + BetaAppServiceUpdateApplicationRequest as BetaAppServiceUpdateApplicationRequest, +) +from zitadel_client.models.beta_app_service_update_application_response import ( + BetaAppServiceUpdateApplicationResponse as BetaAppServiceUpdateApplicationResponse, +) +from zitadel_client.models.beta_app_service_update_oidc_application_configuration_request import ( + BetaAppServiceUpdateOIDCApplicationConfigurationRequest as BetaAppServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_saml_application_configuration_request import ( + BetaAppServiceUpdateSAMLApplicationConfigurationRequest as BetaAppServiceUpdateSAMLApplicationConfigurationRequest, +) +from zitadel_client.models.beta_authorization_service_activate_authorization_request import ( + BetaAuthorizationServiceActivateAuthorizationRequest as BetaAuthorizationServiceActivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_activate_authorization_response import ( + BetaAuthorizationServiceActivateAuthorizationResponse as BetaAuthorizationServiceActivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_any import ( + BetaAuthorizationServiceAny as BetaAuthorizationServiceAny, +) +from zitadel_client.models.beta_authorization_service_authorization import ( + BetaAuthorizationServiceAuthorization as BetaAuthorizationServiceAuthorization, +) +from zitadel_client.models.beta_authorization_service_authorization_field_name import ( + BetaAuthorizationServiceAuthorizationFieldName as BetaAuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.beta_authorization_service_authorizations_search_filter import ( + BetaAuthorizationServiceAuthorizationsSearchFilter as BetaAuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.beta_authorization_service_connect_error import ( + BetaAuthorizationServiceConnectError as BetaAuthorizationServiceConnectError, +) +from zitadel_client.models.beta_authorization_service_create_authorization_request import ( + BetaAuthorizationServiceCreateAuthorizationRequest as BetaAuthorizationServiceCreateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_create_authorization_response import ( + BetaAuthorizationServiceCreateAuthorizationResponse as BetaAuthorizationServiceCreateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_request import ( + BetaAuthorizationServiceDeactivateAuthorizationRequest as BetaAuthorizationServiceDeactivateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_deactivate_authorization_response import ( + BetaAuthorizationServiceDeactivateAuthorizationResponse as BetaAuthorizationServiceDeactivateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_request import ( + BetaAuthorizationServiceDeleteAuthorizationRequest as BetaAuthorizationServiceDeleteAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_delete_authorization_response import ( + BetaAuthorizationServiceDeleteAuthorizationResponse as BetaAuthorizationServiceDeleteAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_id_filter import ( + BetaAuthorizationServiceIDFilter as BetaAuthorizationServiceIDFilter, +) +from zitadel_client.models.beta_authorization_service_in_ids_filter import ( + BetaAuthorizationServiceInIDsFilter as BetaAuthorizationServiceInIDsFilter, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_request import ( + BetaAuthorizationServiceListAuthorizationsRequest as BetaAuthorizationServiceListAuthorizationsRequest, +) +from zitadel_client.models.beta_authorization_service_list_authorizations_response import ( + BetaAuthorizationServiceListAuthorizationsResponse as BetaAuthorizationServiceListAuthorizationsResponse, +) +from zitadel_client.models.beta_authorization_service_pagination_request import ( + BetaAuthorizationServicePaginationRequest as BetaAuthorizationServicePaginationRequest, +) +from zitadel_client.models.beta_authorization_service_pagination_response import ( + BetaAuthorizationServicePaginationResponse as BetaAuthorizationServicePaginationResponse, +) +from zitadel_client.models.beta_authorization_service_project_name_query import ( + BetaAuthorizationServiceProjectNameQuery as BetaAuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.beta_authorization_service_role_key_query import ( + BetaAuthorizationServiceRoleKeyQuery as BetaAuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.beta_authorization_service_state import ( + BetaAuthorizationServiceState as BetaAuthorizationServiceState, +) +from zitadel_client.models.beta_authorization_service_state_query import ( + BetaAuthorizationServiceStateQuery as BetaAuthorizationServiceStateQuery, +) +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod as BetaAuthorizationServiceTextFilterMethod, +) +from zitadel_client.models.beta_authorization_service_update_authorization_request import ( + BetaAuthorizationServiceUpdateAuthorizationRequest as BetaAuthorizationServiceUpdateAuthorizationRequest, +) +from zitadel_client.models.beta_authorization_service_update_authorization_response import ( + BetaAuthorizationServiceUpdateAuthorizationResponse as BetaAuthorizationServiceUpdateAuthorizationResponse, +) +from zitadel_client.models.beta_authorization_service_user import ( + BetaAuthorizationServiceUser as BetaAuthorizationServiceUser, +) +from zitadel_client.models.beta_authorization_service_user_display_name_query import ( + BetaAuthorizationServiceUserDisplayNameQuery as BetaAuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.beta_authorization_service_user_preferred_login_name_query import ( + BetaAuthorizationServiceUserPreferredLoginNameQuery as BetaAuthorizationServiceUserPreferredLoginNameQuery, +) +from zitadel_client.models.beta_feature_service_any import ( + BetaFeatureServiceAny as BetaFeatureServiceAny, +) +from zitadel_client.models.beta_feature_service_connect_error import ( + BetaFeatureServiceConnectError as BetaFeatureServiceConnectError, +) +from zitadel_client.models.beta_feature_service_details import ( + BetaFeatureServiceDetails as BetaFeatureServiceDetails, +) +from zitadel_client.models.beta_feature_service_feature_flag import ( + BetaFeatureServiceFeatureFlag as BetaFeatureServiceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_get_instance_features_request import ( + BetaFeatureServiceGetInstanceFeaturesRequest as BetaFeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_instance_features_response import ( + BetaFeatureServiceGetInstanceFeaturesResponse as BetaFeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_organization_features_request import ( + BetaFeatureServiceGetOrganizationFeaturesRequest as BetaFeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_organization_features_response import ( + BetaFeatureServiceGetOrganizationFeaturesResponse as BetaFeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_system_features_response import ( + BetaFeatureServiceGetSystemFeaturesResponse as BetaFeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_get_user_features_request import ( + BetaFeatureServiceGetUserFeaturesRequest as BetaFeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_get_user_features_response import ( + BetaFeatureServiceGetUserFeaturesResponse as BetaFeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_improved_performance import ( + BetaFeatureServiceImprovedPerformance as BetaFeatureServiceImprovedPerformance, +) +from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import ( + BetaFeatureServiceImprovedPerformanceFeatureFlag as BetaFeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_reset_instance_features_response import ( + BetaFeatureServiceResetInstanceFeaturesResponse as BetaFeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_request import ( + BetaFeatureServiceResetOrganizationFeaturesRequest as BetaFeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_organization_features_response import ( + BetaFeatureServiceResetOrganizationFeaturesResponse as BetaFeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_system_features_response import ( + BetaFeatureServiceResetSystemFeaturesResponse as BetaFeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_reset_user_features_request import ( + BetaFeatureServiceResetUserFeaturesRequest as BetaFeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_reset_user_features_response import ( + BetaFeatureServiceResetUserFeaturesResponse as BetaFeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_instance_features_request import ( + BetaFeatureServiceSetInstanceFeaturesRequest as BetaFeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_instance_features_response import ( + BetaFeatureServiceSetInstanceFeaturesResponse as BetaFeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_organization_features_request import ( + BetaFeatureServiceSetOrganizationFeaturesRequest as BetaFeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_organization_features_response import ( + BetaFeatureServiceSetOrganizationFeaturesResponse as BetaFeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_system_features_request import ( + BetaFeatureServiceSetSystemFeaturesRequest as BetaFeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.beta_feature_service_set_system_features_response import ( + BetaFeatureServiceSetSystemFeaturesResponse as BetaFeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_set_user_feature_request import ( + BetaFeatureServiceSetUserFeatureRequest as BetaFeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.beta_feature_service_set_user_features_response import ( + BetaFeatureServiceSetUserFeaturesResponse as BetaFeatureServiceSetUserFeaturesResponse, +) +from zitadel_client.models.beta_feature_service_source import ( + BetaFeatureServiceSource as BetaFeatureServiceSource, +) +from zitadel_client.models.beta_instance_service_add_custom_domain_request import ( + BetaInstanceServiceAddCustomDomainRequest as BetaInstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_custom_domain_response import ( + BetaInstanceServiceAddCustomDomainResponse as BetaInstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_request import ( + BetaInstanceServiceAddTrustedDomainRequest as BetaInstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_add_trusted_domain_response import ( + BetaInstanceServiceAddTrustedDomainResponse as BetaInstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_any import ( + BetaInstanceServiceAny as BetaInstanceServiceAny, +) +from zitadel_client.models.beta_instance_service_connect_error import ( + BetaInstanceServiceConnectError as BetaInstanceServiceConnectError, +) +from zitadel_client.models.beta_instance_service_delete_instance_request import ( + BetaInstanceServiceDeleteInstanceRequest as BetaInstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.beta_instance_service_delete_instance_response import ( + BetaInstanceServiceDeleteInstanceResponse as BetaInstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.beta_instance_service_domain import ( + BetaInstanceServiceDomain as BetaInstanceServiceDomain, +) +from zitadel_client.models.beta_instance_service_domain_field_name import ( + BetaInstanceServiceDomainFieldName as BetaInstanceServiceDomainFieldName, +) +from zitadel_client.models.beta_instance_service_domain_generated_query import ( + BetaInstanceServiceDomainGeneratedQuery as BetaInstanceServiceDomainGeneratedQuery, +) +from zitadel_client.models.beta_instance_service_domain_primary_query import ( + BetaInstanceServiceDomainPrimaryQuery as BetaInstanceServiceDomainPrimaryQuery, +) +from zitadel_client.models.beta_instance_service_domain_query import ( + BetaInstanceServiceDomainQuery as BetaInstanceServiceDomainQuery, +) +from zitadel_client.models.beta_instance_service_domain_search_query import ( + BetaInstanceServiceDomainSearchQuery as BetaInstanceServiceDomainSearchQuery, +) +from zitadel_client.models.beta_instance_service_domains_query import ( + BetaInstanceServiceDomainsQuery as BetaInstanceServiceDomainsQuery, +) +from zitadel_client.models.beta_instance_service_field_name import ( + BetaInstanceServiceFieldName as BetaInstanceServiceFieldName, +) +from zitadel_client.models.beta_instance_service_get_instance_request import ( + BetaInstanceServiceGetInstanceRequest as BetaInstanceServiceGetInstanceRequest, +) +from zitadel_client.models.beta_instance_service_get_instance_response import ( + BetaInstanceServiceGetInstanceResponse as BetaInstanceServiceGetInstanceResponse, +) +from zitadel_client.models.beta_instance_service_ids_query import ( + BetaInstanceServiceIdsQuery as BetaInstanceServiceIdsQuery, +) +from zitadel_client.models.beta_instance_service_instance import ( + BetaInstanceServiceInstance as BetaInstanceServiceInstance, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_request import ( + BetaInstanceServiceListCustomDomainsRequest as BetaInstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_custom_domains_response import ( + BetaInstanceServiceListCustomDomainsResponse as BetaInstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.beta_instance_service_list_instances_request import ( + BetaInstanceServiceListInstancesRequest as BetaInstanceServiceListInstancesRequest, +) +from zitadel_client.models.beta_instance_service_list_instances_response import ( + BetaInstanceServiceListInstancesResponse as BetaInstanceServiceListInstancesResponse, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_request import ( + BetaInstanceServiceListTrustedDomainsRequest as BetaInstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.beta_instance_service_list_trusted_domains_response import ( + BetaInstanceServiceListTrustedDomainsResponse as BetaInstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.beta_instance_service_pagination_request import ( + BetaInstanceServicePaginationRequest as BetaInstanceServicePaginationRequest, +) +from zitadel_client.models.beta_instance_service_pagination_response import ( + BetaInstanceServicePaginationResponse as BetaInstanceServicePaginationResponse, +) +from zitadel_client.models.beta_instance_service_query import ( + BetaInstanceServiceQuery as BetaInstanceServiceQuery, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_request import ( + BetaInstanceServiceRemoveCustomDomainRequest as BetaInstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_custom_domain_response import ( + BetaInstanceServiceRemoveCustomDomainResponse as BetaInstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_request import ( + BetaInstanceServiceRemoveTrustedDomainRequest as BetaInstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.beta_instance_service_remove_trusted_domain_response import ( + BetaInstanceServiceRemoveTrustedDomainResponse as BetaInstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.beta_instance_service_state import ( + BetaInstanceServiceState as BetaInstanceServiceState, +) +from zitadel_client.models.beta_instance_service_text_query_method import ( + BetaInstanceServiceTextQueryMethod as BetaInstanceServiceTextQueryMethod, +) +from zitadel_client.models.beta_instance_service_trusted_domain import ( + BetaInstanceServiceTrustedDomain as BetaInstanceServiceTrustedDomain, +) +from zitadel_client.models.beta_instance_service_trusted_domain_field_name import ( + BetaInstanceServiceTrustedDomainFieldName as BetaInstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.beta_instance_service_trusted_domain_search_query import ( + BetaInstanceServiceTrustedDomainSearchQuery as BetaInstanceServiceTrustedDomainSearchQuery, +) +from zitadel_client.models.beta_instance_service_update_instance_request import ( + BetaInstanceServiceUpdateInstanceRequest as BetaInstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.beta_instance_service_update_instance_response import ( + BetaInstanceServiceUpdateInstanceResponse as BetaInstanceServiceUpdateInstanceResponse, +) +from zitadel_client.models.beta_internal_permission_service_administrator import ( + BetaInternalPermissionServiceAdministrator as BetaInternalPermissionServiceAdministrator, +) +from zitadel_client.models.beta_internal_permission_service_administrator_field_name import ( + BetaInternalPermissionServiceAdministratorFieldName as BetaInternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter as BetaInternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.beta_internal_permission_service_and_filter import ( + BetaInternalPermissionServiceAndFilter as BetaInternalPermissionServiceAndFilter, +) +from zitadel_client.models.beta_internal_permission_service_any import ( + BetaInternalPermissionServiceAny as BetaInternalPermissionServiceAny, +) +from zitadel_client.models.beta_internal_permission_service_connect_error import ( + BetaInternalPermissionServiceConnectError as BetaInternalPermissionServiceConnectError, +) +from zitadel_client.models.beta_internal_permission_service_create_administrator_request import ( + BetaInternalPermissionServiceCreateAdministratorRequest as BetaInternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_create_administrator_response import ( + BetaInternalPermissionServiceCreateAdministratorResponse as BetaInternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_request import ( + BetaInternalPermissionServiceDeleteAdministratorRequest as BetaInternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_delete_administrator_response import ( + BetaInternalPermissionServiceDeleteAdministratorResponse as BetaInternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_id_filter import ( + BetaInternalPermissionServiceIDFilter as BetaInternalPermissionServiceIDFilter, +) +from zitadel_client.models.beta_internal_permission_service_in_ids_filter import ( + BetaInternalPermissionServiceInIDsFilter as BetaInternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_request import ( + BetaInternalPermissionServiceListAdministratorsRequest as BetaInternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.beta_internal_permission_service_list_administrators_response import ( + BetaInternalPermissionServiceListAdministratorsResponse as BetaInternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.beta_internal_permission_service_not_filter import ( + BetaInternalPermissionServiceNotFilter as BetaInternalPermissionServiceNotFilter, +) +from zitadel_client.models.beta_internal_permission_service_or_filter import ( + BetaInternalPermissionServiceOrFilter as BetaInternalPermissionServiceOrFilter, +) +from zitadel_client.models.beta_internal_permission_service_organization import ( + BetaInternalPermissionServiceOrganization as BetaInternalPermissionServiceOrganization, +) +from zitadel_client.models.beta_internal_permission_service_pagination_request import ( + BetaInternalPermissionServicePaginationRequest as BetaInternalPermissionServicePaginationRequest, +) +from zitadel_client.models.beta_internal_permission_service_pagination_response import ( + BetaInternalPermissionServicePaginationResponse as BetaInternalPermissionServicePaginationResponse, +) +from zitadel_client.models.beta_internal_permission_service_project import ( + BetaInternalPermissionServiceProject as BetaInternalPermissionServiceProject, +) +from zitadel_client.models.beta_internal_permission_service_project_grant import ( + BetaInternalPermissionServiceProjectGrant as BetaInternalPermissionServiceProjectGrant, +) +from zitadel_client.models.beta_internal_permission_service_resource_filter import ( + BetaInternalPermissionServiceResourceFilter as BetaInternalPermissionServiceResourceFilter, +) +from zitadel_client.models.beta_internal_permission_service_resource_type import ( + BetaInternalPermissionServiceResourceType as BetaInternalPermissionServiceResourceType, +) +from zitadel_client.models.beta_internal_permission_service_role_filter import ( + BetaInternalPermissionServiceRoleFilter as BetaInternalPermissionServiceRoleFilter, +) +from zitadel_client.models.beta_internal_permission_service_text_filter_method import ( + BetaInternalPermissionServiceTextFilterMethod as BetaInternalPermissionServiceTextFilterMethod, +) +from zitadel_client.models.beta_internal_permission_service_timestamp_filter import ( + BetaInternalPermissionServiceTimestampFilter as BetaInternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.beta_internal_permission_service_timestamp_filter_method import ( + BetaInternalPermissionServiceTimestampFilterMethod as BetaInternalPermissionServiceTimestampFilterMethod, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_request import ( + BetaInternalPermissionServiceUpdateAdministratorRequest as BetaInternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.beta_internal_permission_service_update_administrator_response import ( + BetaInternalPermissionServiceUpdateAdministratorResponse as BetaInternalPermissionServiceUpdateAdministratorResponse, +) +from zitadel_client.models.beta_internal_permission_service_user import ( + BetaInternalPermissionServiceUser as BetaInternalPermissionServiceUser, +) +from zitadel_client.models.beta_internal_permission_service_user_display_name_filter import ( + BetaInternalPermissionServiceUserDisplayNameFilter as BetaInternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.beta_internal_permission_service_user_preferred_login_name_filter import ( + BetaInternalPermissionServiceUserPreferredLoginNameFilter as BetaInternalPermissionServiceUserPreferredLoginNameFilter, +) +from zitadel_client.models.beta_oidc_service_any import ( + BetaOIDCServiceAny as BetaOIDCServiceAny, +) +from zitadel_client.models.beta_oidc_service_auth_request import ( + BetaOIDCServiceAuthRequest as BetaOIDCServiceAuthRequest, +) +from zitadel_client.models.beta_oidc_service_authorization_error import ( + BetaOIDCServiceAuthorizationError as BetaOIDCServiceAuthorizationError, +) +from zitadel_client.models.beta_oidc_service_connect_error import ( + BetaOIDCServiceConnectError as BetaOIDCServiceConnectError, +) +from zitadel_client.models.beta_oidc_service_create_callback_request import ( + BetaOIDCServiceCreateCallbackRequest as BetaOIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.beta_oidc_service_create_callback_response import ( + BetaOIDCServiceCreateCallbackResponse as BetaOIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.beta_oidc_service_details import ( + BetaOIDCServiceDetails as BetaOIDCServiceDetails, +) +from zitadel_client.models.beta_oidc_service_error_reason import ( + BetaOIDCServiceErrorReason as BetaOIDCServiceErrorReason, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_request import ( + BetaOIDCServiceGetAuthRequestRequest as BetaOIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.beta_oidc_service_get_auth_request_response import ( + BetaOIDCServiceGetAuthRequestResponse as BetaOIDCServiceGetAuthRequestResponse, +) +from zitadel_client.models.beta_oidc_service_prompt import ( + BetaOIDCServicePrompt as BetaOIDCServicePrompt, +) +from zitadel_client.models.beta_oidc_service_session import ( + BetaOIDCServiceSession as BetaOIDCServiceSession, +) +from zitadel_client.models.beta_organization_service_activate_organization_request import ( + BetaOrganizationServiceActivateOrganizationRequest as BetaOrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_activate_organization_response import ( + BetaOrganizationServiceActivateOrganizationResponse as BetaOrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_add_human_user_request import ( + BetaOrganizationServiceAddHumanUserRequest as BetaOrganizationServiceAddHumanUserRequest, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_request import ( + BetaOrganizationServiceAddOrganizationDomainRequest as BetaOrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_add_organization_domain_response import ( + BetaOrganizationServiceAddOrganizationDomainResponse as BetaOrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_admin import ( + BetaOrganizationServiceAdmin as BetaOrganizationServiceAdmin, +) +from zitadel_client.models.beta_organization_service_any import ( + BetaOrganizationServiceAny as BetaOrganizationServiceAny, +) +from zitadel_client.models.beta_organization_service_assigned_admin import ( + BetaOrganizationServiceAssignedAdmin as BetaOrganizationServiceAssignedAdmin, +) +from zitadel_client.models.beta_organization_service_connect_error import ( + BetaOrganizationServiceConnectError as BetaOrganizationServiceConnectError, +) +from zitadel_client.models.beta_organization_service_create_organization_request import ( + BetaOrganizationServiceCreateOrganizationRequest as BetaOrganizationServiceCreateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_create_organization_response import ( + BetaOrganizationServiceCreateOrganizationResponse as BetaOrganizationServiceCreateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_created_admin import ( + BetaOrganizationServiceCreatedAdmin as BetaOrganizationServiceCreatedAdmin, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_request import ( + BetaOrganizationServiceDeactivateOrganizationRequest as BetaOrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_deactivate_organization_response import ( + BetaOrganizationServiceDeactivateOrganizationResponse as BetaOrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_request import ( + BetaOrganizationServiceDeleteOrganizationDomainRequest as BetaOrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_domain_response import ( + BetaOrganizationServiceDeleteOrganizationDomainResponse as BetaOrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_request import ( + BetaOrganizationServiceDeleteOrganizationMetadataRequest as BetaOrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_metadata_response import ( + BetaOrganizationServiceDeleteOrganizationMetadataResponse as BetaOrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_delete_organization_request import ( + BetaOrganizationServiceDeleteOrganizationRequest as BetaOrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_delete_organization_response import ( + BetaOrganizationServiceDeleteOrganizationResponse as BetaOrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_domain import ( + BetaOrganizationServiceDomain as BetaOrganizationServiceDomain, +) +from zitadel_client.models.beta_organization_service_domain_name_filter import ( + BetaOrganizationServiceDomainNameFilter as BetaOrganizationServiceDomainNameFilter, +) +from zitadel_client.models.beta_organization_service_domain_search_filter import ( + BetaOrganizationServiceDomainSearchFilter as BetaOrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.beta_organization_service_domain_validation_type import ( + BetaOrganizationServiceDomainValidationType as BetaOrganizationServiceDomainValidationType, +) +from zitadel_client.models.beta_organization_service_gender import ( + BetaOrganizationServiceGender as BetaOrganizationServiceGender, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_request import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationRequest as BetaOrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.beta_organization_service_generate_organization_domain_validation_response import ( + BetaOrganizationServiceGenerateOrganizationDomainValidationResponse as BetaOrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.beta_organization_service_hashed_password import ( + BetaOrganizationServiceHashedPassword as BetaOrganizationServiceHashedPassword, +) +from zitadel_client.models.beta_organization_service_idp_link import ( + BetaOrganizationServiceIDPLink as BetaOrganizationServiceIDPLink, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_request import ( + BetaOrganizationServiceListOrganizationDomainsRequest as BetaOrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_domains_response import ( + BetaOrganizationServiceListOrganizationDomainsResponse as BetaOrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_request import ( + BetaOrganizationServiceListOrganizationMetadataRequest as BetaOrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_list_organization_metadata_response import ( + BetaOrganizationServiceListOrganizationMetadataResponse as BetaOrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_list_organizations_request import ( + BetaOrganizationServiceListOrganizationsRequest as BetaOrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.beta_organization_service_list_organizations_response import ( + BetaOrganizationServiceListOrganizationsResponse as BetaOrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.beta_organization_service_metadata import ( + BetaOrganizationServiceMetadata as BetaOrganizationServiceMetadata, +) +from zitadel_client.models.beta_organization_service_metadata_key_query import ( + BetaOrganizationServiceMetadataKeyQuery as BetaOrganizationServiceMetadataKeyQuery, +) +from zitadel_client.models.beta_organization_service_metadata_query import ( + BetaOrganizationServiceMetadataQuery as BetaOrganizationServiceMetadataQuery, +) +from zitadel_client.models.beta_organization_service_org_domain_filter import ( + BetaOrganizationServiceOrgDomainFilter as BetaOrganizationServiceOrgDomainFilter, +) +from zitadel_client.models.beta_organization_service_org_field_name import ( + BetaOrganizationServiceOrgFieldName as BetaOrganizationServiceOrgFieldName, +) +from zitadel_client.models.beta_organization_service_org_id_filter import ( + BetaOrganizationServiceOrgIDFilter as BetaOrganizationServiceOrgIDFilter, +) +from zitadel_client.models.beta_organization_service_org_name_filter import ( + BetaOrganizationServiceOrgNameFilter as BetaOrganizationServiceOrgNameFilter, +) +from zitadel_client.models.beta_organization_service_org_state import ( + BetaOrganizationServiceOrgState as BetaOrganizationServiceOrgState, +) +from zitadel_client.models.beta_organization_service_org_state_filter import ( + BetaOrganizationServiceOrgStateFilter as BetaOrganizationServiceOrgStateFilter, +) +from zitadel_client.models.beta_organization_service_organization import ( + BetaOrganizationServiceOrganization as BetaOrganizationServiceOrganization, +) +from zitadel_client.models.beta_organization_service_organization_admin import ( + BetaOrganizationServiceOrganizationAdmin as BetaOrganizationServiceOrganizationAdmin, +) +from zitadel_client.models.beta_organization_service_organization_search_filter import ( + BetaOrganizationServiceOrganizationSearchFilter as BetaOrganizationServiceOrganizationSearchFilter, +) +from zitadel_client.models.beta_organization_service_pagination_request import ( + BetaOrganizationServicePaginationRequest as BetaOrganizationServicePaginationRequest, +) +from zitadel_client.models.beta_organization_service_pagination_response import ( + BetaOrganizationServicePaginationResponse as BetaOrganizationServicePaginationResponse, +) +from zitadel_client.models.beta_organization_service_password import ( + BetaOrganizationServicePassword as BetaOrganizationServicePassword, +) +from zitadel_client.models.beta_organization_service_send_email_verification_code import ( + BetaOrganizationServiceSendEmailVerificationCode as BetaOrganizationServiceSendEmailVerificationCode, +) +from zitadel_client.models.beta_organization_service_set_human_email import ( + BetaOrganizationServiceSetHumanEmail as BetaOrganizationServiceSetHumanEmail, +) +from zitadel_client.models.beta_organization_service_set_human_phone import ( + BetaOrganizationServiceSetHumanPhone as BetaOrganizationServiceSetHumanPhone, +) +from zitadel_client.models.beta_organization_service_set_human_profile import ( + BetaOrganizationServiceSetHumanProfile as BetaOrganizationServiceSetHumanProfile, +) +from zitadel_client.models.beta_organization_service_set_metadata_entry import ( + BetaOrganizationServiceSetMetadataEntry as BetaOrganizationServiceSetMetadataEntry, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_request import ( + BetaOrganizationServiceSetOrganizationMetadataRequest as BetaOrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.beta_organization_service_set_organization_metadata_response import ( + BetaOrganizationServiceSetOrganizationMetadataResponse as BetaOrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod as BetaOrganizationServiceTextQueryMethod, +) +from zitadel_client.models.beta_organization_service_update_organization_request import ( + BetaOrganizationServiceUpdateOrganizationRequest as BetaOrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.beta_organization_service_update_organization_response import ( + BetaOrganizationServiceUpdateOrganizationResponse as BetaOrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_request import ( + BetaOrganizationServiceVerifyOrganizationDomainRequest as BetaOrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.beta_organization_service_verify_organization_domain_response import ( + BetaOrganizationServiceVerifyOrganizationDomainResponse as BetaOrganizationServiceVerifyOrganizationDomainResponse, +) +from zitadel_client.models.beta_project_service_activate_project_grant_request import ( + BetaProjectServiceActivateProjectGrantRequest as BetaProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_activate_project_grant_response import ( + BetaProjectServiceActivateProjectGrantResponse as BetaProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_activate_project_request import ( + BetaProjectServiceActivateProjectRequest as BetaProjectServiceActivateProjectRequest, +) +from zitadel_client.models.beta_project_service_activate_project_response import ( + BetaProjectServiceActivateProjectResponse as BetaProjectServiceActivateProjectResponse, +) +from zitadel_client.models.beta_project_service_add_project_role_request import ( + BetaProjectServiceAddProjectRoleRequest as BetaProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_add_project_role_response import ( + BetaProjectServiceAddProjectRoleResponse as BetaProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_admin import ( + BetaProjectServiceAdmin as BetaProjectServiceAdmin, +) +from zitadel_client.models.beta_project_service_any import ( + BetaProjectServiceAny as BetaProjectServiceAny, +) +from zitadel_client.models.beta_project_service_connect_error import ( + BetaProjectServiceConnectError as BetaProjectServiceConnectError, +) +from zitadel_client.models.beta_project_service_create_project_grant_request import ( + BetaProjectServiceCreateProjectGrantRequest as BetaProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_create_project_grant_response import ( + BetaProjectServiceCreateProjectGrantResponse as BetaProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_create_project_request import ( + BetaProjectServiceCreateProjectRequest as BetaProjectServiceCreateProjectRequest, +) +from zitadel_client.models.beta_project_service_create_project_response import ( + BetaProjectServiceCreateProjectResponse as BetaProjectServiceCreateProjectResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_request import ( + BetaProjectServiceDeactivateProjectGrantRequest as BetaProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_grant_response import ( + BetaProjectServiceDeactivateProjectGrantResponse as BetaProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_deactivate_project_request import ( + BetaProjectServiceDeactivateProjectRequest as BetaProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.beta_project_service_deactivate_project_response import ( + BetaProjectServiceDeactivateProjectResponse as BetaProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.beta_project_service_delete_project_grant_request import ( + BetaProjectServiceDeleteProjectGrantRequest as BetaProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_delete_project_grant_response import ( + BetaProjectServiceDeleteProjectGrantResponse as BetaProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_delete_project_request import ( + BetaProjectServiceDeleteProjectRequest as BetaProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.beta_project_service_delete_project_response import ( + BetaProjectServiceDeleteProjectResponse as BetaProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.beta_project_service_get_project_request import ( + BetaProjectServiceGetProjectRequest as BetaProjectServiceGetProjectRequest, +) +from zitadel_client.models.beta_project_service_get_project_response import ( + BetaProjectServiceGetProjectResponse as BetaProjectServiceGetProjectResponse, +) +from zitadel_client.models.beta_project_service_granted_project_state import ( + BetaProjectServiceGrantedProjectState as BetaProjectServiceGrantedProjectState, +) +from zitadel_client.models.beta_project_service_id_filter import ( + BetaProjectServiceIDFilter as BetaProjectServiceIDFilter, +) +from zitadel_client.models.beta_project_service_in_ids_filter import ( + BetaProjectServiceInIDsFilter as BetaProjectServiceInIDsFilter, +) +from zitadel_client.models.beta_project_service_list_project_grants_request import ( + BetaProjectServiceListProjectGrantsRequest as BetaProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.beta_project_service_list_project_grants_response import ( + BetaProjectServiceListProjectGrantsResponse as BetaProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.beta_project_service_list_project_roles_request import ( + BetaProjectServiceListProjectRolesRequest as BetaProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.beta_project_service_list_project_roles_response import ( + BetaProjectServiceListProjectRolesResponse as BetaProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.beta_project_service_list_projects_request import ( + BetaProjectServiceListProjectsRequest as BetaProjectServiceListProjectsRequest, +) +from zitadel_client.models.beta_project_service_list_projects_response import ( + BetaProjectServiceListProjectsResponse as BetaProjectServiceListProjectsResponse, +) +from zitadel_client.models.beta_project_service_pagination_request import ( + BetaProjectServicePaginationRequest as BetaProjectServicePaginationRequest, +) +from zitadel_client.models.beta_project_service_pagination_response import ( + BetaProjectServicePaginationResponse as BetaProjectServicePaginationResponse, +) +from zitadel_client.models.beta_project_service_private_labeling_setting import ( + BetaProjectServicePrivateLabelingSetting as BetaProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.beta_project_service_project import ( + BetaProjectServiceProject as BetaProjectServiceProject, +) +from zitadel_client.models.beta_project_service_project_field_name import ( + BetaProjectServiceProjectFieldName as BetaProjectServiceProjectFieldName, +) +from zitadel_client.models.beta_project_service_project_grant import ( + BetaProjectServiceProjectGrant as BetaProjectServiceProjectGrant, +) +from zitadel_client.models.beta_project_service_project_grant_field_name import ( + BetaProjectServiceProjectGrantFieldName as BetaProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.beta_project_service_project_grant_search_filter import ( + BetaProjectServiceProjectGrantSearchFilter as BetaProjectServiceProjectGrantSearchFilter, +) +from zitadel_client.models.beta_project_service_project_grant_state import ( + BetaProjectServiceProjectGrantState as BetaProjectServiceProjectGrantState, +) +from zitadel_client.models.beta_project_service_project_name_filter import ( + BetaProjectServiceProjectNameFilter as BetaProjectServiceProjectNameFilter, +) +from zitadel_client.models.beta_project_service_project_role import ( + BetaProjectServiceProjectRole as BetaProjectServiceProjectRole, +) +from zitadel_client.models.beta_project_service_project_role_display_name_filter import ( + BetaProjectServiceProjectRoleDisplayNameFilter as BetaProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.beta_project_service_project_role_field_name import ( + BetaProjectServiceProjectRoleFieldName as BetaProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.beta_project_service_project_role_key_filter import ( + BetaProjectServiceProjectRoleKeyFilter as BetaProjectServiceProjectRoleKeyFilter, +) +from zitadel_client.models.beta_project_service_project_role_search_filter import ( + BetaProjectServiceProjectRoleSearchFilter as BetaProjectServiceProjectRoleSearchFilter, +) +from zitadel_client.models.beta_project_service_project_search_filter import ( + BetaProjectServiceProjectSearchFilter as BetaProjectServiceProjectSearchFilter, +) +from zitadel_client.models.beta_project_service_project_state import ( + BetaProjectServiceProjectState as BetaProjectServiceProjectState, +) +from zitadel_client.models.beta_project_service_remove_project_role_request import ( + BetaProjectServiceRemoveProjectRoleRequest as BetaProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_remove_project_role_response import ( + BetaProjectServiceRemoveProjectRoleResponse as BetaProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.beta_project_service_text_filter_method import ( + BetaProjectServiceTextFilterMethod as BetaProjectServiceTextFilterMethod, +) +from zitadel_client.models.beta_project_service_update_project_grant_request import ( + BetaProjectServiceUpdateProjectGrantRequest as BetaProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.beta_project_service_update_project_grant_response import ( + BetaProjectServiceUpdateProjectGrantResponse as BetaProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.beta_project_service_update_project_request import ( + BetaProjectServiceUpdateProjectRequest as BetaProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.beta_project_service_update_project_response import ( + BetaProjectServiceUpdateProjectResponse as BetaProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.beta_project_service_update_project_role_request import ( + BetaProjectServiceUpdateProjectRoleRequest as BetaProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.beta_project_service_update_project_role_response import ( + BetaProjectServiceUpdateProjectRoleResponse as BetaProjectServiceUpdateProjectRoleResponse, +) +from zitadel_client.models.beta_session_service_any import ( + BetaSessionServiceAny as BetaSessionServiceAny, +) +from zitadel_client.models.beta_session_service_challenges import ( + BetaSessionServiceChallenges as BetaSessionServiceChallenges, +) +from zitadel_client.models.beta_session_service_check_idp_intent import ( + BetaSessionServiceCheckIDPIntent as BetaSessionServiceCheckIDPIntent, +) +from zitadel_client.models.beta_session_service_check_otp import ( + BetaSessionServiceCheckOTP as BetaSessionServiceCheckOTP, +) +from zitadel_client.models.beta_session_service_check_password import ( + BetaSessionServiceCheckPassword as BetaSessionServiceCheckPassword, +) +from zitadel_client.models.beta_session_service_check_totp import ( + BetaSessionServiceCheckTOTP as BetaSessionServiceCheckTOTP, +) +from zitadel_client.models.beta_session_service_check_user import ( + BetaSessionServiceCheckUser as BetaSessionServiceCheckUser, +) +from zitadel_client.models.beta_session_service_check_web_auth_n import ( + BetaSessionServiceCheckWebAuthN as BetaSessionServiceCheckWebAuthN, +) +from zitadel_client.models.beta_session_service_checks import ( + BetaSessionServiceChecks as BetaSessionServiceChecks, +) +from zitadel_client.models.beta_session_service_connect_error import ( + BetaSessionServiceConnectError as BetaSessionServiceConnectError, +) +from zitadel_client.models.beta_session_service_create_session_request import ( + BetaSessionServiceCreateSessionRequest as BetaSessionServiceCreateSessionRequest, +) +from zitadel_client.models.beta_session_service_create_session_response import ( + BetaSessionServiceCreateSessionResponse as BetaSessionServiceCreateSessionResponse, +) +from zitadel_client.models.beta_session_service_creation_date_query import ( + BetaSessionServiceCreationDateQuery as BetaSessionServiceCreationDateQuery, +) +from zitadel_client.models.beta_session_service_delete_session_request import ( + BetaSessionServiceDeleteSessionRequest as BetaSessionServiceDeleteSessionRequest, +) +from zitadel_client.models.beta_session_service_delete_session_response import ( + BetaSessionServiceDeleteSessionResponse as BetaSessionServiceDeleteSessionResponse, +) +from zitadel_client.models.beta_session_service_details import ( + BetaSessionServiceDetails as BetaSessionServiceDetails, +) +from zitadel_client.models.beta_session_service_factors import ( + BetaSessionServiceFactors as BetaSessionServiceFactors, +) +from zitadel_client.models.beta_session_service_get_session_request import ( + BetaSessionServiceGetSessionRequest as BetaSessionServiceGetSessionRequest, +) +from zitadel_client.models.beta_session_service_get_session_response import ( + BetaSessionServiceGetSessionResponse as BetaSessionServiceGetSessionResponse, +) +from zitadel_client.models.beta_session_service_header_values import ( + BetaSessionServiceHeaderValues as BetaSessionServiceHeaderValues, +) +from zitadel_client.models.beta_session_service_ids_query import ( + BetaSessionServiceIDsQuery as BetaSessionServiceIDsQuery, +) +from zitadel_client.models.beta_session_service_intent_factor import ( + BetaSessionServiceIntentFactor as BetaSessionServiceIntentFactor, +) +from zitadel_client.models.beta_session_service_list_details import ( + BetaSessionServiceListDetails as BetaSessionServiceListDetails, +) +from zitadel_client.models.beta_session_service_list_query import ( + BetaSessionServiceListQuery as BetaSessionServiceListQuery, +) +from zitadel_client.models.beta_session_service_list_sessions_request import ( + BetaSessionServiceListSessionsRequest as BetaSessionServiceListSessionsRequest, +) +from zitadel_client.models.beta_session_service_list_sessions_response import ( + BetaSessionServiceListSessionsResponse as BetaSessionServiceListSessionsResponse, +) +from zitadel_client.models.beta_session_service_otp_email import ( + BetaSessionServiceOTPEmail as BetaSessionServiceOTPEmail, +) +from zitadel_client.models.beta_session_service_otp_factor import ( + BetaSessionServiceOTPFactor as BetaSessionServiceOTPFactor, +) +from zitadel_client.models.beta_session_service_otpsms import ( + BetaSessionServiceOTPSMS as BetaSessionServiceOTPSMS, +) +from zitadel_client.models.beta_session_service_password_factor import ( + BetaSessionServicePasswordFactor as BetaSessionServicePasswordFactor, +) +from zitadel_client.models.beta_session_service_request_challenges import ( + BetaSessionServiceRequestChallenges as BetaSessionServiceRequestChallenges, +) +from zitadel_client.models.beta_session_service_search_query import ( + BetaSessionServiceSearchQuery as BetaSessionServiceSearchQuery, +) +from zitadel_client.models.beta_session_service_send_code import ( + BetaSessionServiceSendCode as BetaSessionServiceSendCode, +) +from zitadel_client.models.beta_session_service_session import ( + BetaSessionServiceSession as BetaSessionServiceSession, +) +from zitadel_client.models.beta_session_service_session_field_name import ( + BetaSessionServiceSessionFieldName as BetaSessionServiceSessionFieldName, +) +from zitadel_client.models.beta_session_service_set_session_request import ( + BetaSessionServiceSetSessionRequest as BetaSessionServiceSetSessionRequest, +) +from zitadel_client.models.beta_session_service_set_session_response import ( + BetaSessionServiceSetSessionResponse as BetaSessionServiceSetSessionResponse, +) +from zitadel_client.models.beta_session_service_totp_factor import ( + BetaSessionServiceTOTPFactor as BetaSessionServiceTOTPFactor, +) +from zitadel_client.models.beta_session_service_timestamp_query_method import ( + BetaSessionServiceTimestampQueryMethod as BetaSessionServiceTimestampQueryMethod, +) +from zitadel_client.models.beta_session_service_user_agent import ( + BetaSessionServiceUserAgent as BetaSessionServiceUserAgent, +) +from zitadel_client.models.beta_session_service_user_factor import ( + BetaSessionServiceUserFactor as BetaSessionServiceUserFactor, +) +from zitadel_client.models.beta_session_service_user_id_query import ( + BetaSessionServiceUserIDQuery as BetaSessionServiceUserIDQuery, +) +from zitadel_client.models.beta_session_service_user_verification_requirement import ( + BetaSessionServiceUserVerificationRequirement as BetaSessionServiceUserVerificationRequirement, +) +from zitadel_client.models.beta_session_service_web_auth_n import ( + BetaSessionServiceWebAuthN as BetaSessionServiceWebAuthN, +) +from zitadel_client.models.beta_session_service_web_auth_n_factor import ( + BetaSessionServiceWebAuthNFactor as BetaSessionServiceWebAuthNFactor, +) +from zitadel_client.models.beta_settings_service_any import ( + BetaSettingsServiceAny as BetaSettingsServiceAny, +) +from zitadel_client.models.beta_settings_service_branding_settings import ( + BetaSettingsServiceBrandingSettings as BetaSettingsServiceBrandingSettings, +) +from zitadel_client.models.beta_settings_service_connect_error import ( + BetaSettingsServiceConnectError as BetaSettingsServiceConnectError, +) +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails as BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_domain_settings import ( + BetaSettingsServiceDomainSettings as BetaSettingsServiceDomainSettings, +) +from zitadel_client.models.beta_settings_service_embedded_iframe_settings import ( + BetaSettingsServiceEmbeddedIframeSettings as BetaSettingsServiceEmbeddedIframeSettings, +) +from zitadel_client.models.beta_settings_service_get_active_identity_providers_request import ( + BetaSettingsServiceGetActiveIdentityProvidersRequest as BetaSettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.beta_settings_service_get_active_identity_providers_response import ( + BetaSettingsServiceGetActiveIdentityProvidersResponse as BetaSettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_request import ( + BetaSettingsServiceGetBrandingSettingsRequest as BetaSettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_branding_settings_response import ( + BetaSettingsServiceGetBrandingSettingsResponse as BetaSettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_request import ( + BetaSettingsServiceGetDomainSettingsRequest as BetaSettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_domain_settings_response import ( + BetaSettingsServiceGetDomainSettingsResponse as BetaSettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_general_settings_response import ( + BetaSettingsServiceGetGeneralSettingsResponse as BetaSettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_request import ( + BetaSettingsServiceGetLegalAndSupportSettingsRequest as BetaSettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_legal_and_support_settings_response import ( + BetaSettingsServiceGetLegalAndSupportSettingsResponse as BetaSettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_request import ( + BetaSettingsServiceGetLockoutSettingsRequest as BetaSettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_lockout_settings_response import ( + BetaSettingsServiceGetLockoutSettingsResponse as BetaSettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_login_settings_request import ( + BetaSettingsServiceGetLoginSettingsRequest as BetaSettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_login_settings_response import ( + BetaSettingsServiceGetLoginSettingsResponse as BetaSettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_request import ( + BetaSettingsServiceGetPasswordComplexitySettingsRequest as BetaSettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_complexity_settings_response import ( + BetaSettingsServiceGetPasswordComplexitySettingsResponse as BetaSettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_request import ( + BetaSettingsServiceGetPasswordExpirySettingsRequest as BetaSettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.beta_settings_service_get_password_expiry_settings_response import ( + BetaSettingsServiceGetPasswordExpirySettingsResponse as BetaSettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.beta_settings_service_get_security_settings_response import ( + BetaSettingsServiceGetSecuritySettingsResponse as BetaSettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.beta_settings_service_identity_provider import ( + BetaSettingsServiceIdentityProvider as BetaSettingsServiceIdentityProvider, +) +from zitadel_client.models.beta_settings_service_identity_provider_type import ( + BetaSettingsServiceIdentityProviderType as BetaSettingsServiceIdentityProviderType, +) +from zitadel_client.models.beta_settings_service_legal_and_support_settings import ( + BetaSettingsServiceLegalAndSupportSettings as BetaSettingsServiceLegalAndSupportSettings, +) +from zitadel_client.models.beta_settings_service_list_details import ( + BetaSettingsServiceListDetails as BetaSettingsServiceListDetails, +) +from zitadel_client.models.beta_settings_service_lockout_settings import ( + BetaSettingsServiceLockoutSettings as BetaSettingsServiceLockoutSettings, +) +from zitadel_client.models.beta_settings_service_login_settings import ( + BetaSettingsServiceLoginSettings as BetaSettingsServiceLoginSettings, +) +from zitadel_client.models.beta_settings_service_multi_factor_type import ( + BetaSettingsServiceMultiFactorType as BetaSettingsServiceMultiFactorType, +) +from zitadel_client.models.beta_settings_service_passkeys_type import ( + BetaSettingsServicePasskeysType as BetaSettingsServicePasskeysType, +) +from zitadel_client.models.beta_settings_service_password_complexity_settings import ( + BetaSettingsServicePasswordComplexitySettings as BetaSettingsServicePasswordComplexitySettings, +) +from zitadel_client.models.beta_settings_service_password_expiry_settings import ( + BetaSettingsServicePasswordExpirySettings as BetaSettingsServicePasswordExpirySettings, +) +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext as BetaSettingsServiceRequestContext, +) +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType as BetaSettingsServiceResourceOwnerType, +) +from zitadel_client.models.beta_settings_service_second_factor_type import ( + BetaSettingsServiceSecondFactorType as BetaSettingsServiceSecondFactorType, +) +from zitadel_client.models.beta_settings_service_security_settings import ( + BetaSettingsServiceSecuritySettings as BetaSettingsServiceSecuritySettings, +) +from zitadel_client.models.beta_settings_service_set_security_settings_request import ( + BetaSettingsServiceSetSecuritySettingsRequest as BetaSettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.beta_settings_service_set_security_settings_response import ( + BetaSettingsServiceSetSecuritySettingsResponse as BetaSettingsServiceSetSecuritySettingsResponse, +) +from zitadel_client.models.beta_settings_service_theme import ( + BetaSettingsServiceTheme as BetaSettingsServiceTheme, +) +from zitadel_client.models.beta_settings_service_theme_mode import ( + BetaSettingsServiceThemeMode as BetaSettingsServiceThemeMode, +) +from zitadel_client.models.beta_telemetry_service_any import ( + BetaTelemetryServiceAny as BetaTelemetryServiceAny, +) +from zitadel_client.models.beta_telemetry_service_connect_error import ( + BetaTelemetryServiceConnectError as BetaTelemetryServiceConnectError, +) +from zitadel_client.models.beta_telemetry_service_count_parent_type import ( + BetaTelemetryServiceCountParentType as BetaTelemetryServiceCountParentType, +) +from zitadel_client.models.beta_telemetry_service_instance_information import ( + BetaTelemetryServiceInstanceInformation as BetaTelemetryServiceInstanceInformation, +) +from zitadel_client.models.beta_telemetry_service_report_base_information_request import ( + BetaTelemetryServiceReportBaseInformationRequest as BetaTelemetryServiceReportBaseInformationRequest, +) +from zitadel_client.models.beta_telemetry_service_report_base_information_response import ( + BetaTelemetryServiceReportBaseInformationResponse as BetaTelemetryServiceReportBaseInformationResponse, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_request import ( + BetaTelemetryServiceReportResourceCountsRequest as BetaTelemetryServiceReportResourceCountsRequest, +) +from zitadel_client.models.beta_telemetry_service_report_resource_counts_response import ( + BetaTelemetryServiceReportResourceCountsResponse as BetaTelemetryServiceReportResourceCountsResponse, +) +from zitadel_client.models.beta_telemetry_service_resource_count import ( + BetaTelemetryServiceResourceCount as BetaTelemetryServiceResourceCount, +) +from zitadel_client.models.beta_user_service_access_token_type import ( + BetaUserServiceAccessTokenType as BetaUserServiceAccessTokenType, +) +from zitadel_client.models.beta_user_service_add_human_user_request import ( + BetaUserServiceAddHumanUserRequest as BetaUserServiceAddHumanUserRequest, +) +from zitadel_client.models.beta_user_service_add_human_user_response import ( + BetaUserServiceAddHumanUserResponse as BetaUserServiceAddHumanUserResponse, +) +from zitadel_client.models.beta_user_service_add_idp_link_request import ( + BetaUserServiceAddIDPLinkRequest as BetaUserServiceAddIDPLinkRequest, +) +from zitadel_client.models.beta_user_service_add_idp_link_response import ( + BetaUserServiceAddIDPLinkResponse as BetaUserServiceAddIDPLinkResponse, +) +from zitadel_client.models.beta_user_service_add_otp_email_request import ( + BetaUserServiceAddOTPEmailRequest as BetaUserServiceAddOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_add_otp_email_response import ( + BetaUserServiceAddOTPEmailResponse as BetaUserServiceAddOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_add_otpsms_request import ( + BetaUserServiceAddOTPSMSRequest as BetaUserServiceAddOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_add_otpsms_response import ( + BetaUserServiceAddOTPSMSResponse as BetaUserServiceAddOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_and_query import ( + BetaUserServiceAndQuery as BetaUserServiceAndQuery, +) +from zitadel_client.models.beta_user_service_any import ( + BetaUserServiceAny as BetaUserServiceAny, +) +from zitadel_client.models.beta_user_service_authentication_method_type import ( + BetaUserServiceAuthenticationMethodType as BetaUserServiceAuthenticationMethodType, +) +from zitadel_client.models.beta_user_service_connect_error import ( + BetaUserServiceConnectError as BetaUserServiceConnectError, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_request import ( + BetaUserServiceCreatePasskeyRegistrationLinkRequest as BetaUserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.beta_user_service_create_passkey_registration_link_response import ( + BetaUserServiceCreatePasskeyRegistrationLinkResponse as BetaUserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.beta_user_service_deactivate_user_request import ( + BetaUserServiceDeactivateUserRequest as BetaUserServiceDeactivateUserRequest, +) +from zitadel_client.models.beta_user_service_deactivate_user_response import ( + BetaUserServiceDeactivateUserResponse as BetaUserServiceDeactivateUserResponse, +) +from zitadel_client.models.beta_user_service_delete_user_request import ( + BetaUserServiceDeleteUserRequest as BetaUserServiceDeleteUserRequest, +) +from zitadel_client.models.beta_user_service_delete_user_response import ( + BetaUserServiceDeleteUserResponse as BetaUserServiceDeleteUserResponse, +) +from zitadel_client.models.beta_user_service_details import ( + BetaUserServiceDetails as BetaUserServiceDetails, +) +from zitadel_client.models.beta_user_service_display_name_query import ( + BetaUserServiceDisplayNameQuery as BetaUserServiceDisplayNameQuery, +) +from zitadel_client.models.beta_user_service_email_query import ( + BetaUserServiceEmailQuery as BetaUserServiceEmailQuery, +) +from zitadel_client.models.beta_user_service_first_name_query import ( + BetaUserServiceFirstNameQuery as BetaUserServiceFirstNameQuery, +) +from zitadel_client.models.beta_user_service_form_data import ( + BetaUserServiceFormData as BetaUserServiceFormData, +) +from zitadel_client.models.beta_user_service_gender import ( + BetaUserServiceGender as BetaUserServiceGender, +) +from zitadel_client.models.beta_user_service_get_user_by_id_request import ( + BetaUserServiceGetUserByIDRequest as BetaUserServiceGetUserByIDRequest, +) +from zitadel_client.models.beta_user_service_get_user_by_id_response import ( + BetaUserServiceGetUserByIDResponse as BetaUserServiceGetUserByIDResponse, +) +from zitadel_client.models.beta_user_service_hashed_password import ( + BetaUserServiceHashedPassword as BetaUserServiceHashedPassword, +) +from zitadel_client.models.beta_user_service_human_email import ( + BetaUserServiceHumanEmail as BetaUserServiceHumanEmail, +) +from zitadel_client.models.beta_user_service_human_phone import ( + BetaUserServiceHumanPhone as BetaUserServiceHumanPhone, +) +from zitadel_client.models.beta_user_service_human_profile import ( + BetaUserServiceHumanProfile as BetaUserServiceHumanProfile, +) +from zitadel_client.models.beta_user_service_human_user import ( + BetaUserServiceHumanUser as BetaUserServiceHumanUser, +) +from zitadel_client.models.beta_user_service_idp_information import ( + BetaUserServiceIDPInformation as BetaUserServiceIDPInformation, +) +from zitadel_client.models.beta_user_service_idp_intent import ( + BetaUserServiceIDPIntent as BetaUserServiceIDPIntent, +) +from zitadel_client.models.beta_user_service_idpldap_access_information import ( + BetaUserServiceIDPLDAPAccessInformation as BetaUserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.beta_user_service_idp_link import ( + BetaUserServiceIDPLink as BetaUserServiceIDPLink, +) +from zitadel_client.models.beta_user_service_idpo_auth_access_information import ( + BetaUserServiceIDPOAuthAccessInformation as BetaUserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.beta_user_service_idpsaml_access_information import ( + BetaUserServiceIDPSAMLAccessInformation as BetaUserServiceIDPSAMLAccessInformation, +) +from zitadel_client.models.beta_user_service_in_user_emails_query import ( + BetaUserServiceInUserEmailsQuery as BetaUserServiceInUserEmailsQuery, +) +from zitadel_client.models.beta_user_service_in_user_id_query import ( + BetaUserServiceInUserIDQuery as BetaUserServiceInUserIDQuery, +) +from zitadel_client.models.beta_user_service_ldap_credentials import ( + BetaUserServiceLDAPCredentials as BetaUserServiceLDAPCredentials, +) +from zitadel_client.models.beta_user_service_last_name_query import ( + BetaUserServiceLastNameQuery as BetaUserServiceLastNameQuery, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_request import ( + BetaUserServiceListAuthenticationMethodTypesRequest as BetaUserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.beta_user_service_list_authentication_method_types_response import ( + BetaUserServiceListAuthenticationMethodTypesResponse as BetaUserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.beta_user_service_list_details import ( + BetaUserServiceListDetails as BetaUserServiceListDetails, +) +from zitadel_client.models.beta_user_service_list_query import ( + BetaUserServiceListQuery as BetaUserServiceListQuery, +) +from zitadel_client.models.beta_user_service_list_users_request import ( + BetaUserServiceListUsersRequest as BetaUserServiceListUsersRequest, +) +from zitadel_client.models.beta_user_service_list_users_response import ( + BetaUserServiceListUsersResponse as BetaUserServiceListUsersResponse, +) +from zitadel_client.models.beta_user_service_lock_user_request import ( + BetaUserServiceLockUserRequest as BetaUserServiceLockUserRequest, +) +from zitadel_client.models.beta_user_service_lock_user_response import ( + BetaUserServiceLockUserResponse as BetaUserServiceLockUserResponse, +) +from zitadel_client.models.beta_user_service_login_name_query import ( + BetaUserServiceLoginNameQuery as BetaUserServiceLoginNameQuery, +) +from zitadel_client.models.beta_user_service_machine_user import ( + BetaUserServiceMachineUser as BetaUserServiceMachineUser, +) +from zitadel_client.models.beta_user_service_nick_name_query import ( + BetaUserServiceNickNameQuery as BetaUserServiceNickNameQuery, +) +from zitadel_client.models.beta_user_service_not_query import ( + BetaUserServiceNotQuery as BetaUserServiceNotQuery, +) +from zitadel_client.models.beta_user_service_notification_type import ( + BetaUserServiceNotificationType as BetaUserServiceNotificationType, +) +from zitadel_client.models.beta_user_service_or_query import ( + BetaUserServiceOrQuery as BetaUserServiceOrQuery, +) +from zitadel_client.models.beta_user_service_organization import ( + BetaUserServiceOrganization as BetaUserServiceOrganization, +) +from zitadel_client.models.beta_user_service_organization_id_query import ( + BetaUserServiceOrganizationIdQuery as BetaUserServiceOrganizationIdQuery, +) +from zitadel_client.models.beta_user_service_passkey_authenticator import ( + BetaUserServicePasskeyAuthenticator as BetaUserServicePasskeyAuthenticator, +) +from zitadel_client.models.beta_user_service_passkey_registration_code import ( + BetaUserServicePasskeyRegistrationCode as BetaUserServicePasskeyRegistrationCode, +) +from zitadel_client.models.beta_user_service_password import ( + BetaUserServicePassword as BetaUserServicePassword, +) +from zitadel_client.models.beta_user_service_password_reset_request import ( + BetaUserServicePasswordResetRequest as BetaUserServicePasswordResetRequest, +) +from zitadel_client.models.beta_user_service_password_reset_response import ( + BetaUserServicePasswordResetResponse as BetaUserServicePasswordResetResponse, +) +from zitadel_client.models.beta_user_service_phone_query import ( + BetaUserServicePhoneQuery as BetaUserServicePhoneQuery, +) +from zitadel_client.models.beta_user_service_reactivate_user_request import ( + BetaUserServiceReactivateUserRequest as BetaUserServiceReactivateUserRequest, +) +from zitadel_client.models.beta_user_service_reactivate_user_response import ( + BetaUserServiceReactivateUserResponse as BetaUserServiceReactivateUserResponse, +) +from zitadel_client.models.beta_user_service_redirect_urls import ( + BetaUserServiceRedirectURLs as BetaUserServiceRedirectURLs, +) +from zitadel_client.models.beta_user_service_register_passkey_request import ( + BetaUserServiceRegisterPasskeyRequest as BetaUserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.beta_user_service_register_passkey_response import ( + BetaUserServiceRegisterPasskeyResponse as BetaUserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.beta_user_service_register_totp_request import ( + BetaUserServiceRegisterTOTPRequest as BetaUserServiceRegisterTOTPRequest, +) +from zitadel_client.models.beta_user_service_register_totp_response import ( + BetaUserServiceRegisterTOTPResponse as BetaUserServiceRegisterTOTPResponse, +) +from zitadel_client.models.beta_user_service_register_u2_f_request import ( + BetaUserServiceRegisterU2FRequest as BetaUserServiceRegisterU2FRequest, +) +from zitadel_client.models.beta_user_service_register_u2_f_response import ( + BetaUserServiceRegisterU2FResponse as BetaUserServiceRegisterU2FResponse, +) +from zitadel_client.models.beta_user_service_remove_otp_email_request import ( + BetaUserServiceRemoveOTPEmailRequest as BetaUserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.beta_user_service_remove_otp_email_response import ( + BetaUserServiceRemoveOTPEmailResponse as BetaUserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.beta_user_service_remove_otpsms_request import ( + BetaUserServiceRemoveOTPSMSRequest as BetaUserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.beta_user_service_remove_otpsms_response import ( + BetaUserServiceRemoveOTPSMSResponse as BetaUserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.beta_user_service_remove_phone_request import ( + BetaUserServiceRemovePhoneRequest as BetaUserServiceRemovePhoneRequest, +) +from zitadel_client.models.beta_user_service_remove_phone_response import ( + BetaUserServiceRemovePhoneResponse as BetaUserServiceRemovePhoneResponse, +) +from zitadel_client.models.beta_user_service_remove_totp_request import ( + BetaUserServiceRemoveTOTPRequest as BetaUserServiceRemoveTOTPRequest, +) +from zitadel_client.models.beta_user_service_remove_totp_response import ( + BetaUserServiceRemoveTOTPResponse as BetaUserServiceRemoveTOTPResponse, +) +from zitadel_client.models.beta_user_service_resend_email_code_request import ( + BetaUserServiceResendEmailCodeRequest as BetaUserServiceResendEmailCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_email_code_response import ( + BetaUserServiceResendEmailCodeResponse as BetaUserServiceResendEmailCodeResponse, +) +from zitadel_client.models.beta_user_service_resend_phone_code_request import ( + BetaUserServiceResendPhoneCodeRequest as BetaUserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.beta_user_service_resend_phone_code_response import ( + BetaUserServiceResendPhoneCodeResponse as BetaUserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_request import ( + BetaUserServiceRetrieveIdentityProviderIntentRequest as BetaUserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_retrieve_identity_provider_intent_response import ( + BetaUserServiceRetrieveIdentityProviderIntentResponse as BetaUserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery as BetaUserServiceSearchQuery, +) +from zitadel_client.models.beta_user_service_send_email_verification_code import ( + BetaUserServiceSendEmailVerificationCode as BetaUserServiceSendEmailVerificationCode, +) +from zitadel_client.models.beta_user_service_send_passkey_registration_link import ( + BetaUserServiceSendPasskeyRegistrationLink as BetaUserServiceSendPasskeyRegistrationLink, +) +from zitadel_client.models.beta_user_service_send_password_reset_link import ( + BetaUserServiceSendPasswordResetLink as BetaUserServiceSendPasswordResetLink, +) +from zitadel_client.models.beta_user_service_set_email_request import ( + BetaUserServiceSetEmailRequest as BetaUserServiceSetEmailRequest, +) +from zitadel_client.models.beta_user_service_set_email_response import ( + BetaUserServiceSetEmailResponse as BetaUserServiceSetEmailResponse, +) +from zitadel_client.models.beta_user_service_set_human_email import ( + BetaUserServiceSetHumanEmail as BetaUserServiceSetHumanEmail, +) +from zitadel_client.models.beta_user_service_set_human_phone import ( + BetaUserServiceSetHumanPhone as BetaUserServiceSetHumanPhone, +) +from zitadel_client.models.beta_user_service_set_human_profile import ( + BetaUserServiceSetHumanProfile as BetaUserServiceSetHumanProfile, +) +from zitadel_client.models.beta_user_service_set_metadata_entry import ( + BetaUserServiceSetMetadataEntry as BetaUserServiceSetMetadataEntry, +) +from zitadel_client.models.beta_user_service_set_password import ( + BetaUserServiceSetPassword as BetaUserServiceSetPassword, +) +from zitadel_client.models.beta_user_service_set_password_request import ( + BetaUserServiceSetPasswordRequest as BetaUserServiceSetPasswordRequest, +) +from zitadel_client.models.beta_user_service_set_password_response import ( + BetaUserServiceSetPasswordResponse as BetaUserServiceSetPasswordResponse, +) +from zitadel_client.models.beta_user_service_set_phone_request import ( + BetaUserServiceSetPhoneRequest as BetaUserServiceSetPhoneRequest, +) +from zitadel_client.models.beta_user_service_set_phone_response import ( + BetaUserServiceSetPhoneResponse as BetaUserServiceSetPhoneResponse, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_request import ( + BetaUserServiceStartIdentityProviderIntentRequest as BetaUserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.beta_user_service_start_identity_provider_intent_response import ( + BetaUserServiceStartIdentityProviderIntentResponse as BetaUserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.beta_user_service_state_query import ( + BetaUserServiceStateQuery as BetaUserServiceStateQuery, +) +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod as BetaUserServiceTextQueryMethod, +) +from zitadel_client.models.beta_user_service_type import ( + BetaUserServiceType as BetaUserServiceType, +) +from zitadel_client.models.beta_user_service_type_query import ( + BetaUserServiceTypeQuery as BetaUserServiceTypeQuery, +) +from zitadel_client.models.beta_user_service_unlock_user_request import ( + BetaUserServiceUnlockUserRequest as BetaUserServiceUnlockUserRequest, +) +from zitadel_client.models.beta_user_service_unlock_user_response import ( + BetaUserServiceUnlockUserResponse as BetaUserServiceUnlockUserResponse, +) +from zitadel_client.models.beta_user_service_update_human_user_request import ( + BetaUserServiceUpdateHumanUserRequest as BetaUserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.beta_user_service_update_human_user_response import ( + BetaUserServiceUpdateHumanUserResponse as BetaUserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.beta_user_service_user import ( + BetaUserServiceUser as BetaUserServiceUser, +) +from zitadel_client.models.beta_user_service_user_field_name import ( + BetaUserServiceUserFieldName as BetaUserServiceUserFieldName, +) +from zitadel_client.models.beta_user_service_user_name_query import ( + BetaUserServiceUserNameQuery as BetaUserServiceUserNameQuery, +) +from zitadel_client.models.beta_user_service_user_state import ( + BetaUserServiceUserState as BetaUserServiceUserState, +) +from zitadel_client.models.beta_user_service_verify_email_request import ( + BetaUserServiceVerifyEmailRequest as BetaUserServiceVerifyEmailRequest, +) +from zitadel_client.models.beta_user_service_verify_email_response import ( + BetaUserServiceVerifyEmailResponse as BetaUserServiceVerifyEmailResponse, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_request import ( + BetaUserServiceVerifyPasskeyRegistrationRequest as BetaUserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_passkey_registration_response import ( + BetaUserServiceVerifyPasskeyRegistrationResponse as BetaUserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_phone_request import ( + BetaUserServiceVerifyPhoneRequest as BetaUserServiceVerifyPhoneRequest, +) +from zitadel_client.models.beta_user_service_verify_phone_response import ( + BetaUserServiceVerifyPhoneResponse as BetaUserServiceVerifyPhoneResponse, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_request import ( + BetaUserServiceVerifyTOTPRegistrationRequest as BetaUserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_totp_registration_response import ( + BetaUserServiceVerifyTOTPRegistrationResponse as BetaUserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_request import ( + BetaUserServiceVerifyU2FRegistrationRequest as BetaUserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.beta_user_service_verify_u2_f_registration_response import ( + BetaUserServiceVerifyU2FRegistrationResponse as BetaUserServiceVerifyU2FRegistrationResponse, +) +from zitadel_client.models.beta_web_key_service_activate_web_key_request import ( + BetaWebKeyServiceActivateWebKeyRequest as BetaWebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_activate_web_key_response import ( + BetaWebKeyServiceActivateWebKeyResponse as BetaWebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_any import ( + BetaWebKeyServiceAny as BetaWebKeyServiceAny, +) +from zitadel_client.models.beta_web_key_service_connect_error import ( + BetaWebKeyServiceConnectError as BetaWebKeyServiceConnectError, +) +from zitadel_client.models.beta_web_key_service_create_web_key_request import ( + BetaWebKeyServiceCreateWebKeyRequest as BetaWebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_create_web_key_response import ( + BetaWebKeyServiceCreateWebKeyResponse as BetaWebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_request import ( + BetaWebKeyServiceDeleteWebKeyRequest as BetaWebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.beta_web_key_service_delete_web_key_response import ( + BetaWebKeyServiceDeleteWebKeyResponse as BetaWebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.beta_web_key_service_ecdsa import ( + BetaWebKeyServiceECDSA as BetaWebKeyServiceECDSA, +) +from zitadel_client.models.beta_web_key_service_ecdsa_curve import ( + BetaWebKeyServiceECDSACurve as BetaWebKeyServiceECDSACurve, +) +from zitadel_client.models.beta_web_key_service_list_web_keys_response import ( + BetaWebKeyServiceListWebKeysResponse as BetaWebKeyServiceListWebKeysResponse, +) +from zitadel_client.models.beta_web_key_service_rsa import ( + BetaWebKeyServiceRSA as BetaWebKeyServiceRSA, +) +from zitadel_client.models.beta_web_key_service_rsa_bits import ( + BetaWebKeyServiceRSABits as BetaWebKeyServiceRSABits, +) +from zitadel_client.models.beta_web_key_service_rsa_hasher import ( + BetaWebKeyServiceRSAHasher as BetaWebKeyServiceRSAHasher, +) +from zitadel_client.models.beta_web_key_service_state import ( + BetaWebKeyServiceState as BetaWebKeyServiceState, +) +from zitadel_client.models.beta_web_key_service_web_key import ( + BetaWebKeyServiceWebKey as BetaWebKeyServiceWebKey, +) +from zitadel_client.models.feature_service_any import ( + FeatureServiceAny as FeatureServiceAny, +) +from zitadel_client.models.feature_service_connect_error import ( + FeatureServiceConnectError as FeatureServiceConnectError, +) +from zitadel_client.models.feature_service_details import ( + FeatureServiceDetails as FeatureServiceDetails, +) +from zitadel_client.models.feature_service_feature_flag import ( + FeatureServiceFeatureFlag as FeatureServiceFeatureFlag, +) +from zitadel_client.models.feature_service_get_instance_features_request import ( + FeatureServiceGetInstanceFeaturesRequest as FeatureServiceGetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_get_instance_features_response import ( + FeatureServiceGetInstanceFeaturesResponse as FeatureServiceGetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_get_organization_features_request import ( + FeatureServiceGetOrganizationFeaturesRequest as FeatureServiceGetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_get_organization_features_response import ( + FeatureServiceGetOrganizationFeaturesResponse as FeatureServiceGetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_get_system_features_response import ( + FeatureServiceGetSystemFeaturesResponse as FeatureServiceGetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_get_user_features_request import ( + FeatureServiceGetUserFeaturesRequest as FeatureServiceGetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_get_user_features_response import ( + FeatureServiceGetUserFeaturesResponse as FeatureServiceGetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_improved_performance import ( + FeatureServiceImprovedPerformance as FeatureServiceImprovedPerformance, +) +from zitadel_client.models.feature_service_improved_performance_feature_flag import ( + FeatureServiceImprovedPerformanceFeatureFlag as FeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.feature_service_login_v2 import ( + FeatureServiceLoginV2 as FeatureServiceLoginV2, +) +from zitadel_client.models.feature_service_login_v2_feature_flag import ( + FeatureServiceLoginV2FeatureFlag as FeatureServiceLoginV2FeatureFlag, +) +from zitadel_client.models.feature_service_reset_instance_features_response import ( + FeatureServiceResetInstanceFeaturesResponse as FeatureServiceResetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_organization_features_request import ( + FeatureServiceResetOrganizationFeaturesRequest as FeatureServiceResetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_organization_features_response import ( + FeatureServiceResetOrganizationFeaturesResponse as FeatureServiceResetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_system_features_response import ( + FeatureServiceResetSystemFeaturesResponse as FeatureServiceResetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_reset_user_features_request import ( + FeatureServiceResetUserFeaturesRequest as FeatureServiceResetUserFeaturesRequest, +) +from zitadel_client.models.feature_service_reset_user_features_response import ( + FeatureServiceResetUserFeaturesResponse as FeatureServiceResetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_set_instance_features_request import ( + FeatureServiceSetInstanceFeaturesRequest as FeatureServiceSetInstanceFeaturesRequest, +) +from zitadel_client.models.feature_service_set_instance_features_response import ( + FeatureServiceSetInstanceFeaturesResponse as FeatureServiceSetInstanceFeaturesResponse, +) +from zitadel_client.models.feature_service_set_organization_features_request import ( + FeatureServiceSetOrganizationFeaturesRequest as FeatureServiceSetOrganizationFeaturesRequest, +) +from zitadel_client.models.feature_service_set_organization_features_response import ( + FeatureServiceSetOrganizationFeaturesResponse as FeatureServiceSetOrganizationFeaturesResponse, +) +from zitadel_client.models.feature_service_set_system_features_request import ( + FeatureServiceSetSystemFeaturesRequest as FeatureServiceSetSystemFeaturesRequest, +) +from zitadel_client.models.feature_service_set_system_features_response import ( + FeatureServiceSetSystemFeaturesResponse as FeatureServiceSetSystemFeaturesResponse, +) +from zitadel_client.models.feature_service_set_user_feature_request import ( + FeatureServiceSetUserFeatureRequest as FeatureServiceSetUserFeatureRequest, +) +from zitadel_client.models.feature_service_set_user_features_response import ( + FeatureServiceSetUserFeaturesResponse as FeatureServiceSetUserFeaturesResponse, +) +from zitadel_client.models.feature_service_source import ( + FeatureServiceSource as FeatureServiceSource, +) +from zitadel_client.models.identity_provider_service_any import ( + IdentityProviderServiceAny as IdentityProviderServiceAny, +) +from zitadel_client.models.identity_provider_service_apple_config import ( + IdentityProviderServiceAppleConfig as IdentityProviderServiceAppleConfig, +) +from zitadel_client.models.identity_provider_service_auto_linking_option import ( + IdentityProviderServiceAutoLinkingOption as IdentityProviderServiceAutoLinkingOption, +) +from zitadel_client.models.identity_provider_service_azure_ad_config import ( + IdentityProviderServiceAzureADConfig as IdentityProviderServiceAzureADConfig, +) +from zitadel_client.models.identity_provider_service_azure_ad_tenant import ( + IdentityProviderServiceAzureADTenant as IdentityProviderServiceAzureADTenant, +) +from zitadel_client.models.identity_provider_service_azure_ad_tenant_type import ( + IdentityProviderServiceAzureADTenantType as IdentityProviderServiceAzureADTenantType, +) +from zitadel_client.models.identity_provider_service_connect_error import ( + IdentityProviderServiceConnectError as IdentityProviderServiceConnectError, +) +from zitadel_client.models.identity_provider_service_details import ( + IdentityProviderServiceDetails as IdentityProviderServiceDetails, +) +from zitadel_client.models.identity_provider_service_generic_oidc_config import ( + IdentityProviderServiceGenericOIDCConfig as IdentityProviderServiceGenericOIDCConfig, +) +from zitadel_client.models.identity_provider_service_get_idpby_id_request import ( + IdentityProviderServiceGetIDPByIDRequest as IdentityProviderServiceGetIDPByIDRequest, +) +from zitadel_client.models.identity_provider_service_get_idpby_id_response import ( + IdentityProviderServiceGetIDPByIDResponse as IdentityProviderServiceGetIDPByIDResponse, +) +from zitadel_client.models.identity_provider_service_git_hub_config import ( + IdentityProviderServiceGitHubConfig as IdentityProviderServiceGitHubConfig, +) +from zitadel_client.models.identity_provider_service_git_hub_enterprise_server_config import ( + IdentityProviderServiceGitHubEnterpriseServerConfig as IdentityProviderServiceGitHubEnterpriseServerConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_config import ( + IdentityProviderServiceGitLabConfig as IdentityProviderServiceGitLabConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_self_hosted_config import ( + IdentityProviderServiceGitLabSelfHostedConfig as IdentityProviderServiceGitLabSelfHostedConfig, +) +from zitadel_client.models.identity_provider_service_google_config import ( + IdentityProviderServiceGoogleConfig as IdentityProviderServiceGoogleConfig, +) +from zitadel_client.models.identity_provider_service_idp import ( + IdentityProviderServiceIDP as IdentityProviderServiceIDP, +) +from zitadel_client.models.identity_provider_service_idp_config import ( + IdentityProviderServiceIDPConfig as IdentityProviderServiceIDPConfig, +) +from zitadel_client.models.identity_provider_service_idp_state import ( + IdentityProviderServiceIDPState as IdentityProviderServiceIDPState, +) +from zitadel_client.models.identity_provider_service_idp_type import ( + IdentityProviderServiceIDPType as IdentityProviderServiceIDPType, +) +from zitadel_client.models.identity_provider_service_jwt_config import ( + IdentityProviderServiceJWTConfig as IdentityProviderServiceJWTConfig, +) +from zitadel_client.models.identity_provider_service_ldap_attributes import ( + IdentityProviderServiceLDAPAttributes as IdentityProviderServiceLDAPAttributes, +) +from zitadel_client.models.identity_provider_service_ldap_config import ( + IdentityProviderServiceLDAPConfig as IdentityProviderServiceLDAPConfig, +) +from zitadel_client.models.identity_provider_service_o_auth_config import ( + IdentityProviderServiceOAuthConfig as IdentityProviderServiceOAuthConfig, +) +from zitadel_client.models.identity_provider_service_options import ( + IdentityProviderServiceOptions as IdentityProviderServiceOptions, +) +from zitadel_client.models.identity_provider_service_saml_binding import ( + IdentityProviderServiceSAMLBinding as IdentityProviderServiceSAMLBinding, +) +from zitadel_client.models.identity_provider_service_saml_config import ( + IdentityProviderServiceSAMLConfig as IdentityProviderServiceSAMLConfig, +) +from zitadel_client.models.identity_provider_service_saml_name_id_format import ( + IdentityProviderServiceSAMLNameIDFormat as IdentityProviderServiceSAMLNameIDFormat, +) +from zitadel_client.models.identity_provider_service_saml_signature_algorithm import ( + IdentityProviderServiceSAMLSignatureAlgorithm as IdentityProviderServiceSAMLSignatureAlgorithm, +) +from zitadel_client.models.instance_service_add_custom_domain_request import ( + InstanceServiceAddCustomDomainRequest as InstanceServiceAddCustomDomainRequest, +) +from zitadel_client.models.instance_service_add_custom_domain_response import ( + InstanceServiceAddCustomDomainResponse as InstanceServiceAddCustomDomainResponse, +) +from zitadel_client.models.instance_service_add_trusted_domain_request import ( + InstanceServiceAddTrustedDomainRequest as InstanceServiceAddTrustedDomainRequest, +) +from zitadel_client.models.instance_service_add_trusted_domain_response import ( + InstanceServiceAddTrustedDomainResponse as InstanceServiceAddTrustedDomainResponse, +) +from zitadel_client.models.instance_service_any import ( + InstanceServiceAny as InstanceServiceAny, +) +from zitadel_client.models.instance_service_connect_error import ( + InstanceServiceConnectError as InstanceServiceConnectError, +) +from zitadel_client.models.instance_service_custom_domain import ( + InstanceServiceCustomDomain as InstanceServiceCustomDomain, +) +from zitadel_client.models.instance_service_custom_domain_filter import ( + InstanceServiceCustomDomainFilter as InstanceServiceCustomDomainFilter, +) +from zitadel_client.models.instance_service_custom_domains_filter import ( + InstanceServiceCustomDomainsFilter as InstanceServiceCustomDomainsFilter, +) +from zitadel_client.models.instance_service_delete_instance_request import ( + InstanceServiceDeleteInstanceRequest as InstanceServiceDeleteInstanceRequest, +) +from zitadel_client.models.instance_service_delete_instance_response import ( + InstanceServiceDeleteInstanceResponse as InstanceServiceDeleteInstanceResponse, +) +from zitadel_client.models.instance_service_domain_field_name import ( + InstanceServiceDomainFieldName as InstanceServiceDomainFieldName, +) +from zitadel_client.models.instance_service_domain_filter import ( + InstanceServiceDomainFilter as InstanceServiceDomainFilter, +) +from zitadel_client.models.instance_service_field_name import ( + InstanceServiceFieldName as InstanceServiceFieldName, +) +from zitadel_client.models.instance_service_filter import ( + InstanceServiceFilter as InstanceServiceFilter, +) +from zitadel_client.models.instance_service_get_instance_request import ( + InstanceServiceGetInstanceRequest as InstanceServiceGetInstanceRequest, +) +from zitadel_client.models.instance_service_get_instance_response import ( + InstanceServiceGetInstanceResponse as InstanceServiceGetInstanceResponse, +) +from zitadel_client.models.instance_service_in_ids_filter import ( + InstanceServiceInIDsFilter as InstanceServiceInIDsFilter, +) +from zitadel_client.models.instance_service_instance import ( + InstanceServiceInstance as InstanceServiceInstance, +) +from zitadel_client.models.instance_service_list_custom_domains_request import ( + InstanceServiceListCustomDomainsRequest as InstanceServiceListCustomDomainsRequest, +) +from zitadel_client.models.instance_service_list_custom_domains_response import ( + InstanceServiceListCustomDomainsResponse as InstanceServiceListCustomDomainsResponse, +) +from zitadel_client.models.instance_service_list_instances_request import ( + InstanceServiceListInstancesRequest as InstanceServiceListInstancesRequest, +) +from zitadel_client.models.instance_service_list_instances_response import ( + InstanceServiceListInstancesResponse as InstanceServiceListInstancesResponse, +) +from zitadel_client.models.instance_service_list_trusted_domains_request import ( + InstanceServiceListTrustedDomainsRequest as InstanceServiceListTrustedDomainsRequest, +) +from zitadel_client.models.instance_service_list_trusted_domains_response import ( + InstanceServiceListTrustedDomainsResponse as InstanceServiceListTrustedDomainsResponse, +) +from zitadel_client.models.instance_service_pagination_request import ( + InstanceServicePaginationRequest as InstanceServicePaginationRequest, +) +from zitadel_client.models.instance_service_pagination_response import ( + InstanceServicePaginationResponse as InstanceServicePaginationResponse, +) +from zitadel_client.models.instance_service_remove_custom_domain_request import ( + InstanceServiceRemoveCustomDomainRequest as InstanceServiceRemoveCustomDomainRequest, +) +from zitadel_client.models.instance_service_remove_custom_domain_response import ( + InstanceServiceRemoveCustomDomainResponse as InstanceServiceRemoveCustomDomainResponse, +) +from zitadel_client.models.instance_service_remove_trusted_domain_request import ( + InstanceServiceRemoveTrustedDomainRequest as InstanceServiceRemoveTrustedDomainRequest, +) +from zitadel_client.models.instance_service_remove_trusted_domain_response import ( + InstanceServiceRemoveTrustedDomainResponse as InstanceServiceRemoveTrustedDomainResponse, +) +from zitadel_client.models.instance_service_state import ( + InstanceServiceState as InstanceServiceState, +) +from zitadel_client.models.instance_service_text_query_method import ( + InstanceServiceTextQueryMethod as InstanceServiceTextQueryMethod, +) +from zitadel_client.models.instance_service_trusted_domain import ( + InstanceServiceTrustedDomain as InstanceServiceTrustedDomain, +) +from zitadel_client.models.instance_service_trusted_domain_field_name import ( + InstanceServiceTrustedDomainFieldName as InstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.instance_service_trusted_domain_filter import ( + InstanceServiceTrustedDomainFilter as InstanceServiceTrustedDomainFilter, +) +from zitadel_client.models.instance_service_update_instance_request import ( + InstanceServiceUpdateInstanceRequest as InstanceServiceUpdateInstanceRequest, +) +from zitadel_client.models.instance_service_update_instance_response import ( + InstanceServiceUpdateInstanceResponse as InstanceServiceUpdateInstanceResponse, +) +from zitadel_client.models.internal_permission_service_administrator import ( + InternalPermissionServiceAdministrator as InternalPermissionServiceAdministrator, +) +from zitadel_client.models.internal_permission_service_administrator_field_name import ( + InternalPermissionServiceAdministratorFieldName as InternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter as InternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.internal_permission_service_and_filter import ( + InternalPermissionServiceAndFilter as InternalPermissionServiceAndFilter, +) +from zitadel_client.models.internal_permission_service_any import ( + InternalPermissionServiceAny as InternalPermissionServiceAny, +) +from zitadel_client.models.internal_permission_service_connect_error import ( + InternalPermissionServiceConnectError as InternalPermissionServiceConnectError, +) +from zitadel_client.models.internal_permission_service_create_administrator_request import ( + InternalPermissionServiceCreateAdministratorRequest as InternalPermissionServiceCreateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_create_administrator_response import ( + InternalPermissionServiceCreateAdministratorResponse as InternalPermissionServiceCreateAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_delete_administrator_request import ( + InternalPermissionServiceDeleteAdministratorRequest as InternalPermissionServiceDeleteAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_delete_administrator_response import ( + InternalPermissionServiceDeleteAdministratorResponse as InternalPermissionServiceDeleteAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_id_filter import ( + InternalPermissionServiceIDFilter as InternalPermissionServiceIDFilter, +) +from zitadel_client.models.internal_permission_service_in_ids_filter import ( + InternalPermissionServiceInIDsFilter as InternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.internal_permission_service_list_administrators_request import ( + InternalPermissionServiceListAdministratorsRequest as InternalPermissionServiceListAdministratorsRequest, +) +from zitadel_client.models.internal_permission_service_list_administrators_response import ( + InternalPermissionServiceListAdministratorsResponse as InternalPermissionServiceListAdministratorsResponse, +) +from zitadel_client.models.internal_permission_service_not_filter import ( + InternalPermissionServiceNotFilter as InternalPermissionServiceNotFilter, +) +from zitadel_client.models.internal_permission_service_or_filter import ( + InternalPermissionServiceOrFilter as InternalPermissionServiceOrFilter, +) +from zitadel_client.models.internal_permission_service_organization import ( + InternalPermissionServiceOrganization as InternalPermissionServiceOrganization, +) +from zitadel_client.models.internal_permission_service_pagination_request import ( + InternalPermissionServicePaginationRequest as InternalPermissionServicePaginationRequest, +) +from zitadel_client.models.internal_permission_service_pagination_response import ( + InternalPermissionServicePaginationResponse as InternalPermissionServicePaginationResponse, +) +from zitadel_client.models.internal_permission_service_project import ( + InternalPermissionServiceProject as InternalPermissionServiceProject, +) +from zitadel_client.models.internal_permission_service_project_grant import ( + InternalPermissionServiceProjectGrant as InternalPermissionServiceProjectGrant, +) +from zitadel_client.models.internal_permission_service_resource_filter import ( + InternalPermissionServiceResourceFilter as InternalPermissionServiceResourceFilter, +) +from zitadel_client.models.internal_permission_service_resource_type import ( + InternalPermissionServiceResourceType as InternalPermissionServiceResourceType, +) +from zitadel_client.models.internal_permission_service_role_filter import ( + InternalPermissionServiceRoleFilter as InternalPermissionServiceRoleFilter, +) +from zitadel_client.models.internal_permission_service_text_filter_method import ( + InternalPermissionServiceTextFilterMethod as InternalPermissionServiceTextFilterMethod, +) +from zitadel_client.models.internal_permission_service_timestamp_filter import ( + InternalPermissionServiceTimestampFilter as InternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.internal_permission_service_timestamp_filter_method import ( + InternalPermissionServiceTimestampFilterMethod as InternalPermissionServiceTimestampFilterMethod, +) +from zitadel_client.models.internal_permission_service_update_administrator_request import ( + InternalPermissionServiceUpdateAdministratorRequest as InternalPermissionServiceUpdateAdministratorRequest, +) +from zitadel_client.models.internal_permission_service_update_administrator_response import ( + InternalPermissionServiceUpdateAdministratorResponse as InternalPermissionServiceUpdateAdministratorResponse, +) +from zitadel_client.models.internal_permission_service_user import ( + InternalPermissionServiceUser as InternalPermissionServiceUser, +) +from zitadel_client.models.internal_permission_service_user_display_name_filter import ( + InternalPermissionServiceUserDisplayNameFilter as InternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.internal_permission_service_user_preferred_login_name_filter import ( + InternalPermissionServiceUserPreferredLoginNameFilter as InternalPermissionServiceUserPreferredLoginNameFilter, +) +from zitadel_client.models.oidc_service_any import OIDCServiceAny as OIDCServiceAny +from zitadel_client.models.oidc_service_auth_request import ( + OIDCServiceAuthRequest as OIDCServiceAuthRequest, +) +from zitadel_client.models.oidc_service_authorization_error import ( + OIDCServiceAuthorizationError as OIDCServiceAuthorizationError, +) +from zitadel_client.models.oidc_service_authorize_or_deny_device_authorization_request import ( + OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest as OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest, +) +from zitadel_client.models.oidc_service_connect_error import ( + OIDCServiceConnectError as OIDCServiceConnectError, +) +from zitadel_client.models.oidc_service_create_callback_request import ( + OIDCServiceCreateCallbackRequest as OIDCServiceCreateCallbackRequest, +) +from zitadel_client.models.oidc_service_create_callback_response import ( + OIDCServiceCreateCallbackResponse as OIDCServiceCreateCallbackResponse, +) +from zitadel_client.models.oidc_service_details import ( + OIDCServiceDetails as OIDCServiceDetails, +) +from zitadel_client.models.oidc_service_device_authorization_request import ( + OIDCServiceDeviceAuthorizationRequest as OIDCServiceDeviceAuthorizationRequest, +) +from zitadel_client.models.oidc_service_error_reason import ( + OIDCServiceErrorReason as OIDCServiceErrorReason, +) +from zitadel_client.models.oidc_service_get_auth_request_request import ( + OIDCServiceGetAuthRequestRequest as OIDCServiceGetAuthRequestRequest, +) +from zitadel_client.models.oidc_service_get_auth_request_response import ( + OIDCServiceGetAuthRequestResponse as OIDCServiceGetAuthRequestResponse, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_request import ( + OIDCServiceGetDeviceAuthorizationRequestRequest as OIDCServiceGetDeviceAuthorizationRequestRequest, +) +from zitadel_client.models.oidc_service_get_device_authorization_request_response import ( + OIDCServiceGetDeviceAuthorizationRequestResponse as OIDCServiceGetDeviceAuthorizationRequestResponse, +) +from zitadel_client.models.oidc_service_prompt import ( + OIDCServicePrompt as OIDCServicePrompt, +) +from zitadel_client.models.oidc_service_session import ( + OIDCServiceSession as OIDCServiceSession, +) +from zitadel_client.models.organization_service_activate_organization_request import ( + OrganizationServiceActivateOrganizationRequest as OrganizationServiceActivateOrganizationRequest, +) +from zitadel_client.models.organization_service_activate_organization_response import ( + OrganizationServiceActivateOrganizationResponse as OrganizationServiceActivateOrganizationResponse, +) +from zitadel_client.models.organization_service_add_human_user_request import ( + OrganizationServiceAddHumanUserRequest as OrganizationServiceAddHumanUserRequest, +) +from zitadel_client.models.organization_service_add_organization_domain_request import ( + OrganizationServiceAddOrganizationDomainRequest as OrganizationServiceAddOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_add_organization_domain_response import ( + OrganizationServiceAddOrganizationDomainResponse as OrganizationServiceAddOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_add_organization_request import ( + OrganizationServiceAddOrganizationRequest as OrganizationServiceAddOrganizationRequest, +) +from zitadel_client.models.organization_service_add_organization_response import ( + OrganizationServiceAddOrganizationResponse as OrganizationServiceAddOrganizationResponse, +) +from zitadel_client.models.organization_service_admin import ( + OrganizationServiceAdmin as OrganizationServiceAdmin, +) +from zitadel_client.models.organization_service_any import ( + OrganizationServiceAny as OrganizationServiceAny, +) +from zitadel_client.models.organization_service_connect_error import ( + OrganizationServiceConnectError as OrganizationServiceConnectError, +) +from zitadel_client.models.organization_service_created_admin import ( + OrganizationServiceCreatedAdmin as OrganizationServiceCreatedAdmin, +) +from zitadel_client.models.organization_service_deactivate_organization_request import ( + OrganizationServiceDeactivateOrganizationRequest as OrganizationServiceDeactivateOrganizationRequest, +) +from zitadel_client.models.organization_service_deactivate_organization_response import ( + OrganizationServiceDeactivateOrganizationResponse as OrganizationServiceDeactivateOrganizationResponse, +) +from zitadel_client.models.organization_service_delete_organization_domain_request import ( + OrganizationServiceDeleteOrganizationDomainRequest as OrganizationServiceDeleteOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_delete_organization_domain_response import ( + OrganizationServiceDeleteOrganizationDomainResponse as OrganizationServiceDeleteOrganizationDomainResponse, +) +from zitadel_client.models.organization_service_delete_organization_metadata_request import ( + OrganizationServiceDeleteOrganizationMetadataRequest as OrganizationServiceDeleteOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_delete_organization_metadata_response import ( + OrganizationServiceDeleteOrganizationMetadataResponse as OrganizationServiceDeleteOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_delete_organization_request import ( + OrganizationServiceDeleteOrganizationRequest as OrganizationServiceDeleteOrganizationRequest, +) +from zitadel_client.models.organization_service_delete_organization_response import ( + OrganizationServiceDeleteOrganizationResponse as OrganizationServiceDeleteOrganizationResponse, +) +from zitadel_client.models.organization_service_details import ( + OrganizationServiceDetails as OrganizationServiceDetails, +) +from zitadel_client.models.organization_service_domain import ( + OrganizationServiceDomain as OrganizationServiceDomain, +) +from zitadel_client.models.organization_service_domain_field_name import ( + OrganizationServiceDomainFieldName as OrganizationServiceDomainFieldName, +) +from zitadel_client.models.organization_service_domain_search_filter import ( + OrganizationServiceDomainSearchFilter as OrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.organization_service_domain_validation_type import ( + OrganizationServiceDomainValidationType as OrganizationServiceDomainValidationType, +) +from zitadel_client.models.organization_service_gender import ( + OrganizationServiceGender as OrganizationServiceGender, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_request import ( + OrganizationServiceGenerateOrganizationDomainValidationRequest as OrganizationServiceGenerateOrganizationDomainValidationRequest, +) +from zitadel_client.models.organization_service_generate_organization_domain_validation_response import ( + OrganizationServiceGenerateOrganizationDomainValidationResponse as OrganizationServiceGenerateOrganizationDomainValidationResponse, +) +from zitadel_client.models.organization_service_hashed_password import ( + OrganizationServiceHashedPassword as OrganizationServiceHashedPassword, +) +from zitadel_client.models.organization_service_idp_link import ( + OrganizationServiceIDPLink as OrganizationServiceIDPLink, +) +from zitadel_client.models.organization_service_list_details import ( + OrganizationServiceListDetails as OrganizationServiceListDetails, +) +from zitadel_client.models.organization_service_list_organization_domains_request import ( + OrganizationServiceListOrganizationDomainsRequest as OrganizationServiceListOrganizationDomainsRequest, +) +from zitadel_client.models.organization_service_list_organization_domains_response import ( + OrganizationServiceListOrganizationDomainsResponse as OrganizationServiceListOrganizationDomainsResponse, +) +from zitadel_client.models.organization_service_list_organization_metadata_request import ( + OrganizationServiceListOrganizationMetadataRequest as OrganizationServiceListOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_list_organization_metadata_response import ( + OrganizationServiceListOrganizationMetadataResponse as OrganizationServiceListOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_list_organizations_request import ( + OrganizationServiceListOrganizationsRequest as OrganizationServiceListOrganizationsRequest, +) +from zitadel_client.models.organization_service_list_organizations_response import ( + OrganizationServiceListOrganizationsResponse as OrganizationServiceListOrganizationsResponse, +) +from zitadel_client.models.organization_service_list_query import ( + OrganizationServiceListQuery as OrganizationServiceListQuery, +) +from zitadel_client.models.organization_service_metadata import ( + OrganizationServiceMetadata as OrganizationServiceMetadata, +) +from zitadel_client.models.organization_service_metadata_key_filter import ( + OrganizationServiceMetadataKeyFilter as OrganizationServiceMetadataKeyFilter, +) +from zitadel_client.models.organization_service_metadata_search_filter import ( + OrganizationServiceMetadataSearchFilter as OrganizationServiceMetadataSearchFilter, +) +from zitadel_client.models.organization_service_organization import ( + OrganizationServiceOrganization as OrganizationServiceOrganization, +) +from zitadel_client.models.organization_service_organization_domain_query import ( + OrganizationServiceOrganizationDomainQuery as OrganizationServiceOrganizationDomainQuery, +) +from zitadel_client.models.organization_service_organization_field_name import ( + OrganizationServiceOrganizationFieldName as OrganizationServiceOrganizationFieldName, +) +from zitadel_client.models.organization_service_organization_id_query import ( + OrganizationServiceOrganizationIDQuery as OrganizationServiceOrganizationIDQuery, +) +from zitadel_client.models.organization_service_organization_name_query import ( + OrganizationServiceOrganizationNameQuery as OrganizationServiceOrganizationNameQuery, +) +from zitadel_client.models.organization_service_organization_state import ( + OrganizationServiceOrganizationState as OrganizationServiceOrganizationState, +) +from zitadel_client.models.organization_service_organization_state_query import ( + OrganizationServiceOrganizationStateQuery as OrganizationServiceOrganizationStateQuery, +) +from zitadel_client.models.organization_service_pagination_request import ( + OrganizationServicePaginationRequest as OrganizationServicePaginationRequest, +) +from zitadel_client.models.organization_service_pagination_response import ( + OrganizationServicePaginationResponse as OrganizationServicePaginationResponse, +) +from zitadel_client.models.organization_service_password import ( + OrganizationServicePassword as OrganizationServicePassword, +) +from zitadel_client.models.organization_service_search_query import ( + OrganizationServiceSearchQuery as OrganizationServiceSearchQuery, +) +from zitadel_client.models.organization_service_send_email_verification_code import ( + OrganizationServiceSendEmailVerificationCode as OrganizationServiceSendEmailVerificationCode, +) +from zitadel_client.models.organization_service_set_human_email import ( + OrganizationServiceSetHumanEmail as OrganizationServiceSetHumanEmail, +) +from zitadel_client.models.organization_service_set_human_phone import ( + OrganizationServiceSetHumanPhone as OrganizationServiceSetHumanPhone, +) +from zitadel_client.models.organization_service_set_human_profile import ( + OrganizationServiceSetHumanProfile as OrganizationServiceSetHumanProfile, +) +from zitadel_client.models.organization_service_set_metadata_entry import ( + OrganizationServiceSetMetadataEntry as OrganizationServiceSetMetadataEntry, +) +from zitadel_client.models.organization_service_set_organization_metadata_request import ( + OrganizationServiceSetOrganizationMetadataRequest as OrganizationServiceSetOrganizationMetadataRequest, +) +from zitadel_client.models.organization_service_set_organization_metadata_response import ( + OrganizationServiceSetOrganizationMetadataResponse as OrganizationServiceSetOrganizationMetadataResponse, +) +from zitadel_client.models.organization_service_text_filter_method import ( + OrganizationServiceTextFilterMethod as OrganizationServiceTextFilterMethod, +) +from zitadel_client.models.organization_service_text_query_method import ( + OrganizationServiceTextQueryMethod as OrganizationServiceTextQueryMethod, +) +from zitadel_client.models.organization_service_update_organization_request import ( + OrganizationServiceUpdateOrganizationRequest as OrganizationServiceUpdateOrganizationRequest, +) +from zitadel_client.models.organization_service_update_organization_response import ( + OrganizationServiceUpdateOrganizationResponse as OrganizationServiceUpdateOrganizationResponse, +) +from zitadel_client.models.organization_service_verify_organization_domain_request import ( + OrganizationServiceVerifyOrganizationDomainRequest as OrganizationServiceVerifyOrganizationDomainRequest, +) +from zitadel_client.models.organization_service_verify_organization_domain_response import ( + OrganizationServiceVerifyOrganizationDomainResponse as OrganizationServiceVerifyOrganizationDomainResponse, +) +from zitadel_client.models.project_service_activate_project_grant_request import ( + ProjectServiceActivateProjectGrantRequest as ProjectServiceActivateProjectGrantRequest, +) +from zitadel_client.models.project_service_activate_project_grant_response import ( + ProjectServiceActivateProjectGrantResponse as ProjectServiceActivateProjectGrantResponse, +) +from zitadel_client.models.project_service_activate_project_request import ( + ProjectServiceActivateProjectRequest as ProjectServiceActivateProjectRequest, +) +from zitadel_client.models.project_service_activate_project_response import ( + ProjectServiceActivateProjectResponse as ProjectServiceActivateProjectResponse, +) +from zitadel_client.models.project_service_add_project_role_request import ( + ProjectServiceAddProjectRoleRequest as ProjectServiceAddProjectRoleRequest, +) +from zitadel_client.models.project_service_add_project_role_response import ( + ProjectServiceAddProjectRoleResponse as ProjectServiceAddProjectRoleResponse, +) +from zitadel_client.models.project_service_any import ( + ProjectServiceAny as ProjectServiceAny, +) +from zitadel_client.models.project_service_connect_error import ( + ProjectServiceConnectError as ProjectServiceConnectError, +) +from zitadel_client.models.project_service_create_project_grant_request import ( + ProjectServiceCreateProjectGrantRequest as ProjectServiceCreateProjectGrantRequest, +) +from zitadel_client.models.project_service_create_project_grant_response import ( + ProjectServiceCreateProjectGrantResponse as ProjectServiceCreateProjectGrantResponse, +) +from zitadel_client.models.project_service_create_project_request import ( + ProjectServiceCreateProjectRequest as ProjectServiceCreateProjectRequest, +) +from zitadel_client.models.project_service_create_project_response import ( + ProjectServiceCreateProjectResponse as ProjectServiceCreateProjectResponse, +) +from zitadel_client.models.project_service_deactivate_project_grant_request import ( + ProjectServiceDeactivateProjectGrantRequest as ProjectServiceDeactivateProjectGrantRequest, +) +from zitadel_client.models.project_service_deactivate_project_grant_response import ( + ProjectServiceDeactivateProjectGrantResponse as ProjectServiceDeactivateProjectGrantResponse, +) +from zitadel_client.models.project_service_deactivate_project_request import ( + ProjectServiceDeactivateProjectRequest as ProjectServiceDeactivateProjectRequest, +) +from zitadel_client.models.project_service_deactivate_project_response import ( + ProjectServiceDeactivateProjectResponse as ProjectServiceDeactivateProjectResponse, +) +from zitadel_client.models.project_service_delete_project_grant_request import ( + ProjectServiceDeleteProjectGrantRequest as ProjectServiceDeleteProjectGrantRequest, +) +from zitadel_client.models.project_service_delete_project_grant_response import ( + ProjectServiceDeleteProjectGrantResponse as ProjectServiceDeleteProjectGrantResponse, +) +from zitadel_client.models.project_service_delete_project_request import ( + ProjectServiceDeleteProjectRequest as ProjectServiceDeleteProjectRequest, +) +from zitadel_client.models.project_service_delete_project_response import ( + ProjectServiceDeleteProjectResponse as ProjectServiceDeleteProjectResponse, +) +from zitadel_client.models.project_service_get_project_request import ( + ProjectServiceGetProjectRequest as ProjectServiceGetProjectRequest, +) +from zitadel_client.models.project_service_get_project_response import ( + ProjectServiceGetProjectResponse as ProjectServiceGetProjectResponse, +) +from zitadel_client.models.project_service_granted_project_state import ( + ProjectServiceGrantedProjectState as ProjectServiceGrantedProjectState, +) +from zitadel_client.models.project_service_id_filter import ( + ProjectServiceIDFilter as ProjectServiceIDFilter, +) +from zitadel_client.models.project_service_in_ids_filter import ( + ProjectServiceInIDsFilter as ProjectServiceInIDsFilter, +) +from zitadel_client.models.project_service_list_project_grants_request import ( + ProjectServiceListProjectGrantsRequest as ProjectServiceListProjectGrantsRequest, +) +from zitadel_client.models.project_service_list_project_grants_response import ( + ProjectServiceListProjectGrantsResponse as ProjectServiceListProjectGrantsResponse, +) +from zitadel_client.models.project_service_list_project_roles_request import ( + ProjectServiceListProjectRolesRequest as ProjectServiceListProjectRolesRequest, +) +from zitadel_client.models.project_service_list_project_roles_response import ( + ProjectServiceListProjectRolesResponse as ProjectServiceListProjectRolesResponse, +) +from zitadel_client.models.project_service_list_projects_request import ( + ProjectServiceListProjectsRequest as ProjectServiceListProjectsRequest, +) +from zitadel_client.models.project_service_list_projects_response import ( + ProjectServiceListProjectsResponse as ProjectServiceListProjectsResponse, +) +from zitadel_client.models.project_service_pagination_request import ( + ProjectServicePaginationRequest as ProjectServicePaginationRequest, +) +from zitadel_client.models.project_service_pagination_response import ( + ProjectServicePaginationResponse as ProjectServicePaginationResponse, +) +from zitadel_client.models.project_service_private_labeling_setting import ( + ProjectServicePrivateLabelingSetting as ProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.project_service_project import ( + ProjectServiceProject as ProjectServiceProject, +) +from zitadel_client.models.project_service_project_field_name import ( + ProjectServiceProjectFieldName as ProjectServiceProjectFieldName, +) +from zitadel_client.models.project_service_project_grant import ( + ProjectServiceProjectGrant as ProjectServiceProjectGrant, +) +from zitadel_client.models.project_service_project_grant_field_name import ( + ProjectServiceProjectGrantFieldName as ProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.project_service_project_grant_search_filter import ( + ProjectServiceProjectGrantSearchFilter as ProjectServiceProjectGrantSearchFilter, +) +from zitadel_client.models.project_service_project_grant_state import ( + ProjectServiceProjectGrantState as ProjectServiceProjectGrantState, +) +from zitadel_client.models.project_service_project_name_filter import ( + ProjectServiceProjectNameFilter as ProjectServiceProjectNameFilter, +) +from zitadel_client.models.project_service_project_organization_id_filter import ( + ProjectServiceProjectOrganizationIDFilter as ProjectServiceProjectOrganizationIDFilter, +) +from zitadel_client.models.project_service_project_role import ( + ProjectServiceProjectRole as ProjectServiceProjectRole, +) +from zitadel_client.models.project_service_project_role_display_name_filter import ( + ProjectServiceProjectRoleDisplayNameFilter as ProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.project_service_project_role_field_name import ( + ProjectServiceProjectRoleFieldName as ProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.project_service_project_role_key_filter import ( + ProjectServiceProjectRoleKeyFilter as ProjectServiceProjectRoleKeyFilter, +) +from zitadel_client.models.project_service_project_role_search_filter import ( + ProjectServiceProjectRoleSearchFilter as ProjectServiceProjectRoleSearchFilter, +) +from zitadel_client.models.project_service_project_search_filter import ( + ProjectServiceProjectSearchFilter as ProjectServiceProjectSearchFilter, +) +from zitadel_client.models.project_service_project_state import ( + ProjectServiceProjectState as ProjectServiceProjectState, +) +from zitadel_client.models.project_service_remove_project_role_request import ( + ProjectServiceRemoveProjectRoleRequest as ProjectServiceRemoveProjectRoleRequest, +) +from zitadel_client.models.project_service_remove_project_role_response import ( + ProjectServiceRemoveProjectRoleResponse as ProjectServiceRemoveProjectRoleResponse, +) +from zitadel_client.models.project_service_text_filter_method import ( + ProjectServiceTextFilterMethod as ProjectServiceTextFilterMethod, +) +from zitadel_client.models.project_service_type import ( + ProjectServiceType as ProjectServiceType, +) +from zitadel_client.models.project_service_update_project_grant_request import ( + ProjectServiceUpdateProjectGrantRequest as ProjectServiceUpdateProjectGrantRequest, +) +from zitadel_client.models.project_service_update_project_grant_response import ( + ProjectServiceUpdateProjectGrantResponse as ProjectServiceUpdateProjectGrantResponse, +) +from zitadel_client.models.project_service_update_project_request import ( + ProjectServiceUpdateProjectRequest as ProjectServiceUpdateProjectRequest, +) +from zitadel_client.models.project_service_update_project_response import ( + ProjectServiceUpdateProjectResponse as ProjectServiceUpdateProjectResponse, +) +from zitadel_client.models.project_service_update_project_role_request import ( + ProjectServiceUpdateProjectRoleRequest as ProjectServiceUpdateProjectRoleRequest, +) +from zitadel_client.models.project_service_update_project_role_response import ( + ProjectServiceUpdateProjectRoleResponse as ProjectServiceUpdateProjectRoleResponse, +) +from zitadel_client.models.saml_service_any import SAMLServiceAny as SAMLServiceAny +from zitadel_client.models.saml_service_authorization_error import ( + SAMLServiceAuthorizationError as SAMLServiceAuthorizationError, +) +from zitadel_client.models.saml_service_connect_error import ( + SAMLServiceConnectError as SAMLServiceConnectError, +) +from zitadel_client.models.saml_service_create_response_request import ( + SAMLServiceCreateResponseRequest as SAMLServiceCreateResponseRequest, +) +from zitadel_client.models.saml_service_create_response_response import ( + SAMLServiceCreateResponseResponse as SAMLServiceCreateResponseResponse, +) +from zitadel_client.models.saml_service_details import ( + SAMLServiceDetails as SAMLServiceDetails, +) +from zitadel_client.models.saml_service_error_reason import ( + SAMLServiceErrorReason as SAMLServiceErrorReason, +) +from zitadel_client.models.saml_service_get_saml_request_request import ( + SAMLServiceGetSAMLRequestRequest as SAMLServiceGetSAMLRequestRequest, +) +from zitadel_client.models.saml_service_get_saml_request_response import ( + SAMLServiceGetSAMLRequestResponse as SAMLServiceGetSAMLRequestResponse, +) +from zitadel_client.models.saml_service_post_response import ( + SAMLServicePostResponse as SAMLServicePostResponse, +) +from zitadel_client.models.saml_service_saml_request import ( + SAMLServiceSAMLRequest as SAMLServiceSAMLRequest, +) +from zitadel_client.models.saml_service_session import ( + SAMLServiceSession as SAMLServiceSession, +) +from zitadel_client.models.session_service_any import ( + SessionServiceAny as SessionServiceAny, +) +from zitadel_client.models.session_service_challenges import ( + SessionServiceChallenges as SessionServiceChallenges, +) +from zitadel_client.models.session_service_check_idp_intent import ( + SessionServiceCheckIDPIntent as SessionServiceCheckIDPIntent, +) +from zitadel_client.models.session_service_check_otp import ( + SessionServiceCheckOTP as SessionServiceCheckOTP, +) +from zitadel_client.models.session_service_check_password import ( + SessionServiceCheckPassword as SessionServiceCheckPassword, +) +from zitadel_client.models.session_service_check_recovery_code import ( + SessionServiceCheckRecoveryCode as SessionServiceCheckRecoveryCode, +) +from zitadel_client.models.session_service_check_totp import ( + SessionServiceCheckTOTP as SessionServiceCheckTOTP, +) +from zitadel_client.models.session_service_check_user import ( + SessionServiceCheckUser as SessionServiceCheckUser, +) +from zitadel_client.models.session_service_check_web_auth_n import ( + SessionServiceCheckWebAuthN as SessionServiceCheckWebAuthN, +) +from zitadel_client.models.session_service_checks import ( + SessionServiceChecks as SessionServiceChecks, +) +from zitadel_client.models.session_service_connect_error import ( + SessionServiceConnectError as SessionServiceConnectError, +) +from zitadel_client.models.session_service_create_session_request import ( + SessionServiceCreateSessionRequest as SessionServiceCreateSessionRequest, +) +from zitadel_client.models.session_service_create_session_response import ( + SessionServiceCreateSessionResponse as SessionServiceCreateSessionResponse, +) +from zitadel_client.models.session_service_creation_date_query import ( + SessionServiceCreationDateQuery as SessionServiceCreationDateQuery, +) +from zitadel_client.models.session_service_creator_query import ( + SessionServiceCreatorQuery as SessionServiceCreatorQuery, +) +from zitadel_client.models.session_service_delete_session_request import ( + SessionServiceDeleteSessionRequest as SessionServiceDeleteSessionRequest, +) +from zitadel_client.models.session_service_delete_session_response import ( + SessionServiceDeleteSessionResponse as SessionServiceDeleteSessionResponse, +) +from zitadel_client.models.session_service_details import ( + SessionServiceDetails as SessionServiceDetails, +) +from zitadel_client.models.session_service_expiration_date_query import ( + SessionServiceExpirationDateQuery as SessionServiceExpirationDateQuery, +) +from zitadel_client.models.session_service_factors import ( + SessionServiceFactors as SessionServiceFactors, +) +from zitadel_client.models.session_service_get_session_request import ( + SessionServiceGetSessionRequest as SessionServiceGetSessionRequest, +) +from zitadel_client.models.session_service_get_session_response import ( + SessionServiceGetSessionResponse as SessionServiceGetSessionResponse, +) +from zitadel_client.models.session_service_header_values import ( + SessionServiceHeaderValues as SessionServiceHeaderValues, +) +from zitadel_client.models.session_service_ids_query import ( + SessionServiceIDsQuery as SessionServiceIDsQuery, +) +from zitadel_client.models.session_service_intent_factor import ( + SessionServiceIntentFactor as SessionServiceIntentFactor, +) +from zitadel_client.models.session_service_list_details import ( + SessionServiceListDetails as SessionServiceListDetails, +) +from zitadel_client.models.session_service_list_query import ( + SessionServiceListQuery as SessionServiceListQuery, +) +from zitadel_client.models.session_service_list_sessions_request import ( + SessionServiceListSessionsRequest as SessionServiceListSessionsRequest, +) +from zitadel_client.models.session_service_list_sessions_response import ( + SessionServiceListSessionsResponse as SessionServiceListSessionsResponse, +) +from zitadel_client.models.session_service_otp_email import ( + SessionServiceOTPEmail as SessionServiceOTPEmail, +) +from zitadel_client.models.session_service_otp_factor import ( + SessionServiceOTPFactor as SessionServiceOTPFactor, +) +from zitadel_client.models.session_service_otpsms import ( + SessionServiceOTPSMS as SessionServiceOTPSMS, +) +from zitadel_client.models.session_service_password_factor import ( + SessionServicePasswordFactor as SessionServicePasswordFactor, +) +from zitadel_client.models.session_service_recovery_code_factor import ( + SessionServiceRecoveryCodeFactor as SessionServiceRecoveryCodeFactor, +) +from zitadel_client.models.session_service_request_challenges import ( + SessionServiceRequestChallenges as SessionServiceRequestChallenges, +) +from zitadel_client.models.session_service_search_query import ( + SessionServiceSearchQuery as SessionServiceSearchQuery, +) +from zitadel_client.models.session_service_send_code import ( + SessionServiceSendCode as SessionServiceSendCode, +) +from zitadel_client.models.session_service_session import ( + SessionServiceSession as SessionServiceSession, +) +from zitadel_client.models.session_service_session_field_name import ( + SessionServiceSessionFieldName as SessionServiceSessionFieldName, +) +from zitadel_client.models.session_service_set_session_request import ( + SessionServiceSetSessionRequest as SessionServiceSetSessionRequest, +) +from zitadel_client.models.session_service_set_session_response import ( + SessionServiceSetSessionResponse as SessionServiceSetSessionResponse, +) +from zitadel_client.models.session_service_totp_factor import ( + SessionServiceTOTPFactor as SessionServiceTOTPFactor, +) +from zitadel_client.models.session_service_timestamp_query_method import ( + SessionServiceTimestampQueryMethod as SessionServiceTimestampQueryMethod, +) +from zitadel_client.models.session_service_user_agent import ( + SessionServiceUserAgent as SessionServiceUserAgent, +) +from zitadel_client.models.session_service_user_agent_query import ( + SessionServiceUserAgentQuery as SessionServiceUserAgentQuery, +) +from zitadel_client.models.session_service_user_factor import ( + SessionServiceUserFactor as SessionServiceUserFactor, +) +from zitadel_client.models.session_service_user_id_query import ( + SessionServiceUserIDQuery as SessionServiceUserIDQuery, +) +from zitadel_client.models.session_service_user_verification_requirement import ( + SessionServiceUserVerificationRequirement as SessionServiceUserVerificationRequirement, +) +from zitadel_client.models.session_service_web_auth_n import ( + SessionServiceWebAuthN as SessionServiceWebAuthN, +) +from zitadel_client.models.session_service_web_auth_n_factor import ( + SessionServiceWebAuthNFactor as SessionServiceWebAuthNFactor, +) +from zitadel_client.models.settings_service_any import ( + SettingsServiceAny as SettingsServiceAny, +) +from zitadel_client.models.settings_service_auto_linking_option import ( + SettingsServiceAutoLinkingOption as SettingsServiceAutoLinkingOption, +) +from zitadel_client.models.settings_service_branding_settings import ( + SettingsServiceBrandingSettings as SettingsServiceBrandingSettings, +) +from zitadel_client.models.settings_service_connect_error import ( + SettingsServiceConnectError as SettingsServiceConnectError, +) +from zitadel_client.models.settings_service_details import ( + SettingsServiceDetails as SettingsServiceDetails, +) +from zitadel_client.models.settings_service_domain_settings import ( + SettingsServiceDomainSettings as SettingsServiceDomainSettings, +) +from zitadel_client.models.settings_service_embedded_iframe_settings import ( + SettingsServiceEmbeddedIframeSettings as SettingsServiceEmbeddedIframeSettings, +) +from zitadel_client.models.settings_service_get_active_identity_providers_request import ( + SettingsServiceGetActiveIdentityProvidersRequest as SettingsServiceGetActiveIdentityProvidersRequest, +) +from zitadel_client.models.settings_service_get_active_identity_providers_response import ( + SettingsServiceGetActiveIdentityProvidersResponse as SettingsServiceGetActiveIdentityProvidersResponse, +) +from zitadel_client.models.settings_service_get_branding_settings_request import ( + SettingsServiceGetBrandingSettingsRequest as SettingsServiceGetBrandingSettingsRequest, +) +from zitadel_client.models.settings_service_get_branding_settings_response import ( + SettingsServiceGetBrandingSettingsResponse as SettingsServiceGetBrandingSettingsResponse, +) +from zitadel_client.models.settings_service_get_domain_settings_request import ( + SettingsServiceGetDomainSettingsRequest as SettingsServiceGetDomainSettingsRequest, +) +from zitadel_client.models.settings_service_get_domain_settings_response import ( + SettingsServiceGetDomainSettingsResponse as SettingsServiceGetDomainSettingsResponse, +) +from zitadel_client.models.settings_service_get_general_settings_response import ( + SettingsServiceGetGeneralSettingsResponse as SettingsServiceGetGeneralSettingsResponse, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_request import ( + SettingsServiceGetHostedLoginTranslationRequest as SettingsServiceGetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_get_hosted_login_translation_response import ( + SettingsServiceGetHostedLoginTranslationResponse as SettingsServiceGetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_request import ( + SettingsServiceGetLegalAndSupportSettingsRequest as SettingsServiceGetLegalAndSupportSettingsRequest, +) +from zitadel_client.models.settings_service_get_legal_and_support_settings_response import ( + SettingsServiceGetLegalAndSupportSettingsResponse as SettingsServiceGetLegalAndSupportSettingsResponse, +) +from zitadel_client.models.settings_service_get_lockout_settings_request import ( + SettingsServiceGetLockoutSettingsRequest as SettingsServiceGetLockoutSettingsRequest, +) +from zitadel_client.models.settings_service_get_lockout_settings_response import ( + SettingsServiceGetLockoutSettingsResponse as SettingsServiceGetLockoutSettingsResponse, +) +from zitadel_client.models.settings_service_get_login_settings_request import ( + SettingsServiceGetLoginSettingsRequest as SettingsServiceGetLoginSettingsRequest, +) +from zitadel_client.models.settings_service_get_login_settings_response import ( + SettingsServiceGetLoginSettingsResponse as SettingsServiceGetLoginSettingsResponse, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_request import ( + SettingsServiceGetPasswordComplexitySettingsRequest as SettingsServiceGetPasswordComplexitySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_complexity_settings_response import ( + SettingsServiceGetPasswordComplexitySettingsResponse as SettingsServiceGetPasswordComplexitySettingsResponse, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_request import ( + SettingsServiceGetPasswordExpirySettingsRequest as SettingsServiceGetPasswordExpirySettingsRequest, +) +from zitadel_client.models.settings_service_get_password_expiry_settings_response import ( + SettingsServiceGetPasswordExpirySettingsResponse as SettingsServiceGetPasswordExpirySettingsResponse, +) +from zitadel_client.models.settings_service_get_security_settings_response import ( + SettingsServiceGetSecuritySettingsResponse as SettingsServiceGetSecuritySettingsResponse, +) +from zitadel_client.models.settings_service_identity_provider import ( + SettingsServiceIdentityProvider as SettingsServiceIdentityProvider, +) +from zitadel_client.models.settings_service_identity_provider_type import ( + SettingsServiceIdentityProviderType as SettingsServiceIdentityProviderType, +) +from zitadel_client.models.settings_service_legal_and_support_settings import ( + SettingsServiceLegalAndSupportSettings as SettingsServiceLegalAndSupportSettings, +) +from zitadel_client.models.settings_service_list_details import ( + SettingsServiceListDetails as SettingsServiceListDetails, +) +from zitadel_client.models.settings_service_lockout_settings import ( + SettingsServiceLockoutSettings as SettingsServiceLockoutSettings, +) +from zitadel_client.models.settings_service_login_settings import ( + SettingsServiceLoginSettings as SettingsServiceLoginSettings, +) +from zitadel_client.models.settings_service_multi_factor_type import ( + SettingsServiceMultiFactorType as SettingsServiceMultiFactorType, +) +from zitadel_client.models.settings_service_options import ( + SettingsServiceOptions as SettingsServiceOptions, +) +from zitadel_client.models.settings_service_passkeys_type import ( + SettingsServicePasskeysType as SettingsServicePasskeysType, +) +from zitadel_client.models.settings_service_password_complexity_settings import ( + SettingsServicePasswordComplexitySettings as SettingsServicePasswordComplexitySettings, +) +from zitadel_client.models.settings_service_password_expiry_settings import ( + SettingsServicePasswordExpirySettings as SettingsServicePasswordExpirySettings, +) +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext as SettingsServiceRequestContext, +) +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType as SettingsServiceResourceOwnerType, +) +from zitadel_client.models.settings_service_second_factor_type import ( + SettingsServiceSecondFactorType as SettingsServiceSecondFactorType, +) +from zitadel_client.models.settings_service_security_settings import ( + SettingsServiceSecuritySettings as SettingsServiceSecuritySettings, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_request import ( + SettingsServiceSetHostedLoginTranslationRequest as SettingsServiceSetHostedLoginTranslationRequest, +) +from zitadel_client.models.settings_service_set_hosted_login_translation_response import ( + SettingsServiceSetHostedLoginTranslationResponse as SettingsServiceSetHostedLoginTranslationResponse, +) +from zitadel_client.models.settings_service_set_security_settings_request import ( + SettingsServiceSetSecuritySettingsRequest as SettingsServiceSetSecuritySettingsRequest, +) +from zitadel_client.models.settings_service_set_security_settings_response import ( + SettingsServiceSetSecuritySettingsResponse as SettingsServiceSetSecuritySettingsResponse, +) +from zitadel_client.models.settings_service_theme import ( + SettingsServiceTheme as SettingsServiceTheme, +) +from zitadel_client.models.settings_service_theme_mode import ( + SettingsServiceThemeMode as SettingsServiceThemeMode, +) +from zitadel_client.models.user_service_access_token_type import ( + UserServiceAccessTokenType as UserServiceAccessTokenType, +) +from zitadel_client.models.user_service_add_human_user_request import ( + UserServiceAddHumanUserRequest as UserServiceAddHumanUserRequest, +) +from zitadel_client.models.user_service_add_human_user_response import ( + UserServiceAddHumanUserResponse as UserServiceAddHumanUserResponse, +) +from zitadel_client.models.user_service_add_idp_link_request import ( + UserServiceAddIDPLinkRequest as UserServiceAddIDPLinkRequest, +) +from zitadel_client.models.user_service_add_idp_link_response import ( + UserServiceAddIDPLinkResponse as UserServiceAddIDPLinkResponse, +) +from zitadel_client.models.user_service_add_key_request import ( + UserServiceAddKeyRequest as UserServiceAddKeyRequest, +) +from zitadel_client.models.user_service_add_key_response import ( + UserServiceAddKeyResponse as UserServiceAddKeyResponse, +) +from zitadel_client.models.user_service_add_otp_email_request import ( + UserServiceAddOTPEmailRequest as UserServiceAddOTPEmailRequest, +) +from zitadel_client.models.user_service_add_otp_email_response import ( + UserServiceAddOTPEmailResponse as UserServiceAddOTPEmailResponse, +) +from zitadel_client.models.user_service_add_otpsms_request import ( + UserServiceAddOTPSMSRequest as UserServiceAddOTPSMSRequest, +) +from zitadel_client.models.user_service_add_otpsms_response import ( + UserServiceAddOTPSMSResponse as UserServiceAddOTPSMSResponse, +) +from zitadel_client.models.user_service_add_personal_access_token_request import ( + UserServiceAddPersonalAccessTokenRequest as UserServiceAddPersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_add_personal_access_token_response import ( + UserServiceAddPersonalAccessTokenResponse as UserServiceAddPersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_add_secret_request import ( + UserServiceAddSecretRequest as UserServiceAddSecretRequest, +) +from zitadel_client.models.user_service_add_secret_response import ( + UserServiceAddSecretResponse as UserServiceAddSecretResponse, +) +from zitadel_client.models.user_service_and_query import ( + UserServiceAndQuery as UserServiceAndQuery, +) +from zitadel_client.models.user_service_any import UserServiceAny as UserServiceAny +from zitadel_client.models.user_service_auth_factor import ( + UserServiceAuthFactor as UserServiceAuthFactor, +) +from zitadel_client.models.user_service_auth_factor_state import ( + UserServiceAuthFactorState as UserServiceAuthFactorState, +) +from zitadel_client.models.user_service_auth_factor_u2_f import ( + UserServiceAuthFactorU2F as UserServiceAuthFactorU2F, +) +from zitadel_client.models.user_service_auth_factors import ( + UserServiceAuthFactors as UserServiceAuthFactors, +) +from zitadel_client.models.user_service_authentication_method_type import ( + UserServiceAuthenticationMethodType as UserServiceAuthenticationMethodType, +) +from zitadel_client.models.user_service_byte_filter_method import ( + UserServiceByteFilterMethod as UserServiceByteFilterMethod, +) +from zitadel_client.models.user_service_connect_error import ( + UserServiceConnectError as UserServiceConnectError, +) +from zitadel_client.models.user_service_create_invite_code_request import ( + UserServiceCreateInviteCodeRequest as UserServiceCreateInviteCodeRequest, +) +from zitadel_client.models.user_service_create_invite_code_response import ( + UserServiceCreateInviteCodeResponse as UserServiceCreateInviteCodeResponse, +) +from zitadel_client.models.user_service_create_passkey_registration_link_request import ( + UserServiceCreatePasskeyRegistrationLinkRequest as UserServiceCreatePasskeyRegistrationLinkRequest, +) +from zitadel_client.models.user_service_create_passkey_registration_link_response import ( + UserServiceCreatePasskeyRegistrationLinkResponse as UserServiceCreatePasskeyRegistrationLinkResponse, +) +from zitadel_client.models.user_service_create_user_request import ( + UserServiceCreateUserRequest as UserServiceCreateUserRequest, +) +from zitadel_client.models.user_service_create_user_response import ( + UserServiceCreateUserResponse as UserServiceCreateUserResponse, +) +from zitadel_client.models.user_service_deactivate_user_request import ( + UserServiceDeactivateUserRequest as UserServiceDeactivateUserRequest, +) +from zitadel_client.models.user_service_deactivate_user_response import ( + UserServiceDeactivateUserResponse as UserServiceDeactivateUserResponse, +) +from zitadel_client.models.user_service_delete_user_metadata_request import ( + UserServiceDeleteUserMetadataRequest as UserServiceDeleteUserMetadataRequest, +) +from zitadel_client.models.user_service_delete_user_metadata_response import ( + UserServiceDeleteUserMetadataResponse as UserServiceDeleteUserMetadataResponse, +) +from zitadel_client.models.user_service_delete_user_request import ( + UserServiceDeleteUserRequest as UserServiceDeleteUserRequest, +) +from zitadel_client.models.user_service_delete_user_response import ( + UserServiceDeleteUserResponse as UserServiceDeleteUserResponse, +) +from zitadel_client.models.user_service_details import ( + UserServiceDetails as UserServiceDetails, +) +from zitadel_client.models.user_service_display_name_query import ( + UserServiceDisplayNameQuery as UserServiceDisplayNameQuery, +) +from zitadel_client.models.user_service_domain_query import ( + UserServiceDomainQuery as UserServiceDomainQuery, +) +from zitadel_client.models.user_service_email_query import ( + UserServiceEmailQuery as UserServiceEmailQuery, +) +from zitadel_client.models.user_service_first_name_query import ( + UserServiceFirstNameQuery as UserServiceFirstNameQuery, +) +from zitadel_client.models.user_service_form_data import ( + UserServiceFormData as UserServiceFormData, +) +from zitadel_client.models.user_service_gender import ( + UserServiceGender as UserServiceGender, +) +from zitadel_client.models.user_service_generate_recovery_codes_request import ( + UserServiceGenerateRecoveryCodesRequest as UserServiceGenerateRecoveryCodesRequest, +) +from zitadel_client.models.user_service_generate_recovery_codes_response import ( + UserServiceGenerateRecoveryCodesResponse as UserServiceGenerateRecoveryCodesResponse, +) +from zitadel_client.models.user_service_get_user_by_id_request import ( + UserServiceGetUserByIDRequest as UserServiceGetUserByIDRequest, +) +from zitadel_client.models.user_service_get_user_by_id_response import ( + UserServiceGetUserByIDResponse as UserServiceGetUserByIDResponse, +) +from zitadel_client.models.user_service_hashed_password import ( + UserServiceHashedPassword as UserServiceHashedPassword, +) +from zitadel_client.models.user_service_human import ( + UserServiceHuman as UserServiceHuman, +) +from zitadel_client.models.user_service_human_email import ( + UserServiceHumanEmail as UserServiceHumanEmail, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_request import ( + UserServiceHumanMFAInitSkippedRequest as UserServiceHumanMFAInitSkippedRequest, +) +from zitadel_client.models.user_service_human_mfa_init_skipped_response import ( + UserServiceHumanMFAInitSkippedResponse as UserServiceHumanMFAInitSkippedResponse, +) +from zitadel_client.models.user_service_human_phone import ( + UserServiceHumanPhone as UserServiceHumanPhone, +) +from zitadel_client.models.user_service_human_profile import ( + UserServiceHumanProfile as UserServiceHumanProfile, +) +from zitadel_client.models.user_service_human_user import ( + UserServiceHumanUser as UserServiceHumanUser, +) +from zitadel_client.models.user_service_id_filter import ( + UserServiceIDFilter as UserServiceIDFilter, +) +from zitadel_client.models.user_service_idp_information import ( + UserServiceIDPInformation as UserServiceIDPInformation, +) +from zitadel_client.models.user_service_idp_intent import ( + UserServiceIDPIntent as UserServiceIDPIntent, +) +from zitadel_client.models.user_service_idpldap_access_information import ( + UserServiceIDPLDAPAccessInformation as UserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.user_service_idp_link import ( + UserServiceIDPLink as UserServiceIDPLink, +) +from zitadel_client.models.user_service_idpo_auth_access_information import ( + UserServiceIDPOAuthAccessInformation as UserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.user_service_idpsaml_access_information import ( + UserServiceIDPSAMLAccessInformation as UserServiceIDPSAMLAccessInformation, +) +from zitadel_client.models.user_service_in_user_emails_query import ( + UserServiceInUserEmailsQuery as UserServiceInUserEmailsQuery, +) +from zitadel_client.models.user_service_in_user_id_query import ( + UserServiceInUserIDQuery as UserServiceInUserIDQuery, +) +from zitadel_client.models.user_service_key import UserServiceKey as UserServiceKey +from zitadel_client.models.user_service_key_field_name import ( + UserServiceKeyFieldName as UserServiceKeyFieldName, +) +from zitadel_client.models.user_service_keys_search_filter import ( + UserServiceKeysSearchFilter as UserServiceKeysSearchFilter, +) +from zitadel_client.models.user_service_ldap_credentials import ( + UserServiceLDAPCredentials as UserServiceLDAPCredentials, +) +from zitadel_client.models.user_service_last_name_query import ( + UserServiceLastNameQuery as UserServiceLastNameQuery, +) +from zitadel_client.models.user_service_list_authentication_factors_request import ( + UserServiceListAuthenticationFactorsRequest as UserServiceListAuthenticationFactorsRequest, +) +from zitadel_client.models.user_service_list_authentication_factors_response import ( + UserServiceListAuthenticationFactorsResponse as UserServiceListAuthenticationFactorsResponse, +) +from zitadel_client.models.user_service_list_authentication_method_types_request import ( + UserServiceListAuthenticationMethodTypesRequest as UserServiceListAuthenticationMethodTypesRequest, +) +from zitadel_client.models.user_service_list_authentication_method_types_response import ( + UserServiceListAuthenticationMethodTypesResponse as UserServiceListAuthenticationMethodTypesResponse, +) +from zitadel_client.models.user_service_list_details import ( + UserServiceListDetails as UserServiceListDetails, +) +from zitadel_client.models.user_service_list_idp_links_request import ( + UserServiceListIDPLinksRequest as UserServiceListIDPLinksRequest, +) +from zitadel_client.models.user_service_list_idp_links_response import ( + UserServiceListIDPLinksResponse as UserServiceListIDPLinksResponse, +) +from zitadel_client.models.user_service_list_keys_request import ( + UserServiceListKeysRequest as UserServiceListKeysRequest, +) +from zitadel_client.models.user_service_list_keys_response import ( + UserServiceListKeysResponse as UserServiceListKeysResponse, +) +from zitadel_client.models.user_service_list_passkeys_request import ( + UserServiceListPasskeysRequest as UserServiceListPasskeysRequest, +) +from zitadel_client.models.user_service_list_passkeys_response import ( + UserServiceListPasskeysResponse as UserServiceListPasskeysResponse, +) +from zitadel_client.models.user_service_list_personal_access_tokens_request import ( + UserServiceListPersonalAccessTokensRequest as UserServiceListPersonalAccessTokensRequest, +) +from zitadel_client.models.user_service_list_personal_access_tokens_response import ( + UserServiceListPersonalAccessTokensResponse as UserServiceListPersonalAccessTokensResponse, +) +from zitadel_client.models.user_service_list_query import ( + UserServiceListQuery as UserServiceListQuery, +) +from zitadel_client.models.user_service_list_user_metadata_request import ( + UserServiceListUserMetadataRequest as UserServiceListUserMetadataRequest, +) +from zitadel_client.models.user_service_list_user_metadata_response import ( + UserServiceListUserMetadataResponse as UserServiceListUserMetadataResponse, +) +from zitadel_client.models.user_service_list_users_request import ( + UserServiceListUsersRequest as UserServiceListUsersRequest, +) +from zitadel_client.models.user_service_list_users_response import ( + UserServiceListUsersResponse as UserServiceListUsersResponse, +) +from zitadel_client.models.user_service_lock_user_request import ( + UserServiceLockUserRequest as UserServiceLockUserRequest, +) +from zitadel_client.models.user_service_lock_user_response import ( + UserServiceLockUserResponse as UserServiceLockUserResponse, +) +from zitadel_client.models.user_service_login_name_query import ( + UserServiceLoginNameQuery as UserServiceLoginNameQuery, +) +from zitadel_client.models.user_service_machine import ( + UserServiceMachine as UserServiceMachine, +) +from zitadel_client.models.user_service_machine_user import ( + UserServiceMachineUser as UserServiceMachineUser, +) +from zitadel_client.models.user_service_metadata import ( + UserServiceMetadata as UserServiceMetadata, +) +from zitadel_client.models.user_service_metadata_key_filter import ( + UserServiceMetadataKeyFilter as UserServiceMetadataKeyFilter, +) +from zitadel_client.models.user_service_metadata_search_filter import ( + UserServiceMetadataSearchFilter as UserServiceMetadataSearchFilter, +) +from zitadel_client.models.user_service_metadata_value_filter import ( + UserServiceMetadataValueFilter as UserServiceMetadataValueFilter, +) +from zitadel_client.models.user_service_nick_name_query import ( + UserServiceNickNameQuery as UserServiceNickNameQuery, +) +from zitadel_client.models.user_service_not_query import ( + UserServiceNotQuery as UserServiceNotQuery, +) +from zitadel_client.models.user_service_notification_type import ( + UserServiceNotificationType as UserServiceNotificationType, +) +from zitadel_client.models.user_service_or_query import ( + UserServiceOrQuery as UserServiceOrQuery, +) +from zitadel_client.models.user_service_organization import ( + UserServiceOrganization as UserServiceOrganization, +) +from zitadel_client.models.user_service_organization_id_query import ( + UserServiceOrganizationIdQuery as UserServiceOrganizationIdQuery, +) +from zitadel_client.models.user_service_pagination_request import ( + UserServicePaginationRequest as UserServicePaginationRequest, +) +from zitadel_client.models.user_service_pagination_response import ( + UserServicePaginationResponse as UserServicePaginationResponse, +) +from zitadel_client.models.user_service_passkey import ( + UserServicePasskey as UserServicePasskey, +) +from zitadel_client.models.user_service_passkey_authenticator import ( + UserServicePasskeyAuthenticator as UserServicePasskeyAuthenticator, +) +from zitadel_client.models.user_service_passkey_registration_code import ( + UserServicePasskeyRegistrationCode as UserServicePasskeyRegistrationCode, +) +from zitadel_client.models.user_service_password import ( + UserServicePassword as UserServicePassword, +) +from zitadel_client.models.user_service_password_reset_request import ( + UserServicePasswordResetRequest as UserServicePasswordResetRequest, +) +from zitadel_client.models.user_service_password_reset_response import ( + UserServicePasswordResetResponse as UserServicePasswordResetResponse, +) +from zitadel_client.models.user_service_personal_access_token import ( + UserServicePersonalAccessToken as UserServicePersonalAccessToken, +) +from zitadel_client.models.user_service_personal_access_token_field_name import ( + UserServicePersonalAccessTokenFieldName as UserServicePersonalAccessTokenFieldName, +) +from zitadel_client.models.user_service_personal_access_tokens_search_filter import ( + UserServicePersonalAccessTokensSearchFilter as UserServicePersonalAccessTokensSearchFilter, +) +from zitadel_client.models.user_service_phone_query import ( + UserServicePhoneQuery as UserServicePhoneQuery, +) +from zitadel_client.models.user_service_profile import ( + UserServiceProfile as UserServiceProfile, +) +from zitadel_client.models.user_service_reactivate_user_request import ( + UserServiceReactivateUserRequest as UserServiceReactivateUserRequest, +) +from zitadel_client.models.user_service_reactivate_user_response import ( + UserServiceReactivateUserResponse as UserServiceReactivateUserResponse, +) +from zitadel_client.models.user_service_redirect_urls import ( + UserServiceRedirectURLs as UserServiceRedirectURLs, +) +from zitadel_client.models.user_service_register_passkey_request import ( + UserServiceRegisterPasskeyRequest as UserServiceRegisterPasskeyRequest, +) +from zitadel_client.models.user_service_register_passkey_response import ( + UserServiceRegisterPasskeyResponse as UserServiceRegisterPasskeyResponse, +) +from zitadel_client.models.user_service_register_totp_request import ( + UserServiceRegisterTOTPRequest as UserServiceRegisterTOTPRequest, +) +from zitadel_client.models.user_service_register_totp_response import ( + UserServiceRegisterTOTPResponse as UserServiceRegisterTOTPResponse, +) +from zitadel_client.models.user_service_register_u2_f_request import ( + UserServiceRegisterU2FRequest as UserServiceRegisterU2FRequest, +) +from zitadel_client.models.user_service_register_u2_f_response import ( + UserServiceRegisterU2FResponse as UserServiceRegisterU2FResponse, +) +from zitadel_client.models.user_service_remove_idp_link_request import ( + UserServiceRemoveIDPLinkRequest as UserServiceRemoveIDPLinkRequest, +) +from zitadel_client.models.user_service_remove_idp_link_response import ( + UserServiceRemoveIDPLinkResponse as UserServiceRemoveIDPLinkResponse, +) +from zitadel_client.models.user_service_remove_key_request import ( + UserServiceRemoveKeyRequest as UserServiceRemoveKeyRequest, +) +from zitadel_client.models.user_service_remove_key_response import ( + UserServiceRemoveKeyResponse as UserServiceRemoveKeyResponse, +) +from zitadel_client.models.user_service_remove_otp_email_request import ( + UserServiceRemoveOTPEmailRequest as UserServiceRemoveOTPEmailRequest, +) +from zitadel_client.models.user_service_remove_otp_email_response import ( + UserServiceRemoveOTPEmailResponse as UserServiceRemoveOTPEmailResponse, +) +from zitadel_client.models.user_service_remove_otpsms_request import ( + UserServiceRemoveOTPSMSRequest as UserServiceRemoveOTPSMSRequest, +) +from zitadel_client.models.user_service_remove_otpsms_response import ( + UserServiceRemoveOTPSMSResponse as UserServiceRemoveOTPSMSResponse, +) +from zitadel_client.models.user_service_remove_passkey_request import ( + UserServiceRemovePasskeyRequest as UserServiceRemovePasskeyRequest, +) +from zitadel_client.models.user_service_remove_passkey_response import ( + UserServiceRemovePasskeyResponse as UserServiceRemovePasskeyResponse, +) +from zitadel_client.models.user_service_remove_personal_access_token_request import ( + UserServiceRemovePersonalAccessTokenRequest as UserServiceRemovePersonalAccessTokenRequest, +) +from zitadel_client.models.user_service_remove_personal_access_token_response import ( + UserServiceRemovePersonalAccessTokenResponse as UserServiceRemovePersonalAccessTokenResponse, +) +from zitadel_client.models.user_service_remove_phone_request import ( + UserServiceRemovePhoneRequest as UserServiceRemovePhoneRequest, +) +from zitadel_client.models.user_service_remove_phone_response import ( + UserServiceRemovePhoneResponse as UserServiceRemovePhoneResponse, +) +from zitadel_client.models.user_service_remove_recovery_codes_request import ( + UserServiceRemoveRecoveryCodesRequest as UserServiceRemoveRecoveryCodesRequest, +) +from zitadel_client.models.user_service_remove_recovery_codes_response import ( + UserServiceRemoveRecoveryCodesResponse as UserServiceRemoveRecoveryCodesResponse, +) +from zitadel_client.models.user_service_remove_secret_request import ( + UserServiceRemoveSecretRequest as UserServiceRemoveSecretRequest, +) +from zitadel_client.models.user_service_remove_secret_response import ( + UserServiceRemoveSecretResponse as UserServiceRemoveSecretResponse, +) +from zitadel_client.models.user_service_remove_totp_request import ( + UserServiceRemoveTOTPRequest as UserServiceRemoveTOTPRequest, +) +from zitadel_client.models.user_service_remove_totp_response import ( + UserServiceRemoveTOTPResponse as UserServiceRemoveTOTPResponse, +) +from zitadel_client.models.user_service_remove_u2_f_request import ( + UserServiceRemoveU2FRequest as UserServiceRemoveU2FRequest, +) +from zitadel_client.models.user_service_remove_u2_f_response import ( + UserServiceRemoveU2FResponse as UserServiceRemoveU2FResponse, +) +from zitadel_client.models.user_service_resend_email_code_request import ( + UserServiceResendEmailCodeRequest as UserServiceResendEmailCodeRequest, +) +from zitadel_client.models.user_service_resend_email_code_response import ( + UserServiceResendEmailCodeResponse as UserServiceResendEmailCodeResponse, +) +from zitadel_client.models.user_service_resend_invite_code_request import ( + UserServiceResendInviteCodeRequest as UserServiceResendInviteCodeRequest, +) +from zitadel_client.models.user_service_resend_invite_code_response import ( + UserServiceResendInviteCodeResponse as UserServiceResendInviteCodeResponse, +) +from zitadel_client.models.user_service_resend_phone_code_request import ( + UserServiceResendPhoneCodeRequest as UserServiceResendPhoneCodeRequest, +) +from zitadel_client.models.user_service_resend_phone_code_response import ( + UserServiceResendPhoneCodeResponse as UserServiceResendPhoneCodeResponse, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_request import ( + UserServiceRetrieveIdentityProviderIntentRequest as UserServiceRetrieveIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_retrieve_identity_provider_intent_response import ( + UserServiceRetrieveIdentityProviderIntentResponse as UserServiceRetrieveIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_search_query import ( + UserServiceSearchQuery as UserServiceSearchQuery, +) +from zitadel_client.models.user_service_send_email_code_request import ( + UserServiceSendEmailCodeRequest as UserServiceSendEmailCodeRequest, +) +from zitadel_client.models.user_service_send_email_code_response import ( + UserServiceSendEmailCodeResponse as UserServiceSendEmailCodeResponse, +) +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode as UserServiceSendEmailVerificationCode, +) +from zitadel_client.models.user_service_send_invite_code import ( + UserServiceSendInviteCode as UserServiceSendInviteCode, +) +from zitadel_client.models.user_service_send_passkey_registration_link import ( + UserServiceSendPasskeyRegistrationLink as UserServiceSendPasskeyRegistrationLink, +) +from zitadel_client.models.user_service_send_password_reset_link import ( + UserServiceSendPasswordResetLink as UserServiceSendPasswordResetLink, +) +from zitadel_client.models.user_service_set_email_request import ( + UserServiceSetEmailRequest as UserServiceSetEmailRequest, +) +from zitadel_client.models.user_service_set_email_response import ( + UserServiceSetEmailResponse as UserServiceSetEmailResponse, +) +from zitadel_client.models.user_service_set_human_email import ( + UserServiceSetHumanEmail as UserServiceSetHumanEmail, +) +from zitadel_client.models.user_service_set_human_phone import ( + UserServiceSetHumanPhone as UserServiceSetHumanPhone, +) +from zitadel_client.models.user_service_set_human_profile import ( + UserServiceSetHumanProfile as UserServiceSetHumanProfile, +) +from zitadel_client.models.user_service_set_metadata_entry import ( + UserServiceSetMetadataEntry as UserServiceSetMetadataEntry, +) +from zitadel_client.models.user_service_set_password import ( + UserServiceSetPassword as UserServiceSetPassword, +) +from zitadel_client.models.user_service_set_password_request import ( + UserServiceSetPasswordRequest as UserServiceSetPasswordRequest, +) +from zitadel_client.models.user_service_set_password_response import ( + UserServiceSetPasswordResponse as UserServiceSetPasswordResponse, +) +from zitadel_client.models.user_service_set_phone_request import ( + UserServiceSetPhoneRequest as UserServiceSetPhoneRequest, +) +from zitadel_client.models.user_service_set_phone_response import ( + UserServiceSetPhoneResponse as UserServiceSetPhoneResponse, +) +from zitadel_client.models.user_service_set_user_metadata_request import ( + UserServiceSetUserMetadataRequest as UserServiceSetUserMetadataRequest, +) +from zitadel_client.models.user_service_set_user_metadata_response import ( + UserServiceSetUserMetadataResponse as UserServiceSetUserMetadataResponse, +) +from zitadel_client.models.user_service_start_identity_provider_intent_request import ( + UserServiceStartIdentityProviderIntentRequest as UserServiceStartIdentityProviderIntentRequest, +) +from zitadel_client.models.user_service_start_identity_provider_intent_response import ( + UserServiceStartIdentityProviderIntentResponse as UserServiceStartIdentityProviderIntentResponse, +) +from zitadel_client.models.user_service_state_query import ( + UserServiceStateQuery as UserServiceStateQuery, +) +from zitadel_client.models.user_service_text_filter_method import ( + UserServiceTextFilterMethod as UserServiceTextFilterMethod, +) +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod as UserServiceTextQueryMethod, +) +from zitadel_client.models.user_service_timestamp_filter import ( + UserServiceTimestampFilter as UserServiceTimestampFilter, +) +from zitadel_client.models.user_service_timestamp_filter_method import ( + UserServiceTimestampFilterMethod as UserServiceTimestampFilterMethod, +) +from zitadel_client.models.user_service_type import UserServiceType as UserServiceType +from zitadel_client.models.user_service_type_query import ( + UserServiceTypeQuery as UserServiceTypeQuery, +) +from zitadel_client.models.user_service_unlock_user_request import ( + UserServiceUnlockUserRequest as UserServiceUnlockUserRequest, +) +from zitadel_client.models.user_service_unlock_user_response import ( + UserServiceUnlockUserResponse as UserServiceUnlockUserResponse, +) +from zitadel_client.models.user_service_update_human_user_request import ( + UserServiceUpdateHumanUserRequest as UserServiceUpdateHumanUserRequest, +) +from zitadel_client.models.user_service_update_human_user_response import ( + UserServiceUpdateHumanUserResponse as UserServiceUpdateHumanUserResponse, +) +from zitadel_client.models.user_service_update_user_request import ( + UserServiceUpdateUserRequest as UserServiceUpdateUserRequest, +) +from zitadel_client.models.user_service_update_user_response import ( + UserServiceUpdateUserResponse as UserServiceUpdateUserResponse, +) +from zitadel_client.models.user_service_user import UserServiceUser as UserServiceUser +from zitadel_client.models.user_service_user_field_name import ( + UserServiceUserFieldName as UserServiceUserFieldName, +) +from zitadel_client.models.user_service_user_name_query import ( + UserServiceUserNameQuery as UserServiceUserNameQuery, +) +from zitadel_client.models.user_service_user_state import ( + UserServiceUserState as UserServiceUserState, +) +from zitadel_client.models.user_service_verify_email_request import ( + UserServiceVerifyEmailRequest as UserServiceVerifyEmailRequest, +) +from zitadel_client.models.user_service_verify_email_response import ( + UserServiceVerifyEmailResponse as UserServiceVerifyEmailResponse, +) +from zitadel_client.models.user_service_verify_invite_code_request import ( + UserServiceVerifyInviteCodeRequest as UserServiceVerifyInviteCodeRequest, +) +from zitadel_client.models.user_service_verify_invite_code_response import ( + UserServiceVerifyInviteCodeResponse as UserServiceVerifyInviteCodeResponse, +) +from zitadel_client.models.user_service_verify_passkey_registration_request import ( + UserServiceVerifyPasskeyRegistrationRequest as UserServiceVerifyPasskeyRegistrationRequest, +) +from zitadel_client.models.user_service_verify_passkey_registration_response import ( + UserServiceVerifyPasskeyRegistrationResponse as UserServiceVerifyPasskeyRegistrationResponse, +) +from zitadel_client.models.user_service_verify_phone_request import ( + UserServiceVerifyPhoneRequest as UserServiceVerifyPhoneRequest, +) +from zitadel_client.models.user_service_verify_phone_response import ( + UserServiceVerifyPhoneResponse as UserServiceVerifyPhoneResponse, +) +from zitadel_client.models.user_service_verify_totp_registration_request import ( + UserServiceVerifyTOTPRegistrationRequest as UserServiceVerifyTOTPRegistrationRequest, +) +from zitadel_client.models.user_service_verify_totp_registration_response import ( + UserServiceVerifyTOTPRegistrationResponse as UserServiceVerifyTOTPRegistrationResponse, +) +from zitadel_client.models.user_service_verify_u2_f_registration_request import ( + UserServiceVerifyU2FRegistrationRequest as UserServiceVerifyU2FRegistrationRequest, +) +from zitadel_client.models.user_service_verify_u2_f_registration_response import ( + UserServiceVerifyU2FRegistrationResponse as UserServiceVerifyU2FRegistrationResponse, +) +from zitadel_client.models.web_key_service_activate_web_key_request import ( + WebKeyServiceActivateWebKeyRequest as WebKeyServiceActivateWebKeyRequest, +) +from zitadel_client.models.web_key_service_activate_web_key_response import ( + WebKeyServiceActivateWebKeyResponse as WebKeyServiceActivateWebKeyResponse, +) +from zitadel_client.models.web_key_service_any import ( + WebKeyServiceAny as WebKeyServiceAny, +) +from zitadel_client.models.web_key_service_connect_error import ( + WebKeyServiceConnectError as WebKeyServiceConnectError, +) +from zitadel_client.models.web_key_service_create_web_key_request import ( + WebKeyServiceCreateWebKeyRequest as WebKeyServiceCreateWebKeyRequest, +) +from zitadel_client.models.web_key_service_create_web_key_response import ( + WebKeyServiceCreateWebKeyResponse as WebKeyServiceCreateWebKeyResponse, +) +from zitadel_client.models.web_key_service_delete_web_key_request import ( + WebKeyServiceDeleteWebKeyRequest as WebKeyServiceDeleteWebKeyRequest, +) +from zitadel_client.models.web_key_service_delete_web_key_response import ( + WebKeyServiceDeleteWebKeyResponse as WebKeyServiceDeleteWebKeyResponse, +) +from zitadel_client.models.web_key_service_ecdsa import ( + WebKeyServiceECDSA as WebKeyServiceECDSA, +) +from zitadel_client.models.web_key_service_ecdsa_curve import ( + WebKeyServiceECDSACurve as WebKeyServiceECDSACurve, +) +from zitadel_client.models.web_key_service_list_web_keys_response import ( + WebKeyServiceListWebKeysResponse as WebKeyServiceListWebKeysResponse, +) +from zitadel_client.models.web_key_service_rsa import ( + WebKeyServiceRSA as WebKeyServiceRSA, +) +from zitadel_client.models.web_key_service_rsa_bits import ( + WebKeyServiceRSABits as WebKeyServiceRSABits, +) +from zitadel_client.models.web_key_service_rsa_hasher import ( + WebKeyServiceRSAHasher as WebKeyServiceRSAHasher, +) +from zitadel_client.models.web_key_service_state import ( + WebKeyServiceState as WebKeyServiceState, +) +from zitadel_client.models.web_key_service_web_key import ( + WebKeyServiceWebKey as WebKeyServiceWebKey, +) diff --git a/zitadel_client/models/action_service_activate_public_key_request.py b/zitadel_client/models/action_service_activate_public_key_request.py index d35be512..fbfa9198 100644 --- a/zitadel_client/models/action_service_activate_public_key_request.py +++ b/zitadel_client/models/action_service_activate_public_key_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceActivatePublicKeyRequest(BaseModel): """ ActionServiceActivatePublicKeyRequest - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="TargetID is the unique identifier of the target to activate the public key for.", alias="targetId") - key_id: Optional[StrictStr] = Field(default=None, description="KeyID is the unique identifier of the public key to activate.", alias="keyId") - __properties: ClassVar[List[str]] = ["targetId", "keyId"] + """ + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="TargetID is the unique identifier of the target to activate the public key for.", + ) + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="KeyID is the unique identifier of the public key to activate.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ActionServiceActivatePublicKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceActivatePublicKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceActivatePublicKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId"), - "keyId": obj.get("keyId") - }) - return _obj - - +ActionServiceActivatePublicKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_activate_public_key_response.py b/zitadel_client/models/action_service_activate_public_key_response.py index ce61bd45..b74f93c0 100644 --- a/zitadel_client/models/action_service_activate_public_key_response.py +++ b/zitadel_client/models/action_service_activate_public_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceActivatePublicKeyResponse(BaseModel): """ ActionServiceActivatePublicKeyResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ActionServiceActivatePublicKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceActivatePublicKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceActivatePublicKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceActivatePublicKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_add_public_key_request.py b/zitadel_client/models/action_service_add_public_key_request.py index 14a5813b..e534cde2 100644 --- a/zitadel_client/models/action_service_add_public_key_request.py +++ b/zitadel_client/models/action_service_add_public_key_request.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceAddPublicKeyRequest(BaseModel): """ ActionServiceAddPublicKeyRequest - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target to add the public key to.", alias="targetId") - public_key: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The public key in PEM format. It must be either an RSA or an EC public key.", alias="publicKey") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["targetId", "publicKey", "expirationDate"] + """ + + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="The unique identifier of the target to add the public key to.", + ) + public_key: Optional[Base64Bytes] = Field( + default=None, + alias="publicKey", + description="The public key in PEM format. It must be either an RSA or an EC public key.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,7 @@ class ActionServiceAddPublicKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceAddPublicKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceAddPublicKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId"), - "publicKey": obj.get("publicKey"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +ActionServiceAddPublicKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_add_public_key_response.py b/zitadel_client/models/action_service_add_public_key_response.py index 62f64dd4..5f148601 100644 --- a/zitadel_client/models/action_service_add_public_key_response.py +++ b/zitadel_client/models/action_service_add_public_key_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceAddPublicKeyResponse(BaseModel): """ ActionServiceAddPublicKeyResponse - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="The KeyID is the unique identifier of the newly added public key. The ID is also used a `kid` in the JWT header for payload encryption. This allows the target to identify the correct key to use for decryption.", alias="keyId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["keyId", "creationDate"] + """ + + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="The KeyID is the unique identifier of the newly added public key. The ID is also used a `kid` in the JWT header for payload encryption. This allows the target to identify the correct key to use for decryption.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class ActionServiceAddPublicKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceAddPublicKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceAddPublicKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceAddPublicKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_any.py b/zitadel_client/models/action_service_any.py index 10292b1e..b66418d2 100644 --- a/zitadel_client/models/action_service_any.py +++ b/zitadel_client/models/action_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class ActionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +ActionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_condition.py b/zitadel_client/models/action_service_condition.py index 31868d01..a3897e95 100644 --- a/zitadel_client/models/action_service_condition.py +++ b/zitadel_client/models/action_service_condition.py @@ -1,41 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_event_execution import ActionServiceEventExecution -from zitadel_client.models.action_service_function_execution import ActionServiceFunctionExecution -from zitadel_client.models.action_service_request_execution import ActionServiceRequestExecution -from zitadel_client.models.action_service_response_execution import ActionServiceResponseExecution -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class ActionServiceCondition(BaseModel): """ ActionServiceCondition - """ # noqa: E501 - event: Optional[ActionServiceEventExecution] = None - function: Optional[ActionServiceFunctionExecution] = None - request: Optional[ActionServiceRequestExecution] = None - response: Optional[ActionServiceResponseExecution] = None - __properties: ClassVar[List[str]] = ["event", "function", "request", "response"] + """ + + event: Optional[ActionServiceEventExecution] = Field(default=None, alias="event") + function: Optional[ActionServiceFunctionExecution] = Field( + default=None, alias="function" + ) + request: Optional[ActionServiceRequestExecution] = Field( + default=None, alias="request" + ) + response: Optional[ActionServiceResponseExecution] = Field( + default=None, alias="response" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,67 +38,17 @@ class ActionServiceCondition(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceCondition from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of event - if self.event: - _dict['event'] = self.event.to_dict() - # override the default output from pydantic by calling `to_dict()` of function - if self.function: - _dict['function'] = self.function.to_dict() - # override the default output from pydantic by calling `to_dict()` of request - if self.request: - _dict['request'] = self.request.to_dict() - # override the default output from pydantic by calling `to_dict()` of response - if self.response: - _dict['response'] = self.response.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceCondition from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "event": ActionServiceEventExecution.from_dict(obj["event"]) if obj.get("event") is not None else None, - "function": ActionServiceFunctionExecution.from_dict(obj["function"]) if obj.get("function") is not None else None, - "request": ActionServiceRequestExecution.from_dict(obj["request"]) if obj.get("request") is not None else None, - "response": ActionServiceResponseExecution.from_dict(obj["response"]) if obj.get("response") is not None else None - }) - return _obj - - +from zitadel_client.models.action_service_event_execution import ( + ActionServiceEventExecution, +) +from zitadel_client.models.action_service_function_execution import ( + ActionServiceFunctionExecution, +) +from zitadel_client.models.action_service_request_execution import ( + ActionServiceRequestExecution, +) +from zitadel_client.models.action_service_response_execution import ( + ActionServiceResponseExecution, +) + +ActionServiceCondition.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_connect_error.py b/zitadel_client/models/action_service_connect_error.py index 6bb65362..2eee341f 100644 --- a/zitadel_client/models/action_service_connect_error.py +++ b/zitadel_client/models/action_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_any import ActionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class ActionServiceConnectErrorCodeEnum(str, Enum): + """ActionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class ActionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[ActionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[ActionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[ActionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [ActionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.action_service_any import ActionServiceAny +ActionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_create_target_request.py b/zitadel_client/models/action_service_create_target_request.py index 333b1eb0..7fd38d21 100644 --- a/zitadel_client/models/action_service_create_target_request.py +++ b/zitadel_client/models/action_service_create_target_request.py @@ -1,43 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_payload_type import ActionServicePayloadType -from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall -from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceCreateTargetRequest(BaseModel): """ ActionServiceCreateTargetRequest - """ # noqa: E501 - name: Optional[StrictStr] = None - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = Field(default=None, description="The URL of the endpoint to call.") - payload_type: Optional[ActionServicePayloadType] = Field(default=None, alias="payloadType") - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field( + default=None, alias="endpoint", description="The URL of the endpoint to call." + ) + payload_type: Optional[ActionServicePayloadType] = Field( + default=None, alias="payloadType" + ) + rest_async: Optional[object] = Field(default=None, alias="restAsync") rest_call: Optional[ActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[ActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["name", "timeout", "endpoint", "payloadType", "restAsync", "restCall", "restWebhook"] + rest_webhook: Optional[ActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,64 +46,9 @@ class ActionServiceCreateTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceCreateTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceCreateTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "payloadType": obj.get("payloadType"), - "restAsync": obj.get("restAsync"), - "restCall": ActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": ActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.action_service_payload_type import ActionServicePayloadType +from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall +from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook +ActionServiceCreateTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_create_target_response.py b/zitadel_client/models/action_service_create_target_response.py index ed8ebbbf..7b171f0f 100644 --- a/zitadel_client/models/action_service_create_target_response.py +++ b/zitadel_client/models/action_service_create_target_response.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceCreateTargetResponse(BaseModel): """ ActionServiceCreateTargetResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created target.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - signing_key: Optional[StrictStr] = Field(default=None, description="Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256.", alias="signingKey") - __properties: ClassVar[List[str]] = ["id", "creationDate", "signingKey"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created target.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + signing_key: Optional[StrictStr] = Field( + default=None, + alias="signingKey", + description="Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,6 @@ class ActionServiceCreateTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceCreateTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceCreateTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "signingKey": obj.get("signingKey") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceCreateTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_deactivate_public_key_request.py b/zitadel_client/models/action_service_deactivate_public_key_request.py index b1dec826..2ab8a1d1 100644 --- a/zitadel_client/models/action_service_deactivate_public_key_request.py +++ b/zitadel_client/models/action_service_deactivate_public_key_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceDeactivatePublicKeyRequest(BaseModel): """ ActionServiceDeactivatePublicKeyRequest - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="TargetID is the unique identifier of the target to deactivate the public key for.", alias="targetId") - key_id: Optional[StrictStr] = Field(default=None, description="KeyID is the unique identifier of the public key to deactivate.", alias="keyId") - __properties: ClassVar[List[str]] = ["targetId", "keyId"] + """ + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="TargetID is the unique identifier of the target to deactivate the public key for.", + ) + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="KeyID is the unique identifier of the public key to deactivate.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ActionServiceDeactivatePublicKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceDeactivatePublicKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceDeactivatePublicKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId"), - "keyId": obj.get("keyId") - }) - return _obj - - +ActionServiceDeactivatePublicKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_deactivate_public_key_response.py b/zitadel_client/models/action_service_deactivate_public_key_response.py index 505baa28..3295fd32 100644 --- a/zitadel_client/models/action_service_deactivate_public_key_response.py +++ b/zitadel_client/models/action_service_deactivate_public_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceDeactivatePublicKeyResponse(BaseModel): """ ActionServiceDeactivatePublicKeyResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ActionServiceDeactivatePublicKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceDeactivatePublicKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceDeactivatePublicKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceDeactivatePublicKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_delete_target_request.py b/zitadel_client/models/action_service_delete_target_request.py index c23d8af5..41dd1b45 100644 --- a/zitadel_client/models/action_service_delete_target_request.py +++ b/zitadel_client/models/action_service_delete_target_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceDeleteTargetRequest(BaseModel): """ ActionServiceDeleteTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target to delete.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the target to delete.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceDeleteTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceDeleteTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceDeleteTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +ActionServiceDeleteTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_delete_target_response.py b/zitadel_client/models/action_service_delete_target_response.py index 65df7b41..fffb96ad 100644 --- a/zitadel_client/models/action_service_delete_target_response.py +++ b/zitadel_client/models/action_service_delete_target_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceDeleteTargetResponse(BaseModel): """ ActionServiceDeleteTargetResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ActionServiceDeleteTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceDeleteTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceDeleteTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceDeleteTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_event_execution.py b/zitadel_client/models/action_service_event_execution.py index 91c9054a..1a2bd2c1 100644 --- a/zitadel_client/models/action_service_event_execution.py +++ b/zitadel_client/models/action_service_event_execution.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ActionServiceEventExecution(BaseModel): """ ActionServiceEventExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="Define all events as condition. After any event is created, the execution is triggered.") - event: Optional[StrictStr] = Field(default=None, description="Define a specific event as condition. After this event is created, the execution is triggered.") - group: Optional[StrictStr] = Field(default=None, description="Define an event group as condition. After any event under this group is created, the execution is triggered.") - __properties: ClassVar[List[str]] = ["all", "event", "group"] + """ + + all: Optional[StrictBool] = Field( + default=None, + alias="all", + description="Define all events as condition. After any event is created, the execution is triggered.", + ) + event: Optional[StrictStr] = Field( + default=None, + alias="event", + description="Define a specific event as condition. After this event is created, the execution is triggered.", + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="Define an event group as condition. After any event under this group is created, the execution is triggered.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ActionServiceEventExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceEventExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceEventExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "event": obj.get("event"), - "group": obj.get("group") - }) - return _obj - - +ActionServiceEventExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_execution.py b/zitadel_client/models/action_service_execution.py index edfc5f28..c88fc6fd 100644 --- a/zitadel_client/models/action_service_execution.py +++ b/zitadel_client/models/action_service_execution.py @@ -1,39 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_condition import ActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceExecution(BaseModel): """ ActionServiceExecution - """ # noqa: E501 - condition: Optional[ActionServiceCondition] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - targets: Optional[List[StrictStr]] = Field(default=None, description="Ordered list of targets called during the execution. The order of the targets in this list defines the order of execution. If one of the targets fails, depending on the target's type and settings, the execution might be interrupted and the following targets will not be called.") - __properties: ClassVar[List[str]] = ["condition", "creationDate", "changeDate", "targets"] + """ + + condition: Optional[ActionServiceCondition] = Field(default=None, alias="condition") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + targets: Optional[List[StrictStr]] = Field( + default=None, + alias="targets", + description="Ordered list of targets called during the execution. The order of the targets in this list defines the order of execution. If one of the targets fails, depending on the target's type and settings, the execution might be interrupted and the following targets will not be called.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,58 +45,7 @@ class ActionServiceExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of condition - if self.condition: - _dict['condition'] = self.condition.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "condition": ActionServiceCondition.from_dict(obj["condition"]) if obj.get("condition") is not None else None, - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "targets": obj.get("targets") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.action_service_condition import ActionServiceCondition +ActionServiceExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_execution_field_name.py b/zitadel_client/models/action_service_execution_field_name.py index d4e36378..53e9d91e 100644 --- a/zitadel_client/models/action_service_execution_field_name.py +++ b/zitadel_client/models/action_service_execution_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServiceExecutionFieldName(str, Enum): @@ -23,17 +13,7 @@ class ActionServiceExecutionFieldName(str, Enum): ActionServiceExecutionFieldName """ - """ - allowed enum values - """ - EXECUTION_FIELD_NAME_UNSPECIFIED = 'EXECUTION_FIELD_NAME_UNSPECIFIED' - EXECUTION_FIELD_NAME_ID = 'EXECUTION_FIELD_NAME_ID' - EXECUTION_FIELD_NAME_CREATED_DATE = 'EXECUTION_FIELD_NAME_CREATED_DATE' - EXECUTION_FIELD_NAME_CHANGED_DATE = 'EXECUTION_FIELD_NAME_CHANGED_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServiceExecutionFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + EXECUTION_FIELD_NAME_UNSPECIFIED = "EXECUTION_FIELD_NAME_UNSPECIFIED" + EXECUTION_FIELD_NAME_ID = "EXECUTION_FIELD_NAME_ID" + EXECUTION_FIELD_NAME_CREATED_DATE = "EXECUTION_FIELD_NAME_CREATED_DATE" + EXECUTION_FIELD_NAME_CHANGED_DATE = "EXECUTION_FIELD_NAME_CHANGED_DATE" diff --git a/zitadel_client/models/action_service_execution_search_filter.py b/zitadel_client/models/action_service_execution_search_filter.py index b4919c6f..662a9e03 100644 --- a/zitadel_client/models/action_service_execution_search_filter.py +++ b/zitadel_client/models/action_service_execution_search_filter.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_execution_type_filter import ActionServiceExecutionTypeFilter -from zitadel_client.models.action_service_in_conditions_filter import ActionServiceInConditionsFilter -from zitadel_client.models.action_service_target_filter import ActionServiceTargetFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceExecutionSearchFilter(BaseModel): """ ActionServiceExecutionSearchFilter - """ # noqa: E501 - execution_type_filter: Optional[ActionServiceExecutionTypeFilter] = Field(default=None, alias="executionTypeFilter") - in_conditions_filter: Optional[ActionServiceInConditionsFilter] = Field(default=None, alias="inConditionsFilter") - target_filter: Optional[ActionServiceTargetFilter] = Field(default=None, alias="targetFilter") - __properties: ClassVar[List[str]] = ["executionTypeFilter", "inConditionsFilter", "targetFilter"] + """ + + execution_type_filter: Optional[ActionServiceExecutionTypeFilter] = Field( + default=None, alias="executionTypeFilter" + ) + in_conditions_filter: Optional[ActionServiceInConditionsFilter] = Field( + default=None, alias="inConditionsFilter" + ) + target_filter: Optional[ActionServiceTargetFilter] = Field( + default=None, alias="targetFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,12 @@ class ActionServiceExecutionSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceExecutionSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of execution_type_filter - if self.execution_type_filter: - _dict['executionTypeFilter'] = self.execution_type_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_conditions_filter - if self.in_conditions_filter: - _dict['inConditionsFilter'] = self.in_conditions_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of target_filter - if self.target_filter: - _dict['targetFilter'] = self.target_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceExecutionSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionTypeFilter": ActionServiceExecutionTypeFilter.from_dict(obj["executionTypeFilter"]) if obj.get("executionTypeFilter") is not None else None, - "inConditionsFilter": ActionServiceInConditionsFilter.from_dict(obj["inConditionsFilter"]) if obj.get("inConditionsFilter") is not None else None, - "targetFilter": ActionServiceTargetFilter.from_dict(obj["targetFilter"]) if obj.get("targetFilter") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_execution_type_filter import ( + ActionServiceExecutionTypeFilter, +) +from zitadel_client.models.action_service_in_conditions_filter import ( + ActionServiceInConditionsFilter, +) +from zitadel_client.models.action_service_target_filter import ActionServiceTargetFilter +ActionServiceExecutionSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_execution_type.py b/zitadel_client/models/action_service_execution_type.py index 4a69af1f..ea0789c7 100644 --- a/zitadel_client/models/action_service_execution_type.py +++ b/zitadel_client/models/action_service_execution_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServiceExecutionType(str, Enum): @@ -23,18 +13,8 @@ class ActionServiceExecutionType(str, Enum): ActionServiceExecutionType """ - """ - allowed enum values - """ - EXECUTION_TYPE_UNSPECIFIED = 'EXECUTION_TYPE_UNSPECIFIED' - EXECUTION_TYPE_REQUEST = 'EXECUTION_TYPE_REQUEST' - EXECUTION_TYPE_RESPONSE = 'EXECUTION_TYPE_RESPONSE' - EXECUTION_TYPE_EVENT = 'EXECUTION_TYPE_EVENT' - EXECUTION_TYPE_FUNCTION = 'EXECUTION_TYPE_FUNCTION' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServiceExecutionType from a JSON string""" - return cls(json.loads(json_str)) - - + EXECUTION_TYPE_UNSPECIFIED = "EXECUTION_TYPE_UNSPECIFIED" + EXECUTION_TYPE_REQUEST = "EXECUTION_TYPE_REQUEST" + EXECUTION_TYPE_RESPONSE = "EXECUTION_TYPE_RESPONSE" + EXECUTION_TYPE_EVENT = "EXECUTION_TYPE_EVENT" + EXECUTION_TYPE_FUNCTION = "EXECUTION_TYPE_FUNCTION" diff --git a/zitadel_client/models/action_service_execution_type_filter.py b/zitadel_client/models/action_service_execution_type_filter.py index f959f358..9dc7105e 100644 --- a/zitadel_client/models/action_service_execution_type_filter.py +++ b/zitadel_client/models/action_service_execution_type_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_execution_type import ActionServiceExecutionType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceExecutionTypeFilter(BaseModel): """ ActionServiceExecutionTypeFilter - """ # noqa: E501 - execution_type: Optional[ActionServiceExecutionType] = Field(default=None, alias="executionType") - __properties: ClassVar[List[str]] = ["executionType"] + """ + execution_type: Optional[ActionServiceExecutionType] = Field( + default=None, alias="executionType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class ActionServiceExecutionTypeFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceExecutionTypeFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceExecutionTypeFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionType": obj.get("executionType") - }) - return _obj - +from zitadel_client.models.action_service_execution_type import ( + ActionServiceExecutionType, +) +ActionServiceExecutionTypeFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_function_execution.py b/zitadel_client/models/action_service_function_execution.py index 9780d926..719d0a39 100644 --- a/zitadel_client/models/action_service_function_execution.py +++ b/zitadel_client/models/action_service_function_execution.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceFunctionExecution(BaseModel): """ Executed on the specified function - """ # noqa: E501 - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name"] + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class ActionServiceFunctionExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceFunctionExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceFunctionExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name") - }) - return _obj - - +ActionServiceFunctionExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_get_target_request.py b/zitadel_client/models/action_service_get_target_request.py index 6b0edf0c..f9e99b0a 100644 --- a/zitadel_client/models/action_service_get_target_request.py +++ b/zitadel_client/models/action_service_get_target_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceGetTargetRequest(BaseModel): """ ActionServiceGetTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target to retrieve.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the target to retrieve.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceGetTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceGetTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceGetTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +ActionServiceGetTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_get_target_response.py b/zitadel_client/models/action_service_get_target_response.py index 8036cab1..f23a3228 100644 --- a/zitadel_client/models/action_service_get_target_response.py +++ b/zitadel_client/models/action_service_get_target_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_target import ActionServiceTarget -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class ActionServiceGetTargetResponse(BaseModel): """ ActionServiceGetTargetResponse - """ # noqa: E501 - target: Optional[ActionServiceTarget] = None - __properties: ClassVar[List[str]] = ["target"] + """ + target: Optional[ActionServiceTarget] = Field(default=None, alias="target") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class ActionServiceGetTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceGetTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of target - if self.target: - _dict['target'] = self.target.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceGetTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "target": ActionServiceTarget.from_dict(obj["target"]) if obj.get("target") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_target import ActionServiceTarget +ActionServiceGetTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_in_conditions_filter.py b/zitadel_client/models/action_service_in_conditions_filter.py index b53e396d..241f973b 100644 --- a/zitadel_client/models/action_service_in_conditions_filter.py +++ b/zitadel_client/models/action_service_in_conditions_filter.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_condition import ActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceInConditionsFilter(BaseModel): """ ActionServiceInConditionsFilter - """ # noqa: E501 - conditions: Optional[List[ActionServiceCondition]] = Field(default=None, description="Defines the conditions to query for.") - __properties: ClassVar[List[str]] = ["conditions"] + """ + conditions: Optional[List[ActionServiceCondition]] = Field( + default=None, + alias="conditions", + description="Defines the conditions to query for.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,59 +33,6 @@ class ActionServiceInConditionsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceInConditionsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceInConditionsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "conditions": [ActionServiceCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_condition import ActionServiceCondition +ActionServiceInConditionsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_in_ids_filter.py b/zitadel_client/models/action_service_in_ids_filter.py index 89f87a13..fd124457 100644 --- a/zitadel_client/models/action_service_in_ids_filter.py +++ b/zitadel_client/models/action_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceInIDsFilter(BaseModel): """ ActionServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class ActionServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +ActionServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_in_target_ids_filter.py b/zitadel_client/models/action_service_in_target_ids_filter.py index 28bd7a58..398a16c3 100644 --- a/zitadel_client/models/action_service_in_target_ids_filter.py +++ b/zitadel_client/models/action_service_in_target_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceInTargetIDsFilter(BaseModel): """ ActionServiceInTargetIDsFilter - """ # noqa: E501 - target_ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.", alias="targetIds") - __properties: ClassVar[List[str]] = ["targetIds"] + """ + target_ids: Optional[List[StrictStr]] = Field( + default=None, alias="targetIds", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class ActionServiceInTargetIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceInTargetIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceInTargetIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetIds": obj.get("targetIds") - }) - return _obj - - +ActionServiceInTargetIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_execution_functions_response.py b/zitadel_client/models/action_service_list_execution_functions_response.py index d9af5bbe..efb9e8b6 100644 --- a/zitadel_client/models/action_service_list_execution_functions_response.py +++ b/zitadel_client/models/action_service_list_execution_functions_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceListExecutionFunctionsResponse(BaseModel): """ ActionServiceListExecutionFunctionsResponse - """ # noqa: E501 - functions: Optional[List[StrictStr]] = Field(default=None, description="All available functions to use in conditions.") - __properties: ClassVar[List[str]] = ["functions"] + """ + functions: Optional[List[StrictStr]] = Field( + default=None, + alias="functions", + description="All available functions to use in conditions.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceListExecutionFunctionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionFunctionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionFunctionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "functions": obj.get("functions") - }) - return _obj - - +ActionServiceListExecutionFunctionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_execution_methods_response.py b/zitadel_client/models/action_service_list_execution_methods_response.py index f8ac1506..5a4a473b 100644 --- a/zitadel_client/models/action_service_list_execution_methods_response.py +++ b/zitadel_client/models/action_service_list_execution_methods_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceListExecutionMethodsResponse(BaseModel): """ ActionServiceListExecutionMethodsResponse - """ # noqa: E501 - methods: Optional[List[StrictStr]] = Field(default=None, description="All available methods to use in conditions.") - __properties: ClassVar[List[str]] = ["methods"] + """ + methods: Optional[List[StrictStr]] = Field( + default=None, + alias="methods", + description="All available methods to use in conditions.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceListExecutionMethodsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionMethodsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionMethodsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "methods": obj.get("methods") - }) - return _obj - - +ActionServiceListExecutionMethodsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_execution_services_response.py b/zitadel_client/models/action_service_list_execution_services_response.py index 7b053dd3..3c7cdddf 100644 --- a/zitadel_client/models/action_service_list_execution_services_response.py +++ b/zitadel_client/models/action_service_list_execution_services_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceListExecutionServicesResponse(BaseModel): """ ActionServiceListExecutionServicesResponse - """ # noqa: E501 - services: Optional[List[StrictStr]] = Field(default=None, description="All available services to use in conditions.") - __properties: ClassVar[List[str]] = ["services"] + """ + services: Optional[List[StrictStr]] = Field( + default=None, + alias="services", + description="All available services to use in conditions.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceListExecutionServicesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionServicesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionServicesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "services": obj.get("services") - }) - return _obj - - +ActionServiceListExecutionServicesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_executions_request.py b/zitadel_client/models/action_service_list_executions_request.py index 1acd0dbf..483a5e91 100644 --- a/zitadel_client/models/action_service_list_executions_request.py +++ b/zitadel_client/models/action_service_list_executions_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_execution_field_name import ActionServiceExecutionFieldName -from zitadel_client.models.action_service_execution_search_filter import ActionServiceExecutionSearchFilter -from zitadel_client.models.action_service_pagination_request import ActionServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceListExecutionsRequest(BaseModel): """ ActionServiceListExecutionsRequest - """ # noqa: E501 - pagination: Optional[ActionServicePaginationRequest] = None - sorting_column: Optional[ActionServiceExecutionFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ActionServiceExecutionSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ActionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ActionServiceExecutionFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ActionServiceExecutionSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class ActionServiceListExecutionsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ActionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ActionServiceExecutionSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_execution_field_name import ( + ActionServiceExecutionFieldName, +) +from zitadel_client.models.action_service_execution_search_filter import ( + ActionServiceExecutionSearchFilter, +) +from zitadel_client.models.action_service_pagination_request import ( + ActionServicePaginationRequest, +) +ActionServiceListExecutionsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_executions_response.py b/zitadel_client/models/action_service_list_executions_response.py index a625f694..29166706 100644 --- a/zitadel_client/models/action_service_list_executions_response.py +++ b/zitadel_client/models/action_service_list_executions_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_execution import ActionServiceExecution -from zitadel_client.models.action_service_pagination_response import ActionServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceListExecutionsResponse(BaseModel): """ ActionServiceListExecutionsResponse - """ # noqa: E501 - pagination: Optional[ActionServicePaginationResponse] = None - executions: Optional[List[ActionServiceExecution]] = Field(default=None, description="List of all executions matching the query.") - __properties: ClassVar[List[str]] = ["pagination", "executions"] + """ + + pagination: Optional[ActionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + executions: Optional[List[ActionServiceExecution]] = Field( + default=None, + alias="executions", + description="List of all executions matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class ActionServiceListExecutionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in executions (list) - _items = [] - if self.executions: - for _item_executions in self.executions: - if _item_executions: - _items.append(_item_executions.to_dict()) - _dict['executions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListExecutionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ActionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "executions": [ActionServiceExecution.from_dict(_item) for _item in obj["executions"]] if obj.get("executions") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_execution import ActionServiceExecution +from zitadel_client.models.action_service_pagination_response import ( + ActionServicePaginationResponse, +) +ActionServiceListExecutionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_public_keys_request.py b/zitadel_client/models/action_service_list_public_keys_request.py index a9407f45..dc5ac64a 100644 --- a/zitadel_client/models/action_service_list_public_keys_request.py +++ b/zitadel_client/models/action_service_list_public_keys_request.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_pagination_request import ActionServicePaginationRequest -from zitadel_client.models.action_service_public_key_field_name import ActionServicePublicKeyFieldName -from zitadel_client.models.action_service_public_key_search_filter import ActionServicePublicKeySearchFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceListPublicKeysRequest(BaseModel): """ ActionServiceListPublicKeysRequest - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="TargetID is the unique identifier of the target to list the public keys for.", alias="targetId") - pagination: Optional[ActionServicePaginationRequest] = None - sorting_column: Optional[ActionServicePublicKeyFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ActionServicePublicKeySearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["targetId", "pagination", "sortingColumn", "filters"] + """ + + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="TargetID is the unique identifier of the target to list the public keys for.", + ) + pagination: Optional[ActionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ActionServicePublicKeyFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ActionServicePublicKeySearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +43,14 @@ class ActionServiceListPublicKeysRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListPublicKeysRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListPublicKeysRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId"), - "pagination": ActionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ActionServicePublicKeySearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_pagination_request import ( + ActionServicePaginationRequest, +) +from zitadel_client.models.action_service_public_key_field_name import ( + ActionServicePublicKeyFieldName, +) +from zitadel_client.models.action_service_public_key_search_filter import ( + ActionServicePublicKeySearchFilter, +) +ActionServiceListPublicKeysRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_public_keys_response.py b/zitadel_client/models/action_service_list_public_keys_response.py index 0bf3dd63..bec2edd2 100644 --- a/zitadel_client/models/action_service_list_public_keys_response.py +++ b/zitadel_client/models/action_service_list_public_keys_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_pagination_response import ActionServicePaginationResponse -from zitadel_client.models.action_service_public_key import ActionServicePublicKey -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceListPublicKeysResponse(BaseModel): """ ActionServiceListPublicKeysResponse - """ # noqa: E501 - pagination: Optional[ActionServicePaginationResponse] = None - public_keys: Optional[List[ActionServicePublicKey]] = Field(default=None, description="List of all public keys for the target.", alias="publicKeys") - __properties: ClassVar[List[str]] = ["pagination", "publicKeys"] + """ + + pagination: Optional[ActionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + public_keys: Optional[List[ActionServicePublicKey]] = Field( + default=None, + alias="publicKeys", + description="List of all public keys for the target.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class ActionServiceListPublicKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListPublicKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in public_keys (list) - _items = [] - if self.public_keys: - for _item_public_keys in self.public_keys: - if _item_public_keys: - _items.append(_item_public_keys.to_dict()) - _dict['publicKeys'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListPublicKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ActionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "publicKeys": [ActionServicePublicKey.from_dict(_item) for _item in obj["publicKeys"]] if obj.get("publicKeys") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_pagination_response import ( + ActionServicePaginationResponse, +) +from zitadel_client.models.action_service_public_key import ActionServicePublicKey +ActionServiceListPublicKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_targets_request.py b/zitadel_client/models/action_service_list_targets_request.py index cd821c68..e8e0282a 100644 --- a/zitadel_client/models/action_service_list_targets_request.py +++ b/zitadel_client/models/action_service_list_targets_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_pagination_request import ActionServicePaginationRequest -from zitadel_client.models.action_service_target_field_name import ActionServiceTargetFieldName -from zitadel_client.models.action_service_target_search_filter import ActionServiceTargetSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceListTargetsRequest(BaseModel): """ ActionServiceListTargetsRequest - """ # noqa: E501 - pagination: Optional[ActionServicePaginationRequest] = None - sorting_column: Optional[ActionServiceTargetFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ActionServiceTargetSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ActionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ActionServiceTargetFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ActionServiceTargetSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class ActionServiceListTargetsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListTargetsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListTargetsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ActionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ActionServiceTargetSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_pagination_request import ( + ActionServicePaginationRequest, +) +from zitadel_client.models.action_service_target_field_name import ( + ActionServiceTargetFieldName, +) +from zitadel_client.models.action_service_target_search_filter import ( + ActionServiceTargetSearchFilter, +) +ActionServiceListTargetsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_list_targets_response.py b/zitadel_client/models/action_service_list_targets_response.py index 3179b1fc..ffb9d76b 100644 --- a/zitadel_client/models/action_service_list_targets_response.py +++ b/zitadel_client/models/action_service_list_targets_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_pagination_response import ActionServicePaginationResponse -from zitadel_client.models.action_service_target import ActionServiceTarget -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ActionServiceListTargetsResponse(BaseModel): """ ActionServiceListTargetsResponse - """ # noqa: E501 - pagination: Optional[ActionServicePaginationResponse] = None - targets: Optional[List[ActionServiceTarget]] = Field(default=None, description="List of all targets matching the query.") - __properties: ClassVar[List[str]] = ["pagination", "targets"] + """ + + pagination: Optional[ActionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + targets: Optional[List[ActionServiceTarget]] = Field( + default=None, + alias="targets", + description="List of all targets matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class ActionServiceListTargetsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceListTargetsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in targets (list) - _items = [] - if self.targets: - for _item_targets in self.targets: - if _item_targets: - _items.append(_item_targets.to_dict()) - _dict['targets'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceListTargetsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ActionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "targets": [ActionServiceTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_pagination_response import ( + ActionServicePaginationResponse, +) +from zitadel_client.models.action_service_target import ActionServiceTarget +ActionServiceListTargetsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_pagination_request.py b/zitadel_client/models/action_service_pagination_request.py index 7a12d7d3..c97faa93 100644 --- a/zitadel_client/models/action_service_pagination_request.py +++ b/zitadel_client/models/action_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class ActionServicePaginationRequest(BaseModel): """ ActionServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class ActionServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +ActionServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_pagination_response.py b/zitadel_client/models/action_service_pagination_response.py index 966ecce4..f9a11ed1 100644 --- a/zitadel_client/models/action_service_pagination_response.py +++ b/zitadel_client/models/action_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServicePaginationResponse(BaseModel): """ ActionServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class ActionServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +ActionServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_payload_type.py b/zitadel_client/models/action_service_payload_type.py index 581daaed..e9645362 100644 --- a/zitadel_client/models/action_service_payload_type.py +++ b/zitadel_client/models/action_service_payload_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServicePayloadType(str, Enum): @@ -23,17 +13,7 @@ class ActionServicePayloadType(str, Enum): ActionServicePayloadType """ - """ - allowed enum values - """ - PAYLOAD_TYPE_UNSPECIFIED = 'PAYLOAD_TYPE_UNSPECIFIED' - PAYLOAD_TYPE_JSON = 'PAYLOAD_TYPE_JSON' - PAYLOAD_TYPE_JWT = 'PAYLOAD_TYPE_JWT' - PAYLOAD_TYPE_JWE = 'PAYLOAD_TYPE_JWE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServicePayloadType from a JSON string""" - return cls(json.loads(json_str)) - - + PAYLOAD_TYPE_UNSPECIFIED = "PAYLOAD_TYPE_UNSPECIFIED" + PAYLOAD_TYPE_JSON = "PAYLOAD_TYPE_JSON" + PAYLOAD_TYPE_JWT = "PAYLOAD_TYPE_JWT" + PAYLOAD_TYPE_JWE = "PAYLOAD_TYPE_JWE" diff --git a/zitadel_client/models/action_service_public_key.py b/zitadel_client/models/action_service_public_key.py index 73a8e678..d5e0657a 100644 --- a/zitadel_client/models/action_service_public_key.py +++ b/zitadel_client/models/action_service_public_key.py @@ -1,41 +1,60 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ActionServicePublicKey(BaseModel): """ ActionServicePublicKey - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="KeyID is the unique identifier of the public key. It's also used as the `kid` field in the JWE header when the payload type is set to `PAYLOAD_TYPE_JWE`.", alias="keyId") - active: Optional[StrictBool] = Field(default=None, description="Active indicates whether the public key is active and used for payload encryption. Only one public key can be active at a time.") - public_key: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The public key in PEM format.", alias="publicKey") - fingerprint: Optional[StrictStr] = Field(default=None, description="Fingerprint is the fingerprint of the public key. It's prefixed with the hashing algorithm used and base64 encoded without padding, e.g. `SHA256:STqK+Sd4qgdu+UjiwI8NBjOD6P7UqQ42EZYIdySEyTw`. The fingerprint can be used to easily compare the public key with other sources.") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["keyId", "active", "publicKey", "fingerprint", "expirationDate", "creationDate", "changeDate"] + """ + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="KeyID is the unique identifier of the public key. It's also used as the `kid` field in the JWE header when the payload type is set to `PAYLOAD_TYPE_JWE`.", + ) + active: Optional[StrictBool] = Field( + default=None, + alias="active", + description="Active indicates whether the public key is active and used for payload encryption. Only one public key can be active at a time.", + ) + public_key: Optional[Base64Bytes] = Field( + default=None, alias="publicKey", description="The public key in PEM format." + ) + fingerprint: Optional[StrictStr] = Field( + default=None, + alias="fingerprint", + description="Fingerprint is the fingerprint of the public key. It's prefixed with the hashing algorithm used and base64 encoded without padding, e.g. `SHA256:STqK+Sd4qgdu+UjiwI8NBjOD6P7UqQ42EZYIdySEyTw`. The fingerprint can be used to easily compare the public key with other sources.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,58 +62,7 @@ class ActionServicePublicKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServicePublicKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServicePublicKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "active": obj.get("active"), - "publicKey": obj.get("publicKey"), - "fingerprint": obj.get("fingerprint"), - "expirationDate": obj.get("expirationDate"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +ActionServicePublicKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_public_key_field_name.py b/zitadel_client/models/action_service_public_key_field_name.py index 72883cde..a773d1d8 100644 --- a/zitadel_client/models/action_service_public_key_field_name.py +++ b/zitadel_client/models/action_service_public_key_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServicePublicKeyFieldName(str, Enum): @@ -23,17 +13,7 @@ class ActionServicePublicKeyFieldName(str, Enum): ActionServicePublicKeyFieldName """ - """ - allowed enum values - """ - PUBLIC_KEY_FIELD_NAME_UNSPECIFIED = 'PUBLIC_KEY_FIELD_NAME_UNSPECIFIED' - PUBLIC_KEY_FIELD_NAME_CREATION_DATE = 'PUBLIC_KEY_FIELD_NAME_CREATION_DATE' - PUBLIC_KEY_FIELD_NAME_CHANGE_DATE = 'PUBLIC_KEY_FIELD_NAME_CHANGE_DATE' - PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE = 'PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServicePublicKeyFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PUBLIC_KEY_FIELD_NAME_UNSPECIFIED = "PUBLIC_KEY_FIELD_NAME_UNSPECIFIED" + PUBLIC_KEY_FIELD_NAME_CREATION_DATE = "PUBLIC_KEY_FIELD_NAME_CREATION_DATE" + PUBLIC_KEY_FIELD_NAME_CHANGE_DATE = "PUBLIC_KEY_FIELD_NAME_CHANGE_DATE" + PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE = "PUBLIC_KEY_FIELD_NAME_EXPIRATION_DATE" diff --git a/zitadel_client/models/action_service_public_key_search_filter.py b/zitadel_client/models/action_service_public_key_search_filter.py index e74b701d..2adf73a1 100644 --- a/zitadel_client/models/action_service_public_key_search_filter.py +++ b/zitadel_client/models/action_service_public_key_search_filter.py @@ -1,38 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_in_ids_filter import ActionServiceInIDsFilter -from zitadel_client.models.action_service_timestamp_filter import ActionServiceTimestampFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class ActionServicePublicKeySearchFilter(BaseModel): """ ActionServicePublicKeySearchFilter - """ # noqa: E501 - active_filter: Optional[StrictBool] = Field(default=None, description="Filter the keys by their active status.", alias="activeFilter") - expiration_date_filter: Optional[ActionServiceTimestampFilter] = Field(default=None, alias="expirationDateFilter") - key_ids_filter: Optional[ActionServiceInIDsFilter] = Field(default=None, alias="keyIdsFilter") - __properties: ClassVar[List[str]] = ["activeFilter", "expirationDateFilter", "keyIdsFilter"] + """ + + active_filter: Optional[StrictBool] = Field( + default=None, + alias="activeFilter", + description="Filter the keys by their active status.", + ) + expiration_date_filter: Optional[ActionServiceTimestampFilter] = Field( + default=None, alias="expirationDateFilter" + ) + key_ids_filter: Optional[ActionServiceInIDsFilter] = Field( + default=None, alias="keyIdsFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +40,9 @@ class ActionServicePublicKeySearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServicePublicKeySearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of expiration_date_filter - if self.expiration_date_filter: - _dict['expirationDateFilter'] = self.expiration_date_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of key_ids_filter - if self.key_ids_filter: - _dict['keyIdsFilter'] = self.key_ids_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServicePublicKeySearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "activeFilter": obj.get("activeFilter"), - "expirationDateFilter": ActionServiceTimestampFilter.from_dict(obj["expirationDateFilter"]) if obj.get("expirationDateFilter") is not None else None, - "keyIdsFilter": ActionServiceInIDsFilter.from_dict(obj["keyIdsFilter"]) if obj.get("keyIdsFilter") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_in_ids_filter import ActionServiceInIDsFilter +from zitadel_client.models.action_service_timestamp_filter import ( + ActionServiceTimestampFilter, +) +ActionServicePublicKeySearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_remove_public_key_request.py b/zitadel_client/models/action_service_remove_public_key_request.py index 12857a38..efc29411 100644 --- a/zitadel_client/models/action_service_remove_public_key_request.py +++ b/zitadel_client/models/action_service_remove_public_key_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceRemovePublicKeyRequest(BaseModel): """ ActionServiceRemovePublicKeyRequest - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="TargetID is the unique identifier of the target to remove the public key from.", alias="targetId") - key_id: Optional[StrictStr] = Field(default=None, description="KeyID is the unique identifier of the public key to remove.", alias="keyId") - __properties: ClassVar[List[str]] = ["targetId", "keyId"] + """ + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="TargetID is the unique identifier of the target to remove the public key from.", + ) + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="KeyID is the unique identifier of the public key to remove.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ActionServiceRemovePublicKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceRemovePublicKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceRemovePublicKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId"), - "keyId": obj.get("keyId") - }) - return _obj - - +ActionServiceRemovePublicKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_remove_public_key_response.py b/zitadel_client/models/action_service_remove_public_key_response.py index 4bc504b3..f07d4ecd 100644 --- a/zitadel_client/models/action_service_remove_public_key_response.py +++ b/zitadel_client/models/action_service_remove_public_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceRemovePublicKeyResponse(BaseModel): """ ActionServiceRemovePublicKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ActionServiceRemovePublicKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceRemovePublicKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceRemovePublicKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceRemovePublicKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_request_execution.py b/zitadel_client/models/action_service_request_execution.py index b949a0b6..d83fce18 100644 --- a/zitadel_client/models/action_service_request_execution.py +++ b/zitadel_client/models/action_service_request_execution.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ActionServiceRequestExecution(BaseModel): """ ActionServiceRequestExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="Define all calls as condition. When a call to any available service happens, the execution is triggered.") - method: Optional[StrictStr] = Field(default=None, description="Define a GRPC-method as condition. When a request to this method happens, the execution is triggered.") - service: Optional[StrictStr] = Field(default=None, description="Define a GRPC-service as condition. When a request to any method of this service happens, the execution is triggered.") - __properties: ClassVar[List[str]] = ["all", "method", "service"] + """ + + all: Optional[StrictBool] = Field( + default=None, + alias="all", + description="Define all calls as condition. When a call to any available service happens, the execution is triggered.", + ) + method: Optional[StrictStr] = Field( + default=None, + alias="method", + description="Define a GRPC-method as condition. When a request to this method happens, the execution is triggered.", + ) + service: Optional[StrictStr] = Field( + default=None, + alias="service", + description="Define a GRPC-service as condition. When a request to any method of this service happens, the execution is triggered.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ActionServiceRequestExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceRequestExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceRequestExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "method": obj.get("method"), - "service": obj.get("service") - }) - return _obj - - +ActionServiceRequestExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_response_execution.py b/zitadel_client/models/action_service_response_execution.py index dcac048f..4914b560 100644 --- a/zitadel_client/models/action_service_response_execution.py +++ b/zitadel_client/models/action_service_response_execution.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ActionServiceResponseExecution(BaseModel): """ ActionServiceResponseExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="Define all calls as condition. Before a response is returned to the client from any available service, the execution is triggered.") - method: Optional[StrictStr] = Field(default=None, description="Define a GRPC-method as condition. Before a response is returned to the client from this method, the execution is triggered.") - service: Optional[StrictStr] = Field(default=None, description="Define a GRPC-service as condition. Before a response is returned to the client from any method of this service, the execution is triggered.") - __properties: ClassVar[List[str]] = ["all", "method", "service"] + """ + + all: Optional[StrictBool] = Field( + default=None, + alias="all", + description="Define all calls as condition. Before a response is returned to the client from any available service, the execution is triggered.", + ) + method: Optional[StrictStr] = Field( + default=None, + alias="method", + description="Define a GRPC-method as condition. Before a response is returned to the client from this method, the execution is triggered.", + ) + service: Optional[StrictStr] = Field( + default=None, + alias="service", + description="Define a GRPC-service as condition. Before a response is returned to the client from any method of this service, the execution is triggered.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ActionServiceResponseExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceResponseExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceResponseExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "method": obj.get("method"), - "service": obj.get("service") - }) - return _obj - - +ActionServiceResponseExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_rest_call.py b/zitadel_client/models/action_service_rest_call.py index fc1ece7d..8e8c9d12 100644 --- a/zitadel_client/models/action_service_rest_call.py +++ b/zitadel_client/models/action_service_rest_call.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class ActionServiceRESTCall(BaseModel): """ ActionServiceRESTCall - """ # noqa: E501 - interrupt_on_error: Optional[StrictBool] = Field(default=None, description="Define if any error stops the whole execution. By default the process continues as normal.", alias="interruptOnError") - __properties: ClassVar[List[str]] = ["interruptOnError"] + """ + interrupt_on_error: Optional[StrictBool] = Field( + default=None, + alias="interruptOnError", + description="Define if any error stops the whole execution. By default the process continues as normal.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceRESTCall(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceRESTCall from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceRESTCall from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "interruptOnError": obj.get("interruptOnError") - }) - return _obj - - +ActionServiceRESTCall.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_rest_webhook.py b/zitadel_client/models/action_service_rest_webhook.py index d165fa23..6a669ff6 100644 --- a/zitadel_client/models/action_service_rest_webhook.py +++ b/zitadel_client/models/action_service_rest_webhook.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class ActionServiceRESTWebhook(BaseModel): """ ActionServiceRESTWebhook - """ # noqa: E501 - interrupt_on_error: Optional[StrictBool] = Field(default=None, description="Define if any error stops the whole execution. By default the process continues as normal.", alias="interruptOnError") - __properties: ClassVar[List[str]] = ["interruptOnError"] + """ + interrupt_on_error: Optional[StrictBool] = Field( + default=None, + alias="interruptOnError", + description="Define if any error stops the whole execution. By default the process continues as normal.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceRESTWebhook(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceRESTWebhook from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceRESTWebhook from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "interruptOnError": obj.get("interruptOnError") - }) - return _obj - - +ActionServiceRESTWebhook.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_set_execution_request.py b/zitadel_client/models/action_service_set_execution_request.py index 5dc2079c..bb686e3e 100644 --- a/zitadel_client/models/action_service_set_execution_request.py +++ b/zitadel_client/models/action_service_set_execution_request.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.action_service_condition import ActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ActionServiceSetExecutionRequest(BaseModel): """ ActionServiceSetExecutionRequest - """ # noqa: E501 - condition: Optional[ActionServiceCondition] = None - targets: Optional[List[StrictStr]] = Field(default=None, description="Ordered list of targets called during the execution.") - __properties: ClassVar[List[str]] = ["condition", "targets"] + """ + condition: Optional[ActionServiceCondition] = Field(default=None, alias="condition") + targets: Optional[List[StrictStr]] = Field( + default=None, + alias="targets", + description="Ordered list of targets called during the execution.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +35,6 @@ class ActionServiceSetExecutionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceSetExecutionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of condition - if self.condition: - _dict['condition'] = self.condition.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceSetExecutionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "condition": ActionServiceCondition.from_dict(obj["condition"]) if obj.get("condition") is not None else None, - "targets": obj.get("targets") - }) - return _obj - +from zitadel_client.models.action_service_condition import ActionServiceCondition +ActionServiceSetExecutionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_set_execution_response.py b/zitadel_client/models/action_service_set_execution_response.py index fd5eecc0..312e9904 100644 --- a/zitadel_client/models/action_service_set_execution_response.py +++ b/zitadel_client/models/action_service_set_execution_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceSetExecutionResponse(BaseModel): """ ActionServiceSetExecutionResponse - """ # noqa: E501 - set_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="setDate") - __properties: ClassVar[List[str]] = ["setDate"] + """ + set_date: Optional[AwareDatetime] = Field( + default=None, + alias="setDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ActionServiceSetExecutionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceSetExecutionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceSetExecutionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "setDate": obj.get("setDate") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceSetExecutionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_target.py b/zitadel_client/models/action_service_target.py index d4a37ddc..31279199 100644 --- a/zitadel_client/models/action_service_target.py +++ b/zitadel_client/models/action_service_target.py @@ -1,48 +1,66 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_payload_type import ActionServicePayloadType -from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall -from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceTarget(BaseModel): """ ActionServiceTarget - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - name: Optional[StrictStr] = Field(default=None, description="Display name of the target.") - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = Field(default=None, description="The URL that will be called in case of an execution.") - signing_key: Optional[StrictStr] = Field(default=None, description="The current signing key used to sign the request sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256.", alias="signingKey") - payload_type: Optional[ActionServicePayloadType] = Field(default=None, alias="payloadType") - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the target." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Display name of the target." + ) + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field( + default=None, + alias="endpoint", + description="The URL that will be called in case of an execution.", + ) + signing_key: Optional[StrictStr] = Field( + default=None, + alias="signingKey", + description="The current signing key used to sign the request sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256.", + ) + payload_type: Optional[ActionServicePayloadType] = Field( + default=None, alias="payloadType" + ) + rest_async: Optional[object] = Field(default=None, alias="restAsync") rest_call: Optional[ActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[ActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "name", "timeout", "endpoint", "signingKey", "payloadType", "restAsync", "restCall", "restWebhook"] + rest_webhook: Optional[ActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,68 +68,10 @@ class ActionServiceTarget(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceTarget from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceTarget from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "signingKey": obj.get("signingKey"), - "payloadType": obj.get("payloadType"), - "restAsync": obj.get("restAsync"), - "restCall": ActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": ActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.action_service_payload_type import ActionServicePayloadType +from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall +from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook +ActionServiceTarget.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_target_field_name.py b/zitadel_client/models/action_service_target_field_name.py index e4b3ff56..3c4d2bc9 100644 --- a/zitadel_client/models/action_service_target_field_name.py +++ b/zitadel_client/models/action_service_target_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServiceTargetFieldName(str, Enum): @@ -23,22 +13,12 @@ class ActionServiceTargetFieldName(str, Enum): ActionServiceTargetFieldName """ - """ - allowed enum values - """ - TARGET_FIELD_NAME_UNSPECIFIED = 'TARGET_FIELD_NAME_UNSPECIFIED' - TARGET_FIELD_NAME_ID = 'TARGET_FIELD_NAME_ID' - TARGET_FIELD_NAME_CREATED_DATE = 'TARGET_FIELD_NAME_CREATED_DATE' - TARGET_FIELD_NAME_CHANGED_DATE = 'TARGET_FIELD_NAME_CHANGED_DATE' - TARGET_FIELD_NAME_NAME = 'TARGET_FIELD_NAME_NAME' - TARGET_FIELD_NAME_TARGET_TYPE = 'TARGET_FIELD_NAME_TARGET_TYPE' - TARGET_FIELD_NAME_URL = 'TARGET_FIELD_NAME_URL' - TARGET_FIELD_NAME_TIMEOUT = 'TARGET_FIELD_NAME_TIMEOUT' - TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = 'TARGET_FIELD_NAME_INTERRUPT_ON_ERROR' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServiceTargetFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + TARGET_FIELD_NAME_UNSPECIFIED = "TARGET_FIELD_NAME_UNSPECIFIED" + TARGET_FIELD_NAME_ID = "TARGET_FIELD_NAME_ID" + TARGET_FIELD_NAME_CREATED_DATE = "TARGET_FIELD_NAME_CREATED_DATE" + TARGET_FIELD_NAME_CHANGED_DATE = "TARGET_FIELD_NAME_CHANGED_DATE" + TARGET_FIELD_NAME_NAME = "TARGET_FIELD_NAME_NAME" + TARGET_FIELD_NAME_TARGET_TYPE = "TARGET_FIELD_NAME_TARGET_TYPE" + TARGET_FIELD_NAME_URL = "TARGET_FIELD_NAME_URL" + TARGET_FIELD_NAME_TIMEOUT = "TARGET_FIELD_NAME_TIMEOUT" + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = "TARGET_FIELD_NAME_INTERRUPT_ON_ERROR" diff --git a/zitadel_client/models/action_service_target_filter.py b/zitadel_client/models/action_service_target_filter.py index 509da4d8..fe6c0f12 100644 --- a/zitadel_client/models/action_service_target_filter.py +++ b/zitadel_client/models/action_service_target_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceTargetFilter(BaseModel): """ ActionServiceTargetFilter - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="Defines the id of the target that needs to be part of the execution.", alias="targetId") - __properties: ClassVar[List[str]] = ["targetId"] + """ + target_id: Optional[StrictStr] = Field( + default=None, + alias="targetId", + description="Defines the id of the target that needs to be part of the execution.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ActionServiceTargetFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceTargetFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceTargetFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId") - }) - return _obj - - +ActionServiceTargetFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_target_name_filter.py b/zitadel_client/models/action_service_target_name_filter.py index 0909d70c..6dab0d99 100644 --- a/zitadel_client/models/action_service_target_name_filter.py +++ b/zitadel_client/models/action_service_target_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_text_filter_method import ActionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceTargetNameFilter(BaseModel): """ ActionServiceTargetNameFilter - """ # noqa: E501 - target_name: Optional[StrictStr] = Field(default=None, description="Defines the name of the target to query for.", alias="targetName") - method: Optional[ActionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["targetName", "method"] + """ + + target_name: Optional[StrictStr] = Field( + default=None, + alias="targetName", + description="Defines the name of the target to query for.", + ) + method: Optional[ActionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ActionServiceTargetNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceTargetNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceTargetNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetName": obj.get("targetName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.action_service_text_filter_method import ( + ActionServiceTextFilterMethod, +) +ActionServiceTargetNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_target_search_filter.py b/zitadel_client/models/action_service_target_search_filter.py index e9f53131..f30aac02 100644 --- a/zitadel_client/models/action_service_target_search_filter.py +++ b/zitadel_client/models/action_service_target_search_filter.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_in_target_ids_filter import ActionServiceInTargetIDsFilter -from zitadel_client.models.action_service_target_name_filter import ActionServiceTargetNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceTargetSearchFilter(BaseModel): """ ActionServiceTargetSearchFilter - """ # noqa: E501 - in_target_ids_filter: Optional[ActionServiceInTargetIDsFilter] = Field(default=None, alias="inTargetIdsFilter") - target_name_filter: Optional[ActionServiceTargetNameFilter] = Field(default=None, alias="targetNameFilter") - __properties: ClassVar[List[str]] = ["inTargetIdsFilter", "targetNameFilter"] + """ + + in_target_ids_filter: Optional[ActionServiceInTargetIDsFilter] = Field( + default=None, alias="inTargetIdsFilter" + ) + target_name_filter: Optional[ActionServiceTargetNameFilter] = Field( + default=None, alias="targetNameFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class ActionServiceTargetSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceTargetSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of in_target_ids_filter - if self.in_target_ids_filter: - _dict['inTargetIdsFilter'] = self.in_target_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of target_name_filter - if self.target_name_filter: - _dict['targetNameFilter'] = self.target_name_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceTargetSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inTargetIdsFilter": ActionServiceInTargetIDsFilter.from_dict(obj["inTargetIdsFilter"]) if obj.get("inTargetIdsFilter") is not None else None, - "targetNameFilter": ActionServiceTargetNameFilter.from_dict(obj["targetNameFilter"]) if obj.get("targetNameFilter") is not None else None - }) - return _obj - +from zitadel_client.models.action_service_in_target_ids_filter import ( + ActionServiceInTargetIDsFilter, +) +from zitadel_client.models.action_service_target_name_filter import ( + ActionServiceTargetNameFilter, +) +ActionServiceTargetSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_text_filter_method.py b/zitadel_client/models/action_service_text_filter_method.py index 1ab70ae4..c08ed6ab 100644 --- a/zitadel_client/models/action_service_text_filter_method.py +++ b/zitadel_client/models/action_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class ActionServiceTextFilterMethod(str, Enum): ActionServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/action_service_timestamp_filter.py b/zitadel_client/models/action_service_timestamp_filter.py index e0bdd9b1..5eb7c9e7 100644 --- a/zitadel_client/models/action_service_timestamp_filter.py +++ b/zitadel_client/models/action_service_timestamp_filter.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_timestamp_filter_method import ActionServiceTimestampFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ActionServiceTimestampFilter(BaseModel): """ ActionServiceTimestampFilter - """ # noqa: E501 - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - method: Optional[ActionServiceTimestampFilterMethod] = None - __properties: ClassVar[List[str]] = ["timestamp", "method"] + """ + + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[ActionServiceTimestampFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class ActionServiceTimestampFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceTimestampFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceTimestampFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.action_service_timestamp_filter_method import ( + ActionServiceTimestampFilterMethod, +) +ActionServiceTimestampFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_timestamp_filter_method.py b/zitadel_client/models/action_service_timestamp_filter_method.py index e7dc248e..c0a09cb1 100644 --- a/zitadel_client/models/action_service_timestamp_filter_method.py +++ b/zitadel_client/models/action_service_timestamp_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ActionServiceTimestampFilterMethod(str, Enum): @@ -23,18 +13,10 @@ class ActionServiceTimestampFilterMethod(str, Enum): ActionServiceTimestampFilterMethod """ - """ - allowed enum values - """ - TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' - TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' - TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ActionServiceTimestampFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS" + TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER" + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS" + TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE" + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = ( + "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS" + ) diff --git a/zitadel_client/models/action_service_update_target_request.py b/zitadel_client/models/action_service_update_target_request.py index 5ce9061a..edb4af14 100644 --- a/zitadel_client/models/action_service_update_target_request.py +++ b/zitadel_client/models/action_service_update_target_request.py @@ -1,45 +1,60 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.action_service_payload_type import ActionServicePayloadType -from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall -from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceUpdateTargetRequest(BaseModel): """ ActionServiceUpdateTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target to update.") - name: Optional[StrictStr] = Field(default=None, description="Optionally, update the name of the target. If not set, the name will not be changed.") - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = Field(default=None, description="The new URL of the endpoint to call. If not set, the endpoint will not be changed.") - expiration_signing_key: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="expirationSigningKey") - payload_type: Optional[ActionServicePayloadType] = Field(default=None, alias="payloadType") - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the target to update.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Optionally, update the name of the target. If not set, the name will not be changed.", + ) + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field( + default=None, + alias="endpoint", + description="The new URL of the endpoint to call. If not set, the endpoint will not be changed.", + ) + expiration_signing_key: Optional[ProtobufDuration] = Field( + default=None, + alias="expirationSigningKey", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + payload_type: Optional[ActionServicePayloadType] = Field( + default=None, alias="payloadType" + ) + rest_async: Optional[object] = Field(default=None, alias="restAsync") rest_call: Optional[ActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[ActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["id", "name", "timeout", "endpoint", "expirationSigningKey", "payloadType", "restAsync", "restCall", "restWebhook"] + rest_webhook: Optional[ActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,76 +62,9 @@ class ActionServiceUpdateTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceUpdateTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if endpoint (nullable) is None - # and model_fields_set contains the field - if self.endpoint is None and "endpoint" in self.model_fields_set: - _dict['endpoint'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceUpdateTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "expirationSigningKey": obj.get("expirationSigningKey"), - "payloadType": obj.get("payloadType"), - "restAsync": obj.get("restAsync"), - "restCall": ActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": ActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.action_service_payload_type import ActionServicePayloadType +from zitadel_client.models.action_service_rest_call import ActionServiceRESTCall +from zitadel_client.models.action_service_rest_webhook import ActionServiceRESTWebhook +ActionServiceUpdateTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/action_service_update_target_response.py b/zitadel_client/models/action_service_update_target_response.py index 4d6f36d8..9f818fe2 100644 --- a/zitadel_client/models/action_service_update_target_response.py +++ b/zitadel_client/models/action_service_update_target_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ActionServiceUpdateTargetResponse(BaseModel): """ ActionServiceUpdateTargetResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - signing_key: Optional[StrictStr] = Field(default=None, description="Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. The key is only returned if expirationSigningKey was set in the request.", alias="signingKey") - __properties: ClassVar[List[str]] = ["changeDate", "signingKey"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + signing_key: Optional[StrictStr] = Field( + default=None, + alias="signingKey", + description="Key used to sign and check payload sent to the target. The key can be used to verify the integrity and authenticity of the request on the receiver side. The key should be treated as a secret and only known to ZITADEL and the receiver. The signature is included in the request header `X-ZITADEL-Signature` and calculated over the raw body of the request using HMAC with SHA256. The key is only returned if expirationSigningKey was set in the request.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,58 +39,6 @@ class ActionServiceUpdateTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ActionServiceUpdateTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if signing_key (nullable) is None - # and model_fields_set contains the field - if self.signing_key is None and "signing_key" in self.model_fields_set: - _dict['signingKey'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ActionServiceUpdateTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate"), - "signingKey": obj.get("signingKey") - }) - return _obj - +from pydantic import AwareDatetime +ActionServiceUpdateTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_any.py b/zitadel_client/models/application_service_any.py index bc86cb0a..058dd191 100644 --- a/zitadel_client/models/application_service_any.py +++ b/zitadel_client/models/application_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class ApplicationServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +ApplicationServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_api_auth_method_type.py b/zitadel_client/models/application_service_api_auth_method_type.py index a6c447c6..51f39b45 100644 --- a/zitadel_client/models/application_service_api_auth_method_type.py +++ b/zitadel_client/models/application_service_api_auth_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceAPIAuthMethodType(str, Enum): @@ -23,15 +13,5 @@ class ApplicationServiceAPIAuthMethodType(str, Enum): ApplicationServiceAPIAuthMethodType """ - """ - allowed enum values - """ - API_AUTH_METHOD_TYPE_BASIC = 'API_AUTH_METHOD_TYPE_BASIC' - API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceAPIAuthMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + API_AUTH_METHOD_TYPE_BASIC = "API_AUTH_METHOD_TYPE_BASIC" + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT" diff --git a/zitadel_client/models/application_service_api_configuration.py b/zitadel_client/models/application_service_api_configuration.py index a1d108a6..2d42da9e 100644 --- a/zitadel_client/models/application_service_api_configuration.py +++ b/zitadel_client/models/application_service_api_configuration.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_api_auth_method_type import ApplicationServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceAPIConfiguration(BaseModel): """ ApplicationServiceAPIConfiguration - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint.", alias="clientId") - auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["clientId", "authMethodType"] + """ + + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint.", + ) + auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ApplicationServiceAPIConfiguration(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceAPIConfiguration from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceAPIConfiguration from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.application_service_api_auth_method_type import ( + ApplicationServiceAPIAuthMethodType, +) +ApplicationServiceAPIConfiguration.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application.py b/zitadel_client/models/application_service_application.py index 4d9e9fcf..61ed1816 100644 --- a/zitadel_client/models/application_service_application.py +++ b/zitadel_client/models/application_service_application.py @@ -1,47 +1,64 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_api_configuration import ApplicationServiceAPIConfiguration -from zitadel_client.models.application_service_application_state import ApplicationServiceApplicationState -from zitadel_client.models.application_service_oidc_configuration import ApplicationServiceOIDCConfiguration -from zitadel_client.models.application_service_saml_configuration import ApplicationServiceSAMLConfiguration -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplication(BaseModel): """ ApplicationServiceApplication - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the application.", alias="applicationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - state: Optional[ApplicationServiceApplicationState] = None - name: Optional[StrictStr] = Field(default=None, description="The name of the application. This can be displayed to users.") - project_id: Optional[StrictStr] = Field(default=None, description="The ProjectID represents the ID of the project the application belongs to.", alias="projectId") - api_configuration: Optional[ApplicationServiceAPIConfiguration] = Field(default=None, alias="apiConfiguration") - oidc_configuration: Optional[ApplicationServiceOIDCConfiguration] = Field(default=None, alias="oidcConfiguration") - saml_configuration: Optional[ApplicationServiceSAMLConfiguration] = Field(default=None, alias="samlConfiguration") - __properties: ClassVar[List[str]] = ["applicationId", "creationDate", "changeDate", "state", "name", "projectId", "apiConfiguration", "oidcConfiguration", "samlConfiguration"] + """ + + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique identifier of the application.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[ApplicationServiceApplicationState] = Field( + default=None, alias="state" + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="The name of the application. This can be displayed to users.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ProjectID represents the ID of the project the application belongs to.", + ) + api_configuration: Optional[ApplicationServiceAPIConfiguration] = Field( + default=None, alias="apiConfiguration" + ) + oidc_configuration: Optional[ApplicationServiceOIDCConfiguration] = Field( + default=None, alias="oidcConfiguration" + ) + saml_configuration: Optional[ApplicationServiceSAMLConfiguration] = Field( + default=None, alias="samlConfiguration" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -49,69 +66,18 @@ class ApplicationServiceApplication(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplication from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_configuration - if self.api_configuration: - _dict['apiConfiguration'] = self.api_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_configuration - if self.oidc_configuration: - _dict['oidcConfiguration'] = self.oidc_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_configuration - if self.saml_configuration: - _dict['samlConfiguration'] = self.saml_configuration.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplication from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "state": obj.get("state"), - "name": obj.get("name"), - "projectId": obj.get("projectId"), - "apiConfiguration": ApplicationServiceAPIConfiguration.from_dict(obj["apiConfiguration"]) if obj.get("apiConfiguration") is not None else None, - "oidcConfiguration": ApplicationServiceOIDCConfiguration.from_dict(obj["oidcConfiguration"]) if obj.get("oidcConfiguration") is not None else None, - "samlConfiguration": ApplicationServiceSAMLConfiguration.from_dict(obj["samlConfiguration"]) if obj.get("samlConfiguration") is not None else None - }) - return _obj - - +from pydantic import AwareDatetime +from zitadel_client.models.application_service_api_configuration import ( + ApplicationServiceAPIConfiguration, +) +from zitadel_client.models.application_service_application_state import ( + ApplicationServiceApplicationState, +) +from zitadel_client.models.application_service_oidc_configuration import ( + ApplicationServiceOIDCConfiguration, +) +from zitadel_client.models.application_service_saml_configuration import ( + ApplicationServiceSAMLConfiguration, +) + +ApplicationServiceApplication.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_key.py b/zitadel_client/models/application_service_application_key.py index a9d73859..ac552099 100644 --- a/zitadel_client/models/application_service_application_key.py +++ b/zitadel_client/models/application_service_application_key.py @@ -1,40 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplicationKey(BaseModel): """ ApplicationServiceApplicationKey - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the application key.", alias="keyId") - application_id: Optional[StrictStr] = Field(default=None, description="The identifier of the application this key belongs to.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The identifier of the project this application belongs to.", alias="projectId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - organization_id: Optional[StrictStr] = Field(default=None, description="The identifier of the organization this application belongs to.", alias="organizationId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["keyId", "applicationId", "projectId", "creationDate", "organizationId", "expirationDate"] + """ + + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="The unique identifier of the application key.", + ) + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The identifier of the application this key belongs to.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The identifier of the project this application belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The identifier of the organization this application belongs to.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +59,6 @@ class ApplicationServiceApplicationKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId"), - "creationDate": obj.get("creationDate"), - "organizationId": obj.get("organizationId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceApplicationKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_key_application_id_filter.py b/zitadel_client/models/application_service_application_key_application_id_filter.py index 8b615f0b..69e5f643 100644 --- a/zitadel_client/models/application_service_application_key_application_id_filter.py +++ b/zitadel_client/models/application_service_application_key_application_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplicationKeyApplicationIDFilter(BaseModel): """ ApplicationServiceApplicationKeyApplicationIDFilter - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="Search for application keys belonging to the application with this ID.", alias="applicationId") - __properties: ClassVar[List[str]] = ["applicationId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="Search for application keys belonging to the application with this ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceApplicationKeyApplicationIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyApplicationIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyApplicationIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId") - }) - return _obj - - +ApplicationServiceApplicationKeyApplicationIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_key_organization_id_filter.py b/zitadel_client/models/application_service_application_key_organization_id_filter.py index 486e5d8f..4e0b2108 100644 --- a/zitadel_client/models/application_service_application_key_organization_id_filter.py +++ b/zitadel_client/models/application_service_application_key_organization_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplicationKeyOrganizationIDFilter(BaseModel): """ ApplicationServiceApplicationKeyOrganizationIDFilter - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Search for application keys belonging to applications in the organization with this ID.", alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Search for application keys belonging to applications in the organization with this ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceApplicationKeyOrganizationIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyOrganizationIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyOrganizationIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +ApplicationServiceApplicationKeyOrganizationIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_key_project_id_filter.py b/zitadel_client/models/application_service_application_key_project_id_filter.py index 49025eb1..b3832e3a 100644 --- a/zitadel_client/models/application_service_application_key_project_id_filter.py +++ b/zitadel_client/models/application_service_application_key_project_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplicationKeyProjectIDFilter(BaseModel): """ ApplicationServiceApplicationKeyProjectIDFilter - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="Search for application keys belonging to applications in the project with this ID.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Search for application keys belonging to applications in the project with this ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceApplicationKeyProjectIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyProjectIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeyProjectIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceApplicationKeyProjectIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_key_search_filter.py b/zitadel_client/models/application_service_application_key_search_filter.py index 23026ed3..2ef2ec1e 100644 --- a/zitadel_client/models/application_service_application_key_search_filter.py +++ b/zitadel_client/models/application_service_application_key_search_filter.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_application_key_application_id_filter import ApplicationServiceApplicationKeyApplicationIDFilter -from zitadel_client.models.application_service_application_key_organization_id_filter import ApplicationServiceApplicationKeyOrganizationIDFilter -from zitadel_client.models.application_service_application_key_project_id_filter import ApplicationServiceApplicationKeyProjectIDFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceApplicationKeySearchFilter(BaseModel): """ ApplicationServiceApplicationKeySearchFilter - """ # noqa: E501 - application_id_filter: Optional[ApplicationServiceApplicationKeyApplicationIDFilter] = Field(default=None, alias="applicationIdFilter") - organization_id_filter: Optional[ApplicationServiceApplicationKeyOrganizationIDFilter] = Field(default=None, alias="organizationIdFilter") - project_id_filter: Optional[ApplicationServiceApplicationKeyProjectIDFilter] = Field(default=None, alias="projectIdFilter") - __properties: ClassVar[List[str]] = ["applicationIdFilter", "organizationIdFilter", "projectIdFilter"] + """ + application_id_filter: Optional[ + ApplicationServiceApplicationKeyApplicationIDFilter + ] = Field(default=None, alias="applicationIdFilter") + organization_id_filter: Optional[ + ApplicationServiceApplicationKeyOrganizationIDFilter + ] = Field(default=None, alias="organizationIdFilter") + project_id_filter: Optional[ApplicationServiceApplicationKeyProjectIDFilter] = ( + Field(default=None, alias="projectIdFilter") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,14 @@ class ApplicationServiceApplicationKeySearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeySearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of application_id_filter - if self.application_id_filter: - _dict['applicationIdFilter'] = self.application_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_filter - if self.organization_id_filter: - _dict['organizationIdFilter'] = self.organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_id_filter - if self.project_id_filter: - _dict['projectIdFilter'] = self.project_id_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationKeySearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationIdFilter": ApplicationServiceApplicationKeyApplicationIDFilter.from_dict(obj["applicationIdFilter"]) if obj.get("applicationIdFilter") is not None else None, - "organizationIdFilter": ApplicationServiceApplicationKeyOrganizationIDFilter.from_dict(obj["organizationIdFilter"]) if obj.get("organizationIdFilter") is not None else None, - "projectIdFilter": ApplicationServiceApplicationKeyProjectIDFilter.from_dict(obj["projectIdFilter"]) if obj.get("projectIdFilter") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application_key_application_id_filter import ( + ApplicationServiceApplicationKeyApplicationIDFilter, +) +from zitadel_client.models.application_service_application_key_organization_id_filter import ( + ApplicationServiceApplicationKeyOrganizationIDFilter, +) +from zitadel_client.models.application_service_application_key_project_id_filter import ( + ApplicationServiceApplicationKeyProjectIDFilter, +) +ApplicationServiceApplicationKeySearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_keys_sorting.py b/zitadel_client/models/application_service_application_keys_sorting.py index 54cd0810..56555024 100644 --- a/zitadel_client/models/application_service_application_keys_sorting.py +++ b/zitadel_client/models/application_service_application_keys_sorting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceApplicationKeysSorting(str, Enum): @@ -23,20 +13,12 @@ class ApplicationServiceApplicationKeysSorting(str, Enum): ApplicationServiceApplicationKeysSorting """ - """ - allowed enum values - """ - APPLICATION_KEYS_SORT_BY_ID = 'APPLICATION_KEYS_SORT_BY_ID' - APPLICATION_KEYS_SORT_BY_PROJECT_ID = 'APPLICATION_KEYS_SORT_BY_PROJECT_ID' - APPLICATION_KEYS_SORT_BY_APPLICATION_ID = 'APPLICATION_KEYS_SORT_BY_APPLICATION_ID' - APPLICATION_KEYS_SORT_BY_CREATION_DATE = 'APPLICATION_KEYS_SORT_BY_CREATION_DATE' - APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = 'APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID' - APPLICATION_KEYS_SORT_BY_EXPIRATION = 'APPLICATION_KEYS_SORT_BY_EXPIRATION' - APPLICATION_KEYS_SORT_BY_TYPE = 'APPLICATION_KEYS_SORT_BY_TYPE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceApplicationKeysSorting from a JSON string""" - return cls(json.loads(json_str)) - - + APPLICATION_KEYS_SORT_BY_ID = "APPLICATION_KEYS_SORT_BY_ID" + APPLICATION_KEYS_SORT_BY_PROJECT_ID = "APPLICATION_KEYS_SORT_BY_PROJECT_ID" + APPLICATION_KEYS_SORT_BY_APPLICATION_ID = "APPLICATION_KEYS_SORT_BY_APPLICATION_ID" + APPLICATION_KEYS_SORT_BY_CREATION_DATE = "APPLICATION_KEYS_SORT_BY_CREATION_DATE" + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = ( + "APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID" + ) + APPLICATION_KEYS_SORT_BY_EXPIRATION = "APPLICATION_KEYS_SORT_BY_EXPIRATION" + APPLICATION_KEYS_SORT_BY_TYPE = "APPLICATION_KEYS_SORT_BY_TYPE" diff --git a/zitadel_client/models/application_service_application_name_filter.py b/zitadel_client/models/application_service_application_name_filter.py index bc406fa6..f4f56388 100644 --- a/zitadel_client/models/application_service_application_name_filter.py +++ b/zitadel_client/models/application_service_application_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_text_filter_method import ApplicationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceApplicationNameFilter(BaseModel): """ ApplicationServiceApplicationNameFilter - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The name of the application to search for.") - method: Optional[ApplicationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="The name of the application to search for.", + ) + method: Optional[ApplicationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ApplicationServiceApplicationNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.application_service_text_filter_method import ( + ApplicationServiceTextFilterMethod, +) +ApplicationServiceApplicationNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_search_filter.py b/zitadel_client/models/application_service_application_search_filter.py index 029f6b30..3ca3ec44 100644 --- a/zitadel_client/models/application_service_application_search_filter.py +++ b/zitadel_client/models/application_service_application_search_filter.py @@ -1,45 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_application_name_filter import ApplicationServiceApplicationNameFilter -from zitadel_client.models.application_service_application_state import ApplicationServiceApplicationState -from zitadel_client.models.application_service_application_type import ApplicationServiceApplicationType -from zitadel_client.models.application_service_client_id_filter import ApplicationServiceClientIDFilter -from zitadel_client.models.application_service_entity_id_filter import ApplicationServiceEntityIDFilter -from zitadel_client.models.application_service_project_id_filter import ApplicationServiceProjectIDFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceApplicationSearchFilter(BaseModel): """ ApplicationServiceApplicationSearchFilter - """ # noqa: E501 - client_id_filter: Optional[ApplicationServiceClientIDFilter] = Field(default=None, alias="clientIdFilter") - entity_id_filter: Optional[ApplicationServiceEntityIDFilter] = Field(default=None, alias="entityIdFilter") - name_filter: Optional[ApplicationServiceApplicationNameFilter] = Field(default=None, alias="nameFilter") - project_id_filter: Optional[ApplicationServiceProjectIDFilter] = Field(default=None, alias="projectIdFilter") - state_filter: Optional[ApplicationServiceApplicationState] = Field(default=None, alias="stateFilter") - type_filter: Optional[ApplicationServiceApplicationType] = Field(default=None, alias="typeFilter") - __properties: ClassVar[List[str]] = ["clientIdFilter", "entityIdFilter", "nameFilter", "projectIdFilter", "stateFilter", "typeFilter"] + """ + client_id_filter: Optional[ApplicationServiceClientIDFilter] = Field( + default=None, alias="clientIdFilter" + ) + entity_id_filter: Optional[ApplicationServiceEntityIDFilter] = Field( + default=None, alias="entityIdFilter" + ) + name_filter: Optional[ApplicationServiceApplicationNameFilter] = Field( + default=None, alias="nameFilter" + ) + project_id_filter: Optional[ApplicationServiceProjectIDFilter] = Field( + default=None, alias="projectIdFilter" + ) + state_filter: Optional[ApplicationServiceApplicationState] = Field( + default=None, alias="stateFilter" + ) + type_filter: Optional[ApplicationServiceApplicationType] = Field( + default=None, alias="typeFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,69 +46,23 @@ class ApplicationServiceApplicationSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of client_id_filter - if self.client_id_filter: - _dict['clientIdFilter'] = self.client_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of entity_id_filter - if self.entity_id_filter: - _dict['entityIdFilter'] = self.entity_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of name_filter - if self.name_filter: - _dict['nameFilter'] = self.name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_id_filter - if self.project_id_filter: - _dict['projectIdFilter'] = self.project_id_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceApplicationSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientIdFilter": ApplicationServiceClientIDFilter.from_dict(obj["clientIdFilter"]) if obj.get("clientIdFilter") is not None else None, - "entityIdFilter": ApplicationServiceEntityIDFilter.from_dict(obj["entityIdFilter"]) if obj.get("entityIdFilter") is not None else None, - "nameFilter": ApplicationServiceApplicationNameFilter.from_dict(obj["nameFilter"]) if obj.get("nameFilter") is not None else None, - "projectIdFilter": ApplicationServiceProjectIDFilter.from_dict(obj["projectIdFilter"]) if obj.get("projectIdFilter") is not None else None, - "stateFilter": obj.get("stateFilter"), - "typeFilter": obj.get("typeFilter") - }) - return _obj - - +from zitadel_client.models.application_service_application_name_filter import ( + ApplicationServiceApplicationNameFilter, +) +from zitadel_client.models.application_service_application_state import ( + ApplicationServiceApplicationState, +) +from zitadel_client.models.application_service_application_type import ( + ApplicationServiceApplicationType, +) +from zitadel_client.models.application_service_client_id_filter import ( + ApplicationServiceClientIDFilter, +) +from zitadel_client.models.application_service_entity_id_filter import ( + ApplicationServiceEntityIDFilter, +) +from zitadel_client.models.application_service_project_id_filter import ( + ApplicationServiceProjectIDFilter, +) + +ApplicationServiceApplicationSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_application_sorting.py b/zitadel_client/models/application_service_application_sorting.py index f4af639e..6d83dc68 100644 --- a/zitadel_client/models/application_service_application_sorting.py +++ b/zitadel_client/models/application_service_application_sorting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceApplicationSorting(str, Enum): @@ -23,18 +13,8 @@ class ApplicationServiceApplicationSorting(str, Enum): ApplicationServiceApplicationSorting """ - """ - allowed enum values - """ - APPLICATION_SORT_BY_ID = 'APPLICATION_SORT_BY_ID' - APPLICATION_SORT_BY_NAME = 'APPLICATION_SORT_BY_NAME' - APPLICATION_SORT_BY_STATE = 'APPLICATION_SORT_BY_STATE' - APPLICATION_SORT_BY_CREATION_DATE = 'APPLICATION_SORT_BY_CREATION_DATE' - APPLICATION_SORT_BY_CHANGE_DATE = 'APPLICATION_SORT_BY_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceApplicationSorting from a JSON string""" - return cls(json.loads(json_str)) - - + APPLICATION_SORT_BY_ID = "APPLICATION_SORT_BY_ID" + APPLICATION_SORT_BY_NAME = "APPLICATION_SORT_BY_NAME" + APPLICATION_SORT_BY_STATE = "APPLICATION_SORT_BY_STATE" + APPLICATION_SORT_BY_CREATION_DATE = "APPLICATION_SORT_BY_CREATION_DATE" + APPLICATION_SORT_BY_CHANGE_DATE = "APPLICATION_SORT_BY_CHANGE_DATE" diff --git a/zitadel_client/models/application_service_application_state.py b/zitadel_client/models/application_service_application_state.py index 57343946..4182831e 100644 --- a/zitadel_client/models/application_service_application_state.py +++ b/zitadel_client/models/application_service_application_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceApplicationState(str, Enum): @@ -23,17 +13,7 @@ class ApplicationServiceApplicationState(str, Enum): ApplicationServiceApplicationState """ - """ - allowed enum values - """ - APPLICATION_STATE_UNSPECIFIED = 'APPLICATION_STATE_UNSPECIFIED' - APPLICATION_STATE_ACTIVE = 'APPLICATION_STATE_ACTIVE' - APPLICATION_STATE_INACTIVE = 'APPLICATION_STATE_INACTIVE' - APPLICATION_STATE_REMOVED = 'APPLICATION_STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceApplicationState from a JSON string""" - return cls(json.loads(json_str)) - - + APPLICATION_STATE_UNSPECIFIED = "APPLICATION_STATE_UNSPECIFIED" + APPLICATION_STATE_ACTIVE = "APPLICATION_STATE_ACTIVE" + APPLICATION_STATE_INACTIVE = "APPLICATION_STATE_INACTIVE" + APPLICATION_STATE_REMOVED = "APPLICATION_STATE_REMOVED" diff --git a/zitadel_client/models/application_service_application_type.py b/zitadel_client/models/application_service_application_type.py index 97c42995..06e4e206 100644 --- a/zitadel_client/models/application_service_application_type.py +++ b/zitadel_client/models/application_service_application_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceApplicationType(str, Enum): @@ -23,17 +13,7 @@ class ApplicationServiceApplicationType(str, Enum): ApplicationServiceApplicationType """ - """ - allowed enum values - """ - APPLICATION_TYPE_UNSPECIFIED = 'APPLICATION_TYPE_UNSPECIFIED' - APPLICATION_TYPE_OIDC = 'APPLICATION_TYPE_OIDC' - APPLICATION_TYPE_API = 'APPLICATION_TYPE_API' - APPLICATION_TYPE_SAML = 'APPLICATION_TYPE_SAML' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceApplicationType from a JSON string""" - return cls(json.loads(json_str)) - - + APPLICATION_TYPE_UNSPECIFIED = "APPLICATION_TYPE_UNSPECIFIED" + APPLICATION_TYPE_OIDC = "APPLICATION_TYPE_OIDC" + APPLICATION_TYPE_API = "APPLICATION_TYPE_API" + APPLICATION_TYPE_SAML = "APPLICATION_TYPE_SAML" diff --git a/zitadel_client/models/application_service_client_id_filter.py b/zitadel_client/models/application_service_client_id_filter.py index d2f0b20f..193ef93e 100644 --- a/zitadel_client/models/application_service_client_id_filter.py +++ b/zitadel_client/models/application_service_client_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceClientIDFilter(BaseModel): """ ApplicationServiceClientIDFilter - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The clientID to search for. The search is performed as an exact match.", alias="clientId") - __properties: ClassVar[List[str]] = ["clientId"] + """ + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The clientID to search for. The search is performed as an exact match.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceClientIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceClientIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceClientIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId") - }) - return _obj - - +ApplicationServiceClientIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_connect_error.py b/zitadel_client/models/application_service_connect_error.py index 5f4fa377..f46fcabb 100644 --- a/zitadel_client/models/application_service_connect_error.py +++ b/zitadel_client/models/application_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_any import ApplicationServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class ApplicationServiceConnectErrorCodeEnum(str, Enum): + """ApplicationServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class ApplicationServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[ApplicationServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[ApplicationServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[ApplicationServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [ApplicationServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.application_service_any import ApplicationServiceAny +ApplicationServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_api_application_request.py b/zitadel_client/models/application_service_create_api_application_request.py index 1ef7733e..5cb6904c 100644 --- a/zitadel_client/models/application_service_create_api_application_request.py +++ b/zitadel_client/models/application_service_create_api_application_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_api_auth_method_type import ApplicationServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceCreateAPIApplicationRequest(BaseModel): """ ApplicationServiceCreateAPIApplicationRequest - """ # noqa: E501 - auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["authMethodType"] + """ + auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class ApplicationServiceCreateAPIApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateAPIApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateAPIApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.application_service_api_auth_method_type import ( + ApplicationServiceAPIAuthMethodType, +) +ApplicationServiceCreateAPIApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_api_application_response.py b/zitadel_client/models/application_service_create_api_application_response.py index a58b099c..ac721372 100644 --- a/zitadel_client/models/application_service_create_api_application_response.py +++ b/zitadel_client/models/application_service_create_api_application_response.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateAPIApplicationResponse(BaseModel): """ ApplicationServiceCreateAPIApplicationResponse - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint.", alias="clientId") - client_secret: Optional[StrictStr] = Field(default=None, description="In case of using the APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint.", alias="clientSecret") - __properties: ClassVar[List[str]] = ["clientId", "clientSecret"] + """ + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The unique OAuth2 client_id used for authentication of the API, e.g. at the introspection endpoint.", + ) + client_secret: Optional[StrictStr] = Field( + default=None, + alias="clientSecret", + description="In case of using the APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ApplicationServiceCreateAPIApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateAPIApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateAPIApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "clientSecret": obj.get("clientSecret") - }) - return _obj - - +ApplicationServiceCreateAPIApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_application_key_request.py b/zitadel_client/models/application_service_create_application_key_request.py index be9103a8..e66da9f3 100644 --- a/zitadel_client/models/application_service_create_application_key_request.py +++ b/zitadel_client/models/application_service_create_application_key_request.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateApplicationKeyRequest(BaseModel): """ ApplicationServiceCreateApplicationKeyRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The ID of the application the key will be created for.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["applicationId", "projectId", "expirationDate"] + """ + + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The ID of the application the key will be created for.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,6 @@ class ApplicationServiceCreateApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceCreateApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_application_key_response.py b/zitadel_client/models/application_service_create_application_key_response.py index f767fd57..497e16f8 100644 --- a/zitadel_client/models/application_service_create_application_key_response.py +++ b/zitadel_client/models/application_service_create_application_key_response.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateApplicationKeyResponse(BaseModel): """ ApplicationServiceCreateApplicationKeyResponse - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the newly created application key.", alias="keyId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - key_details: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="KeyDetails contains the serialized private key and additional information depending on the key type. It must be stored safely, as it will not be possible to retrieve it again. A new key can be generated using the CreateApplicationKey endpoint.", alias="keyDetails") - __properties: ClassVar[List[str]] = ["keyId", "creationDate", "keyDetails"] + """ + + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="The unique ID of the newly created application key.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + key_details: Optional[Base64Bytes] = Field( + default=None, + alias="keyDetails", + description="KeyDetails contains the serialized private key and additional information depending on the key type. It must be stored safely, as it will not be possible to retrieve it again. A new key can be generated using the CreateApplicationKey endpoint.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,7 @@ class ApplicationServiceCreateApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "creationDate": obj.get("creationDate"), - "keyDetails": obj.get("keyDetails") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +ApplicationServiceCreateApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_application_request.py b/zitadel_client/models/application_service_create_application_request.py index 4df8d37e..a4ba25e7 100644 --- a/zitadel_client/models/application_service_create_application_request.py +++ b/zitadel_client/models/application_service_create_application_request.py @@ -1,42 +1,51 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_create_api_application_request import ApplicationServiceCreateAPIApplicationRequest -from zitadel_client.models.application_service_create_oidc_application_request import ApplicationServiceCreateOIDCApplicationRequest -from zitadel_client.models.application_service_create_saml_application_request import ApplicationServiceCreateSAMLApplicationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateApplicationRequest(BaseModel): """ ApplicationServiceCreateApplicationRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application will be created in.", alias="projectId") - application_id: Optional[StrictStr] = Field(default=None, description="Optionally, provide the unique ID of the new application. If omitted, the system will generate one for you, which is the recommended way. The generated ID will be returned in the response.", alias="applicationId") - name: Optional[StrictStr] = Field(default=None, description="Publicly visible name of the application. This might be presented to users if they sign in.") - api_configuration: Optional[ApplicationServiceCreateAPIApplicationRequest] = Field(default=None, alias="apiConfiguration") - oidc_configuration: Optional[ApplicationServiceCreateOIDCApplicationRequest] = Field(default=None, alias="oidcConfiguration") - saml_configuration: Optional[ApplicationServiceCreateSAMLApplicationRequest] = Field(default=None, alias="samlConfiguration") - __properties: ClassVar[List[str]] = ["projectId", "applicationId", "name", "apiConfiguration", "oidcConfiguration", "samlConfiguration"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application will be created in.", + ) + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="Optionally, provide the unique ID of the new application. If omitted, the system will generate one for you, which is the recommended way. The generated ID will be returned in the response.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Publicly visible name of the application. This might be presented to users if they sign in.", + ) + api_configuration: Optional[ApplicationServiceCreateAPIApplicationRequest] = Field( + default=None, alias="apiConfiguration" + ) + oidc_configuration: Optional[ApplicationServiceCreateOIDCApplicationRequest] = ( + Field(default=None, alias="oidcConfiguration") + ) + saml_configuration: Optional[ApplicationServiceCreateSAMLApplicationRequest] = ( + Field(default=None, alias="samlConfiguration") + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,66 +53,14 @@ class ApplicationServiceCreateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_configuration - if self.api_configuration: - _dict['apiConfiguration'] = self.api_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_configuration - if self.oidc_configuration: - _dict['oidcConfiguration'] = self.oidc_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_configuration - if self.saml_configuration: - _dict['samlConfiguration'] = self.saml_configuration.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "applicationId": obj.get("applicationId"), - "name": obj.get("name"), - "apiConfiguration": ApplicationServiceCreateAPIApplicationRequest.from_dict(obj["apiConfiguration"]) if obj.get("apiConfiguration") is not None else None, - "oidcConfiguration": ApplicationServiceCreateOIDCApplicationRequest.from_dict(obj["oidcConfiguration"]) if obj.get("oidcConfiguration") is not None else None, - "samlConfiguration": ApplicationServiceCreateSAMLApplicationRequest.from_dict(obj["samlConfiguration"]) if obj.get("samlConfiguration") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_create_api_application_request import ( + ApplicationServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.application_service_create_oidc_application_request import ( + ApplicationServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.application_service_create_saml_application_request import ( + ApplicationServiceCreateSAMLApplicationRequest, +) +ApplicationServiceCreateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_application_response.py b/zitadel_client/models/application_service_create_application_response.py index cbf235ce..f244d54c 100644 --- a/zitadel_client/models/application_service_create_application_response.py +++ b/zitadel_client/models/application_service_create_application_response.py @@ -1,41 +1,46 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_create_api_application_response import ApplicationServiceCreateAPIApplicationResponse -from zitadel_client.models.application_service_create_oidc_application_response import ApplicationServiceCreateOIDCApplicationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateApplicationResponse(BaseModel): """ ApplicationServiceCreateApplicationResponse - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the newly created application.", alias="applicationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - api_configuration: Optional[ApplicationServiceCreateAPIApplicationResponse] = Field(default=None, alias="apiConfiguration") - oidc_configuration: Optional[ApplicationServiceCreateOIDCApplicationResponse] = Field(default=None, alias="oidcConfiguration") - saml_configuration: Optional[Dict[str, Any]] = Field(default=None, alias="samlConfiguration") - __properties: ClassVar[List[str]] = ["applicationId", "creationDate", "apiConfiguration", "oidcConfiguration", "samlConfiguration"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the newly created application.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + api_configuration: Optional[ApplicationServiceCreateAPIApplicationResponse] = Field( + default=None, alias="apiConfiguration" + ) + oidc_configuration: Optional[ApplicationServiceCreateOIDCApplicationResponse] = ( + Field(default=None, alias="oidcConfiguration") + ) + saml_configuration: Optional[object] = Field( + default=None, alias="samlConfiguration" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,62 +48,12 @@ class ApplicationServiceCreateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_configuration - if self.api_configuration: - _dict['apiConfiguration'] = self.api_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_configuration - if self.oidc_configuration: - _dict['oidcConfiguration'] = self.oidc_configuration.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "creationDate": obj.get("creationDate"), - "apiConfiguration": ApplicationServiceCreateAPIApplicationResponse.from_dict(obj["apiConfiguration"]) if obj.get("apiConfiguration") is not None else None, - "oidcConfiguration": ApplicationServiceCreateOIDCApplicationResponse.from_dict(obj["oidcConfiguration"]) if obj.get("oidcConfiguration") is not None else None, - "samlConfiguration": obj.get("samlConfiguration") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.application_service_create_api_application_response import ( + ApplicationServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.application_service_create_oidc_application_response import ( + ApplicationServiceCreateOIDCApplicationResponse, +) +ApplicationServiceCreateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_oidc_application_request.py b/zitadel_client/models/application_service_create_oidc_application_request.py index 0482d3fe..3ff286a3 100644 --- a/zitadel_client/models/application_service_create_oidc_application_request.py +++ b/zitadel_client/models/application_service_create_oidc_application_request.py @@ -1,57 +1,102 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from zitadel_client.models.application_service_oidc_application_type import ApplicationServiceOIDCApplicationType -from zitadel_client.models.application_service_oidc_auth_method_type import ApplicationServiceOIDCAuthMethodType -from zitadel_client.models.application_service_oidc_grant_type import ApplicationServiceOIDCGrantType -from zitadel_client.models.application_service_oidc_response_type import ApplicationServiceOIDCResponseType -from zitadel_client.models.application_service_oidc_token_type import ApplicationServiceOIDCTokenType -from zitadel_client.models.application_service_oidc_version import ApplicationServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class ApplicationServiceCreateOIDCApplicationRequest(BaseModel): """ ApplicationServiceCreateOIDCApplicationRequest - """ # noqa: E501 - redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs.", alias="redirectUris") - response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field(default=None, description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values.", alias="responseTypes") - grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field(default=None, description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow.", alias="grantTypes") - application_type: Optional[ApplicationServiceOIDCApplicationType] = Field(default=None, alias="applicationType") - auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs.", alias="postLogoutRedirectUris") - version: Optional[ApplicationServiceOIDCVersion] = None - development_mode: Optional[StrictBool] = Field(default=None, description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs.", alias="developmentMode") - access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project.", alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project.", alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable.", alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin.", alias="additionalOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly.", alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html).", alias="backChannelLogoutUri") - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "applicationType", "authMethodType", "postLogoutRedirectUris", "version", "developmentMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + """ + + redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="redirectUris", + description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs.", + ) + response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field( + default=None, + alias="responseTypes", + description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values.", + ) + grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field( + default=None, + alias="grantTypes", + description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow.", + ) + application_type: Optional[ApplicationServiceOIDCApplicationType] = Field( + default=None, alias="applicationType" + ) + auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="postLogoutRedirectUris", + description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs.", + ) + version: Optional[ApplicationServiceOIDCVersion] = Field( + default=None, alias="version" + ) + development_mode: Optional[StrictBool] = Field( + default=None, + alias="developmentMode", + description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs.", + ) + access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="accessTokenRoleAssertion", + description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project.", + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenRoleAssertion", + description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project.", + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenUserinfoAssertion", + description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable.", + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, + alias="additionalOrigins", + description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin.", + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, + alias="skipNativeAppSuccessPage", + description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly.", + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, + alias="backChannelLogoutUri", + description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html).", + ) + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -59,71 +104,27 @@ class ApplicationServiceCreateOIDCApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateOIDCApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateOIDCApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "applicationType": obj.get("applicationType"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "developmentMode": obj.get("developmentMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +from zitadel_client.models.application_service_oidc_application_type import ( + ApplicationServiceOIDCApplicationType, +) +from zitadel_client.models.application_service_oidc_auth_method_type import ( + ApplicationServiceOIDCAuthMethodType, +) +from zitadel_client.models.application_service_oidc_grant_type import ( + ApplicationServiceOIDCGrantType, +) +from zitadel_client.models.application_service_oidc_response_type import ( + ApplicationServiceOIDCResponseType, +) +from zitadel_client.models.application_service_oidc_token_type import ( + ApplicationServiceOIDCTokenType, +) +from zitadel_client.models.application_service_oidc_version import ( + ApplicationServiceOIDCVersion, +) + +ApplicationServiceCreateOIDCApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_oidc_application_response.py b/zitadel_client/models/application_service_create_oidc_application_response.py index 2f2f3a6c..6d737606 100644 --- a/zitadel_client/models/application_service_create_oidc_application_response.py +++ b/zitadel_client/models/application_service_create_oidc_application_response.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_oidc_localized_message import ApplicationServiceOIDCLocalizedMessage -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class ApplicationServiceCreateOIDCApplicationResponse(BaseModel): """ ApplicationServiceCreateOIDCApplicationResponse - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint.", alias="clientId") - client_secret: Optional[StrictStr] = Field(default=None, description="In case of using the OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_BASIC or OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_POST the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint.", alias="clientSecret") - non_compliant: Optional[StrictBool] = Field(default=None, description="NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field.", alias="nonCompliant") - compliance_problems: Optional[List[ApplicationServiceOIDCLocalizedMessage]] = Field(default=None, description="ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty.", alias="complianceProblems") - __properties: ClassVar[List[str]] = ["clientId", "clientSecret", "nonCompliant", "complianceProblems"] + """ + + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint.", + ) + client_secret: Optional[StrictStr] = Field( + default=None, + alias="clientSecret", + description="In case of using the OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_BASIC or OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_CLIENT_SECRET_POST the client_secret is generated and returned. It must be stored safely, as it will not be possible to retrieve it again. A new client_secret can be generated using the GenerateClientSecret endpoint.", + ) + non_compliant: Optional[StrictBool] = Field( + default=None, + alias="nonCompliant", + description="NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field.", + ) + compliance_problems: Optional[List[ApplicationServiceOIDCLocalizedMessage]] = Field( + default=None, + alias="complianceProblems", + description="ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,62 +49,8 @@ class ApplicationServiceCreateOIDCApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateOIDCApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in compliance_problems (list) - _items = [] - if self.compliance_problems: - for _item_compliance_problems in self.compliance_problems: - if _item_compliance_problems: - _items.append(_item_compliance_problems.to_dict()) - _dict['complianceProblems'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateOIDCApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "clientSecret": obj.get("clientSecret"), - "nonCompliant": obj.get("nonCompliant"), - "complianceProblems": [ApplicationServiceOIDCLocalizedMessage.from_dict(_item) for _item in obj["complianceProblems"]] if obj.get("complianceProblems") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_oidc_localized_message import ( + ApplicationServiceOIDCLocalizedMessage, +) +ApplicationServiceCreateOIDCApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_create_saml_application_request.py b/zitadel_client/models/application_service_create_saml_application_request.py index fa995afe..98317261 100644 --- a/zitadel_client/models/application_service_create_saml_application_request.py +++ b/zitadel_client/models/application_service_create_saml_application_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceCreateSAMLApplicationRequest(BaseModel): """ ApplicationServiceCreateSAMLApplicationRequest - """ # noqa: E501 - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") + """ + + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) metadata_url: Optional[StrictStr] = Field(default=None, alias="metadataUrl") - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="metadataXml") - __properties: ClassVar[List[str]] = ["loginVersion", "metadataUrl", "metadataXml"] + metadata_xml: Optional[Base64Bytes] = Field(default=None, alias="metadataXml") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,9 @@ class ApplicationServiceCreateSAMLApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateSAMLApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceCreateSAMLApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None, - "metadataUrl": obj.get("metadataUrl"), - "metadataXml": obj.get("metadataXml") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +ApplicationServiceCreateSAMLApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_deactivate_application_request.py b/zitadel_client/models/application_service_deactivate_application_request.py index 32160a25..a07d6f36 100644 --- a/zitadel_client/models/application_service_deactivate_application_request.py +++ b/zitadel_client/models/application_service_deactivate_application_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceDeactivateApplicationRequest(BaseModel): """ ApplicationServiceDeactivateApplicationRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to be deactivated.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - __properties: ClassVar[List[str]] = ["applicationId", "projectId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to be deactivated.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ApplicationServiceDeactivateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeactivateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeactivateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceDeactivateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_deactivate_application_response.py b/zitadel_client/models/application_service_deactivate_application_response.py index 78284ef5..05969319 100644 --- a/zitadel_client/models/application_service_deactivate_application_response.py +++ b/zitadel_client/models/application_service_deactivate_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceDeactivateApplicationResponse(BaseModel): """ ApplicationServiceDeactivateApplicationResponse - """ # noqa: E501 - deactivation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deactivationDate") - __properties: ClassVar[List[str]] = ["deactivationDate"] + """ + deactivation_date: Optional[AwareDatetime] = Field( + default=None, + alias="deactivationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ApplicationServiceDeactivateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeactivateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeactivateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deactivationDate": obj.get("deactivationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceDeactivateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_delete_application_key_request.py b/zitadel_client/models/application_service_delete_application_key_request.py index 59ab316b..d79a068f 100644 --- a/zitadel_client/models/application_service_delete_application_key_request.py +++ b/zitadel_client/models/application_service_delete_application_key_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceDeleteApplicationKeyRequest(BaseModel): """ ApplicationServiceDeleteApplicationKeyRequest - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application key to be deleted.", alias="keyId") - application_id: Optional[StrictStr] = Field(default=None, description="The ID of the application the key belongs to.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - __properties: ClassVar[List[str]] = ["keyId", "applicationId", "projectId"] + """ + + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="The unique ID of the application key to be deleted.", + ) + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The ID of the application the key belongs to.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ApplicationServiceDeleteApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceDeleteApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_delete_application_key_response.py b/zitadel_client/models/application_service_delete_application_key_response.py index 97b582d2..7355ed32 100644 --- a/zitadel_client/models/application_service_delete_application_key_response.py +++ b/zitadel_client/models/application_service_delete_application_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceDeleteApplicationKeyResponse(BaseModel): """ ApplicationServiceDeleteApplicationKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ApplicationServiceDeleteApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceDeleteApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_delete_application_request.py b/zitadel_client/models/application_service_delete_application_request.py index 921ab4c6..bf3ab7e0 100644 --- a/zitadel_client/models/application_service_delete_application_request.py +++ b/zitadel_client/models/application_service_delete_application_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceDeleteApplicationRequest(BaseModel): """ ApplicationServiceDeleteApplicationRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to be deleted.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - __properties: ClassVar[List[str]] = ["applicationId", "projectId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to be deleted.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ApplicationServiceDeleteApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceDeleteApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_delete_application_response.py b/zitadel_client/models/application_service_delete_application_response.py index fd7fd025..12abfbbf 100644 --- a/zitadel_client/models/application_service_delete_application_response.py +++ b/zitadel_client/models/application_service_delete_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceDeleteApplicationResponse(BaseModel): """ ApplicationServiceDeleteApplicationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ApplicationServiceDeleteApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceDeleteApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceDeleteApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_entity_id_filter.py b/zitadel_client/models/application_service_entity_id_filter.py index 93c6a188..5bcea297 100644 --- a/zitadel_client/models/application_service_entity_id_filter.py +++ b/zitadel_client/models/application_service_entity_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceEntityIDFilter(BaseModel): """ ApplicationServiceEntityIDFilter - """ # noqa: E501 - entity_id: Optional[StrictStr] = Field(default=None, description="The entityID to search for. The search is performed as an exact match.", alias="entityId") - __properties: ClassVar[List[str]] = ["entityId"] + """ + entity_id: Optional[StrictStr] = Field( + default=None, + alias="entityId", + description="The entityID to search for. The search is performed as an exact match.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceEntityIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceEntityIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceEntityIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "entityId": obj.get("entityId") - }) - return _obj - - +ApplicationServiceEntityIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_generate_client_secret_request.py b/zitadel_client/models/application_service_generate_client_secret_request.py index ce2164c1..fb6897a3 100644 --- a/zitadel_client/models/application_service_generate_client_secret_request.py +++ b/zitadel_client/models/application_service_generate_client_secret_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceGenerateClientSecretRequest(BaseModel): """ ApplicationServiceGenerateClientSecretRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to generate a new client secret for.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - __properties: ClassVar[List[str]] = ["applicationId", "projectId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to generate a new client secret for.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ApplicationServiceGenerateClientSecretRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGenerateClientSecretRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGenerateClientSecretRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceGenerateClientSecretRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_generate_client_secret_response.py b/zitadel_client/models/application_service_generate_client_secret_response.py index 662113c4..ec07bb6d 100644 --- a/zitadel_client/models/application_service_generate_client_secret_response.py +++ b/zitadel_client/models/application_service_generate_client_secret_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceGenerateClientSecretResponse(BaseModel): """ ApplicationServiceGenerateClientSecretResponse - """ # noqa: E501 - client_secret: Optional[StrictStr] = Field(default=None, description="The newly generated client secret. It must be stored safely, as it will not be possible to retrieve it again. A new client secret can be generated using this endpoint.", alias="clientSecret") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["clientSecret", "creationDate"] + """ + + client_secret: Optional[StrictStr] = Field( + default=None, + alias="clientSecret", + description="The newly generated client secret. It must be stored safely, as it will not be possible to retrieve it again. A new client secret can be generated using this endpoint.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class ApplicationServiceGenerateClientSecretResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGenerateClientSecretResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGenerateClientSecretResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientSecret": obj.get("clientSecret"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceGenerateClientSecretResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_get_application_key_request.py b/zitadel_client/models/application_service_get_application_key_request.py index 004e2bcd..658bb151 100644 --- a/zitadel_client/models/application_service_get_application_key_request.py +++ b/zitadel_client/models/application_service_get_application_key_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceGetApplicationKeyRequest(BaseModel): """ ApplicationServiceGetApplicationKeyRequest - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application key to be retrieved.", alias="keyId") - __properties: ClassVar[List[str]] = ["keyId"] + """ + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="The unique ID of the application key to be retrieved.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceGetApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId") - }) - return _obj - - +ApplicationServiceGetApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_get_application_key_response.py b/zitadel_client/models/application_service_get_application_key_response.py index 00dad45a..bceadd12 100644 --- a/zitadel_client/models/application_service_get_application_key_response.py +++ b/zitadel_client/models/application_service_get_application_key_response.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceGetApplicationKeyResponse(BaseModel): """ ApplicationServiceGetApplicationKeyResponse - """ # noqa: E501 - key_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the application key.", alias="keyId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["keyId", "creationDate", "expirationDate"] + """ + + key_id: Optional[StrictStr] = Field( + default=None, alias="keyId", description="Unique ID of the application key." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,6 @@ class ApplicationServiceGetApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyId": obj.get("keyId"), - "creationDate": obj.get("creationDate"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceGetApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_get_application_request.py b/zitadel_client/models/application_service_get_application_request.py index 1b8040cc..f1bc3064 100644 --- a/zitadel_client/models/application_service_get_application_request.py +++ b/zitadel_client/models/application_service_get_application_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceGetApplicationRequest(BaseModel): """ ApplicationServiceGetApplicationRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to be retrieved.", alias="applicationId") - __properties: ClassVar[List[str]] = ["applicationId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to be retrieved.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceGetApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId") - }) - return _obj - - +ApplicationServiceGetApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_get_application_response.py b/zitadel_client/models/application_service_get_application_response.py index 96041793..94eab144 100644 --- a/zitadel_client/models/application_service_get_application_response.py +++ b/zitadel_client/models/application_service_get_application_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_application import ApplicationServiceApplication -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class ApplicationServiceGetApplicationResponse(BaseModel): """ ApplicationServiceGetApplicationResponse - """ # noqa: E501 - application: Optional[ApplicationServiceApplication] = None - __properties: ClassVar[List[str]] = ["application"] + """ + application: Optional[ApplicationServiceApplication] = Field( + default=None, alias="application" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class ApplicationServiceGetApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of application - if self.application: - _dict['application'] = self.application.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceGetApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "application": ApplicationServiceApplication.from_dict(obj["application"]) if obj.get("application") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application import ( + ApplicationServiceApplication, +) +ApplicationServiceGetApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_list_application_keys_request.py b/zitadel_client/models/application_service_list_application_keys_request.py index 6ccebe7f..f279a026 100644 --- a/zitadel_client/models/application_service_list_application_keys_request.py +++ b/zitadel_client/models/application_service_list_application_keys_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_application_key_search_filter import ApplicationServiceApplicationKeySearchFilter -from zitadel_client.models.application_service_application_keys_sorting import ApplicationServiceApplicationKeysSorting -from zitadel_client.models.application_service_pagination_request import ApplicationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ApplicationServiceListApplicationKeysRequest(BaseModel): """ ApplicationServiceListApplicationKeysRequest - """ # noqa: E501 - pagination: Optional[ApplicationServicePaginationRequest] = None - sorting_column: Optional[ApplicationServiceApplicationKeysSorting] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ApplicationServiceApplicationKeySearchFilter]] = Field(default=None, description="Criteria to filter the application keys. All provided filters are combined with a logical AND.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ApplicationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ApplicationServiceApplicationKeysSorting] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ApplicationServiceApplicationKeySearchFilter]] = Field( + default=None, + alias="filters", + description="Criteria to filter the application keys. All provided filters are combined with a logical AND.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class ApplicationServiceListApplicationKeysRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationKeysRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationKeysRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ApplicationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ApplicationServiceApplicationKeySearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application_key_search_filter import ( + ApplicationServiceApplicationKeySearchFilter, +) +from zitadel_client.models.application_service_application_keys_sorting import ( + ApplicationServiceApplicationKeysSorting, +) +from zitadel_client.models.application_service_pagination_request import ( + ApplicationServicePaginationRequest, +) +ApplicationServiceListApplicationKeysRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_list_application_keys_response.py b/zitadel_client/models/application_service_list_application_keys_response.py index e508022f..ac6e4a53 100644 --- a/zitadel_client/models/application_service_list_application_keys_response.py +++ b/zitadel_client/models/application_service_list_application_keys_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_application_key import ApplicationServiceApplicationKey -from zitadel_client.models.application_service_pagination_response import ApplicationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ApplicationServiceListApplicationKeysResponse(BaseModel): """ ApplicationServiceListApplicationKeysResponse - """ # noqa: E501 - keys: Optional[List[ApplicationServiceApplicationKey]] = Field(default=None, description="The list of application keys matching the query. Depending on the applied limit, there might be more keys available than returned in this list. Use the returned pagination information to request further keys.") - pagination: Optional[ApplicationServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["keys", "pagination"] + """ + + keys: Optional[List[ApplicationServiceApplicationKey]] = Field( + default=None, + alias="keys", + description="The list of application keys matching the query. Depending on the applied limit, there might be more keys available than returned in this list. Use the returned pagination information to request further keys.", + ) + pagination: Optional[ApplicationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class ApplicationServiceListApplicationKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in keys (list) - _items = [] - if self.keys: - for _item_keys in self.keys: - if _item_keys: - _items.append(_item_keys.to_dict()) - _dict['keys'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keys": [ApplicationServiceApplicationKey.from_dict(_item) for _item in obj["keys"]] if obj.get("keys") is not None else None, - "pagination": ApplicationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application_key import ( + ApplicationServiceApplicationKey, +) +from zitadel_client.models.application_service_pagination_response import ( + ApplicationServicePaginationResponse, +) +ApplicationServiceListApplicationKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_list_applications_request.py b/zitadel_client/models/application_service_list_applications_request.py index 239f8056..93499abc 100644 --- a/zitadel_client/models/application_service_list_applications_request.py +++ b/zitadel_client/models/application_service_list_applications_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_application_search_filter import ApplicationServiceApplicationSearchFilter -from zitadel_client.models.application_service_application_sorting import ApplicationServiceApplicationSorting -from zitadel_client.models.application_service_pagination_request import ApplicationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ApplicationServiceListApplicationsRequest(BaseModel): """ ApplicationServiceListApplicationsRequest - """ # noqa: E501 - pagination: Optional[ApplicationServicePaginationRequest] = None - sorting_column: Optional[ApplicationServiceApplicationSorting] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ApplicationServiceApplicationSearchFilter]] = Field(default=None, description="Criteria to filter the applications. All provided filters are combined with a logical AND.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ApplicationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ApplicationServiceApplicationSorting] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ApplicationServiceApplicationSearchFilter]] = Field( + default=None, + alias="filters", + description="Criteria to filter the applications. All provided filters are combined with a logical AND.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class ApplicationServiceListApplicationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ApplicationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ApplicationServiceApplicationSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application_search_filter import ( + ApplicationServiceApplicationSearchFilter, +) +from zitadel_client.models.application_service_application_sorting import ( + ApplicationServiceApplicationSorting, +) +from zitadel_client.models.application_service_pagination_request import ( + ApplicationServicePaginationRequest, +) +ApplicationServiceListApplicationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_list_applications_response.py b/zitadel_client/models/application_service_list_applications_response.py index 334787d1..477d3287 100644 --- a/zitadel_client/models/application_service_list_applications_response.py +++ b/zitadel_client/models/application_service_list_applications_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_application import ApplicationServiceApplication -from zitadel_client.models.application_service_pagination_response import ApplicationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ApplicationServiceListApplicationsResponse(BaseModel): """ ApplicationServiceListApplicationsResponse - """ # noqa: E501 - applications: Optional[List[ApplicationServiceApplication]] = Field(default=None, description="The list of applications matching the query. Depending on the applied limit, there might be more applications available than included in this list. Use the returned pagination information to request further applications.") - pagination: Optional[ApplicationServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["applications", "pagination"] + """ + + applications: Optional[List[ApplicationServiceApplication]] = Field( + default=None, + alias="applications", + description="The list of applications matching the query. Depending on the applied limit, there might be more applications available than included in this list. Use the returned pagination information to request further applications.", + ) + pagination: Optional[ApplicationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class ApplicationServiceListApplicationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceListApplicationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applications": [ApplicationServiceApplication.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "pagination": ApplicationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_application import ( + ApplicationServiceApplication, +) +from zitadel_client.models.application_service_pagination_response import ( + ApplicationServicePaginationResponse, +) +ApplicationServiceListApplicationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_login_v2.py b/zitadel_client/models/application_service_login_v2.py index ee4c8843..d287d225 100644 --- a/zitadel_client/models/application_service_login_v2.py +++ b/zitadel_client/models/application_service_login_v2.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceLoginV2(BaseModel): """ ApplicationServiceLoginV2 - """ # noqa: E501 - base_uri: Optional[StrictStr] = Field(default=None, description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", alias="baseUri") - __properties: ClassVar[List[str]] = ["baseUri"] + """ + + base_uri: Optional[StrictStr] = Field( + default=None, + alias="baseUri", + description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class ApplicationServiceLoginV2(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceLoginV2 from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if base_uri (nullable) is None - # and model_fields_set contains the field - if self.base_uri is None and "base_uri" in self.model_fields_set: - _dict['baseUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceLoginV2 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "baseUri": obj.get("baseUri") - }) - return _obj - - +ApplicationServiceLoginV2.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_login_version.py b/zitadel_client/models/application_service_login_version.py index 1010d50c..15352ebf 100644 --- a/zitadel_client/models/application_service_login_version.py +++ b/zitadel_client/models/application_service_login_version.py @@ -1,36 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_login_v2 import ApplicationServiceLoginV2 -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceLoginVersion(BaseModel): """ ApplicationServiceLoginVersion - """ # noqa: E501 - login_v1: Optional[Dict[str, Any]] = Field(default=None, alias="loginV1") + """ + + login_v1: Optional[object] = Field(default=None, alias="loginV1") login_v2: Optional[ApplicationServiceLoginV2] = Field(default=None, alias="loginV2") - __properties: ClassVar[List[str]] = ["loginV1", "loginV2"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +30,6 @@ class ApplicationServiceLoginVersion(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceLoginVersion from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceLoginVersion from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginV1": obj.get("loginV1"), - "loginV2": ApplicationServiceLoginV2.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_login_v2 import ApplicationServiceLoginV2 +ApplicationServiceLoginVersion.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_oidc_application_type.py b/zitadel_client/models/application_service_oidc_application_type.py index c36f1f45..d8cdd8af 100644 --- a/zitadel_client/models/application_service_oidc_application_type.py +++ b/zitadel_client/models/application_service_oidc_application_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCApplicationType(str, Enum): @@ -23,16 +13,6 @@ class ApplicationServiceOIDCApplicationType(str, Enum): ApplicationServiceOIDCApplicationType """ - """ - allowed enum values - """ - OIDC_APP_TYPE_WEB = 'OIDC_APP_TYPE_WEB' - OIDC_APP_TYPE_USER_AGENT = 'OIDC_APP_TYPE_USER_AGENT' - OIDC_APP_TYPE_NATIVE = 'OIDC_APP_TYPE_NATIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCApplicationType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_APP_TYPE_WEB = "OIDC_APP_TYPE_WEB" + OIDC_APP_TYPE_USER_AGENT = "OIDC_APP_TYPE_USER_AGENT" + OIDC_APP_TYPE_NATIVE = "OIDC_APP_TYPE_NATIVE" diff --git a/zitadel_client/models/application_service_oidc_auth_method_type.py b/zitadel_client/models/application_service_oidc_auth_method_type.py index 9f3b0364..0b745817 100644 --- a/zitadel_client/models/application_service_oidc_auth_method_type.py +++ b/zitadel_client/models/application_service_oidc_auth_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCAuthMethodType(str, Enum): @@ -23,17 +13,7 @@ class ApplicationServiceOIDCAuthMethodType(str, Enum): ApplicationServiceOIDCAuthMethodType """ - """ - allowed enum values - """ - OIDC_AUTH_METHOD_TYPE_BASIC = 'OIDC_AUTH_METHOD_TYPE_BASIC' - OIDC_AUTH_METHOD_TYPE_POST = 'OIDC_AUTH_METHOD_TYPE_POST' - OIDC_AUTH_METHOD_TYPE_NONE = 'OIDC_AUTH_METHOD_TYPE_NONE' - OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCAuthMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_AUTH_METHOD_TYPE_BASIC = "OIDC_AUTH_METHOD_TYPE_BASIC" + OIDC_AUTH_METHOD_TYPE_POST = "OIDC_AUTH_METHOD_TYPE_POST" + OIDC_AUTH_METHOD_TYPE_NONE = "OIDC_AUTH_METHOD_TYPE_NONE" + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT" diff --git a/zitadel_client/models/application_service_oidc_configuration.py b/zitadel_client/models/application_service_oidc_configuration.py index ca3b217a..5d30eb33 100644 --- a/zitadel_client/models/application_service_oidc_configuration.py +++ b/zitadel_client/models/application_service_oidc_configuration.py @@ -1,62 +1,122 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from zitadel_client.models.application_service_oidc_application_type import ApplicationServiceOIDCApplicationType -from zitadel_client.models.application_service_oidc_auth_method_type import ApplicationServiceOIDCAuthMethodType -from zitadel_client.models.application_service_oidc_grant_type import ApplicationServiceOIDCGrantType -from zitadel_client.models.application_service_oidc_localized_message import ApplicationServiceOIDCLocalizedMessage -from zitadel_client.models.application_service_oidc_response_type import ApplicationServiceOIDCResponseType -from zitadel_client.models.application_service_oidc_token_type import ApplicationServiceOIDCTokenType -from zitadel_client.models.application_service_oidc_version import ApplicationServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class ApplicationServiceOIDCConfiguration(BaseModel): """ ApplicationServiceOIDCConfiguration - """ # noqa: E501 - redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs.", alias="redirectUris") - response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field(default=None, description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values.", alias="responseTypes") - grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field(default=None, description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values.", alias="grantTypes") - application_type: Optional[ApplicationServiceOIDCApplicationType] = Field(default=None, alias="applicationType") - client_id: Optional[StrictStr] = Field(default=None, description="The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint.", alias="clientId") - auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs.", alias="postLogoutRedirectUris") - version: Optional[ApplicationServiceOIDCVersion] = None - non_compliant: Optional[StrictBool] = Field(default=None, description="NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field.", alias="nonCompliant") - compliance_problems: Optional[List[ApplicationServiceOIDCLocalizedMessage]] = Field(default=None, description="ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty.", alias="complianceProblems") - development_mode: Optional[StrictBool] = Field(default=None, description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs.", alias="developmentMode") - access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project.", alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project.", alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable.", alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin.", alias="additionalOrigins") - allowed_origins: Optional[List[StrictStr]] = Field(default=None, description="AllowedOrigins are all HTTP origins where the application is allowed to be used from. This is used to prevent CORS issues in browsers. If the origin of the request is not in this list, the request will be rejected. This is especially important for SPAs. Note that this is a generated list from the redirect_uris and additional_origins. If you use the application from another origin, you have to add it to the additional_origins.", alias="allowedOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly.", alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html).", alias="backChannelLogoutUri") - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "applicationType", "clientId", "authMethodType", "postLogoutRedirectUris", "version", "nonCompliant", "complianceProblems", "developmentMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "allowedOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + """ + + redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="redirectUris", + description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs.", + ) + response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field( + default=None, + alias="responseTypes", + description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values.", + ) + grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field( + default=None, + alias="grantTypes", + description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values.", + ) + application_type: Optional[ApplicationServiceOIDCApplicationType] = Field( + default=None, alias="applicationType" + ) + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The unique OAuth2/OIDC client_id used for authentication of the application, e.g. at the token endpoint.", + ) + auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="postLogoutRedirectUris", + description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs.", + ) + version: Optional[ApplicationServiceOIDCVersion] = Field( + default=None, alias="version" + ) + non_compliant: Optional[StrictBool] = Field( + default=None, + alias="nonCompliant", + description="NonCompliant specifies whether the config is OIDC compliant. A production configuration SHOULD be compliant. Non-compliant configurations can run into interoperability issues with OIDC libraries and tools. Compliance problems are listed in the compliance_problems field.", + ) + compliance_problems: Optional[List[ApplicationServiceOIDCLocalizedMessage]] = Field( + default=None, + alias="complianceProblems", + description="ComplianceProblems lists the problems for non-compliant configurations. In case of a compliant configuration, this list is empty.", + ) + development_mode: Optional[StrictBool] = Field( + default=None, + alias="developmentMode", + description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs.", + ) + access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="accessTokenRoleAssertion", + description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project.", + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenRoleAssertion", + description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project.", + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenUserinfoAssertion", + description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable.", + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, + alias="additionalOrigins", + description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin.", + ) + allowed_origins: Optional[List[StrictStr]] = Field( + default=None, + alias="allowedOrigins", + description="AllowedOrigins are all HTTP origins where the application is allowed to be used from. This is used to prevent CORS issues in browsers. If the origin of the request is not in this list, the request will be rejected. This is especially important for SPAs. Note that this is a generated list from the redirect_uris and additional_origins. If you use the application from another origin, you have to add it to the additional_origins.", + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, + alias="skipNativeAppSuccessPage", + description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly.", + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, + alias="backChannelLogoutUri", + description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html).", + ) + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -64,82 +124,30 @@ class ApplicationServiceOIDCConfiguration(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceOIDCConfiguration from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in compliance_problems (list) - _items = [] - if self.compliance_problems: - for _item_compliance_problems in self.compliance_problems: - if _item_compliance_problems: - _items.append(_item_compliance_problems.to_dict()) - _dict['complianceProblems'] = _items - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceOIDCConfiguration from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "applicationType": obj.get("applicationType"), - "clientId": obj.get("clientId"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "nonCompliant": obj.get("nonCompliant"), - "complianceProblems": [ApplicationServiceOIDCLocalizedMessage.from_dict(_item) for _item in obj["complianceProblems"]] if obj.get("complianceProblems") is not None else None, - "developmentMode": obj.get("developmentMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "allowedOrigins": obj.get("allowedOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +from zitadel_client.models.application_service_oidc_application_type import ( + ApplicationServiceOIDCApplicationType, +) +from zitadel_client.models.application_service_oidc_auth_method_type import ( + ApplicationServiceOIDCAuthMethodType, +) +from zitadel_client.models.application_service_oidc_grant_type import ( + ApplicationServiceOIDCGrantType, +) +from zitadel_client.models.application_service_oidc_localized_message import ( + ApplicationServiceOIDCLocalizedMessage, +) +from zitadel_client.models.application_service_oidc_response_type import ( + ApplicationServiceOIDCResponseType, +) +from zitadel_client.models.application_service_oidc_token_type import ( + ApplicationServiceOIDCTokenType, +) +from zitadel_client.models.application_service_oidc_version import ( + ApplicationServiceOIDCVersion, +) + +ApplicationServiceOIDCConfiguration.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_oidc_grant_type.py b/zitadel_client/models/application_service_oidc_grant_type.py index c573f06d..9d5b3be7 100644 --- a/zitadel_client/models/application_service_oidc_grant_type.py +++ b/zitadel_client/models/application_service_oidc_grant_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCGrantType(str, Enum): @@ -23,18 +13,8 @@ class ApplicationServiceOIDCGrantType(str, Enum): ApplicationServiceOIDCGrantType """ - """ - allowed enum values - """ - OIDC_GRANT_TYPE_AUTHORIZATION_CODE = 'OIDC_GRANT_TYPE_AUTHORIZATION_CODE' - OIDC_GRANT_TYPE_IMPLICIT = 'OIDC_GRANT_TYPE_IMPLICIT' - OIDC_GRANT_TYPE_REFRESH_TOKEN = 'OIDC_GRANT_TYPE_REFRESH_TOKEN' - OIDC_GRANT_TYPE_DEVICE_CODE = 'OIDC_GRANT_TYPE_DEVICE_CODE' - OIDC_GRANT_TYPE_TOKEN_EXCHANGE = 'OIDC_GRANT_TYPE_TOKEN_EXCHANGE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCGrantType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_GRANT_TYPE_AUTHORIZATION_CODE = "OIDC_GRANT_TYPE_AUTHORIZATION_CODE" + OIDC_GRANT_TYPE_IMPLICIT = "OIDC_GRANT_TYPE_IMPLICIT" + OIDC_GRANT_TYPE_REFRESH_TOKEN = "OIDC_GRANT_TYPE_REFRESH_TOKEN" + OIDC_GRANT_TYPE_DEVICE_CODE = "OIDC_GRANT_TYPE_DEVICE_CODE" + OIDC_GRANT_TYPE_TOKEN_EXCHANGE = "OIDC_GRANT_TYPE_TOKEN_EXCHANGE" diff --git a/zitadel_client/models/application_service_oidc_localized_message.py b/zitadel_client/models/application_service_oidc_localized_message.py index f72457ee..df7933d5 100644 --- a/zitadel_client/models/application_service_oidc_localized_message.py +++ b/zitadel_client/models/application_service_oidc_localized_message.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceOIDCLocalizedMessage(BaseModel): """ ApplicationServiceOIDCLocalizedMessage - """ # noqa: E501 - key: Optional[StrictStr] = None - localized_message: Optional[StrictStr] = Field(default=None, alias="localizedMessage") - __properties: ClassVar[List[str]] = ["key", "localizedMessage"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + localized_message: Optional[StrictStr] = Field( + default=None, alias="localizedMessage" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class ApplicationServiceOIDCLocalizedMessage(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceOIDCLocalizedMessage from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceOIDCLocalizedMessage from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "localizedMessage": obj.get("localizedMessage") - }) - return _obj - - +ApplicationServiceOIDCLocalizedMessage.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_oidc_response_type.py b/zitadel_client/models/application_service_oidc_response_type.py index 25a54bec..d843a4e8 100644 --- a/zitadel_client/models/application_service_oidc_response_type.py +++ b/zitadel_client/models/application_service_oidc_response_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCResponseType(str, Enum): @@ -23,17 +13,7 @@ class ApplicationServiceOIDCResponseType(str, Enum): ApplicationServiceOIDCResponseType """ - """ - allowed enum values - """ - OIDC_RESPONSE_TYPE_UNSPECIFIED = 'OIDC_RESPONSE_TYPE_UNSPECIFIED' - OIDC_RESPONSE_TYPE_CODE = 'OIDC_RESPONSE_TYPE_CODE' - OIDC_RESPONSE_TYPE_ID_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN' - OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCResponseType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_RESPONSE_TYPE_UNSPECIFIED = "OIDC_RESPONSE_TYPE_UNSPECIFIED" + OIDC_RESPONSE_TYPE_CODE = "OIDC_RESPONSE_TYPE_CODE" + OIDC_RESPONSE_TYPE_ID_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN" + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN" diff --git a/zitadel_client/models/application_service_oidc_token_type.py b/zitadel_client/models/application_service_oidc_token_type.py index b24d36f1..a3592803 100644 --- a/zitadel_client/models/application_service_oidc_token_type.py +++ b/zitadel_client/models/application_service_oidc_token_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCTokenType(str, Enum): @@ -23,15 +13,5 @@ class ApplicationServiceOIDCTokenType(str, Enum): ApplicationServiceOIDCTokenType """ - """ - allowed enum values - """ - OIDC_TOKEN_TYPE_BEARER = 'OIDC_TOKEN_TYPE_BEARER' - OIDC_TOKEN_TYPE_JWT = 'OIDC_TOKEN_TYPE_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCTokenType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_TOKEN_TYPE_BEARER = "OIDC_TOKEN_TYPE_BEARER" + OIDC_TOKEN_TYPE_JWT = "OIDC_TOKEN_TYPE_JWT" diff --git a/zitadel_client/models/application_service_oidc_version.py b/zitadel_client/models/application_service_oidc_version.py index e4d03b51..6eb4cb80 100644 --- a/zitadel_client/models/application_service_oidc_version.py +++ b/zitadel_client/models/application_service_oidc_version.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceOIDCVersion(str, Enum): @@ -23,14 +13,4 @@ class ApplicationServiceOIDCVersion(str, Enum): ApplicationServiceOIDCVersion """ - """ - allowed enum values - """ - OIDC_VERSION_1_0 = 'OIDC_VERSION_1_0' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceOIDCVersion from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_VERSION_1_0 = "OIDC_VERSION_1_0" diff --git a/zitadel_client/models/application_service_pagination_request.py b/zitadel_client/models/application_service_pagination_request.py index 051cc4f2..a5b44516 100644 --- a/zitadel_client/models/application_service_pagination_request.py +++ b/zitadel_client/models/application_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class ApplicationServicePaginationRequest(BaseModel): """ ApplicationServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class ApplicationServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +ApplicationServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_pagination_response.py b/zitadel_client/models/application_service_pagination_response.py index 2e8d8a56..0d123686 100644 --- a/zitadel_client/models/application_service_pagination_response.py +++ b/zitadel_client/models/application_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServicePaginationResponse(BaseModel): """ ApplicationServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class ApplicationServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +ApplicationServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_project_id_filter.py b/zitadel_client/models/application_service_project_id_filter.py index 312bca08..9ca6b11c 100644 --- a/zitadel_client/models/application_service_project_id_filter.py +++ b/zitadel_client/models/application_service_project_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceProjectIDFilter(BaseModel): """ ApplicationServiceProjectIDFilter - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="Search for application belonging to the project with this ID.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Search for application belonging to the project with this ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ApplicationServiceProjectIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceProjectIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceProjectIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceProjectIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_reactivate_application_request.py b/zitadel_client/models/application_service_reactivate_application_request.py index 7abf2231..deb524b2 100644 --- a/zitadel_client/models/application_service_reactivate_application_request.py +++ b/zitadel_client/models/application_service_reactivate_application_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceReactivateApplicationRequest(BaseModel): """ ApplicationServiceReactivateApplicationRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to be reactivated.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - __properties: ClassVar[List[str]] = ["applicationId", "projectId"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to be reactivated.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ApplicationServiceReactivateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceReactivateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceReactivateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId") - }) - return _obj - - +ApplicationServiceReactivateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_reactivate_application_response.py b/zitadel_client/models/application_service_reactivate_application_response.py index 2db3d53f..9bba0d87 100644 --- a/zitadel_client/models/application_service_reactivate_application_response.py +++ b/zitadel_client/models/application_service_reactivate_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceReactivateApplicationResponse(BaseModel): """ ApplicationServiceReactivateApplicationResponse - """ # noqa: E501 - reactivation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="reactivationDate") - __properties: ClassVar[List[str]] = ["reactivationDate"] + """ + reactivation_date: Optional[AwareDatetime] = Field( + default=None, + alias="reactivationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ApplicationServiceReactivateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceReactivateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceReactivateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "reactivationDate": obj.get("reactivationDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceReactivateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_saml_configuration.py b/zitadel_client/models/application_service_saml_configuration.py index 4548a849..69512b0e 100644 --- a/zitadel_client/models/application_service_saml_configuration.py +++ b/zitadel_client/models/application_service_saml_configuration.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceSAMLConfiguration(BaseModel): """ ApplicationServiceSAMLConfiguration - """ # noqa: E501 - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The Metadata XML is the provided or fetched metadata stored at Zitadel. If either the metadata was provided as XML or when Zitadel fetched it at the provided URL, it is stored here.", alias="metadataXml") - metadata_url: Optional[StrictStr] = Field(default=None, description="The Metadata URL is the URL where the metadata was fetched from. In case the metadata was provided as raw XML, this field is empty.", alias="metadataUrl") - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["metadataXml", "metadataUrl", "loginVersion"] + """ + + metadata_xml: Optional[Base64Bytes] = Field( + default=None, + alias="metadataXml", + description="The Metadata XML is the provided or fetched metadata stored at Zitadel. If either the metadata was provided as XML or when Zitadel fetched it at the provided URL, it is stored here.", + ) + metadata_url: Optional[StrictStr] = Field( + default=None, + alias="metadataUrl", + description="The Metadata URL is the URL where the metadata was fetched from. In case the metadata was provided as raw XML, this field is empty.", + ) + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,9 @@ class ApplicationServiceSAMLConfiguration(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceSAMLConfiguration from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceSAMLConfiguration from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "metadataXml": obj.get("metadataXml"), - "metadataUrl": obj.get("metadataUrl"), - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +ApplicationServiceSAMLConfiguration.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_text_filter_method.py b/zitadel_client/models/application_service_text_filter_method.py index bf1bb7eb..c373f44a 100644 --- a/zitadel_client/models/application_service_text_filter_method.py +++ b/zitadel_client/models/application_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ApplicationServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class ApplicationServiceTextFilterMethod(str, Enum): ApplicationServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ApplicationServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/application_service_update_api_application_configuration_request.py b/zitadel_client/models/application_service_update_api_application_configuration_request.py index 3c307a2d..57de25d7 100644 --- a/zitadel_client/models/application_service_update_api_application_configuration_request.py +++ b/zitadel_client/models/application_service_update_api_application_configuration_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_api_auth_method_type import ApplicationServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceUpdateAPIApplicationConfigurationRequest(BaseModel): """ ApplicationServiceUpdateAPIApplicationConfigurationRequest - """ # noqa: E501 - auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["authMethodType"] + """ + auth_method_type: Optional[ApplicationServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,10 @@ class ApplicationServiceUpdateAPIApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateAPIApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateAPIApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.application_service_api_auth_method_type import ( + ApplicationServiceAPIAuthMethodType, +) +ApplicationServiceUpdateAPIApplicationConfigurationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/application_service_update_application_request.py b/zitadel_client/models/application_service_update_application_request.py index c41ca371..38164e5e 100644 --- a/zitadel_client/models/application_service_update_application_request.py +++ b/zitadel_client/models/application_service_update_application_request.py @@ -1,42 +1,51 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.application_service_update_api_application_configuration_request import ApplicationServiceUpdateAPIApplicationConfigurationRequest -from zitadel_client.models.application_service_update_oidc_application_configuration_request import ApplicationServiceUpdateOIDCApplicationConfigurationRequest -from zitadel_client.models.application_service_update_saml_application_configuration_request import ApplicationServiceUpdateSAMLApplicationConfigurationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceUpdateApplicationRequest(BaseModel): """ ApplicationServiceUpdateApplicationRequest - """ # noqa: E501 - application_id: Optional[StrictStr] = Field(default=None, description="The unique ID of the application to be updated.", alias="applicationId") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the project the application belongs to.", alias="projectId") - name: Optional[StrictStr] = Field(default=None, description="Publicly visible name of the application. This might be presented to users if they sign in. If not set, the name will not be changed.") - api_configuration: Optional[ApplicationServiceUpdateAPIApplicationConfigurationRequest] = Field(default=None, alias="apiConfiguration") - oidc_configuration: Optional[ApplicationServiceUpdateOIDCApplicationConfigurationRequest] = Field(default=None, alias="oidcConfiguration") - saml_configuration: Optional[ApplicationServiceUpdateSAMLApplicationConfigurationRequest] = Field(default=None, alias="samlConfiguration") - __properties: ClassVar[List[str]] = ["applicationId", "projectId", "name", "apiConfiguration", "oidcConfiguration", "samlConfiguration"] + """ + application_id: Optional[StrictStr] = Field( + default=None, + alias="applicationId", + description="The unique ID of the application to be updated.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="The ID of the project the application belongs to.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Publicly visible name of the application. This might be presented to users if they sign in. If not set, the name will not be changed.", + ) + api_configuration: Optional[ + ApplicationServiceUpdateAPIApplicationConfigurationRequest + ] = Field(default=None, alias="apiConfiguration") + oidc_configuration: Optional[ + ApplicationServiceUpdateOIDCApplicationConfigurationRequest + ] = Field(default=None, alias="oidcConfiguration") + saml_configuration: Optional[ + ApplicationServiceUpdateSAMLApplicationConfigurationRequest + ] = Field(default=None, alias="samlConfiguration") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,66 +53,14 @@ class ApplicationServiceUpdateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_configuration - if self.api_configuration: - _dict['apiConfiguration'] = self.api_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_configuration - if self.oidc_configuration: - _dict['oidcConfiguration'] = self.oidc_configuration.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_configuration - if self.saml_configuration: - _dict['samlConfiguration'] = self.saml_configuration.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId"), - "name": obj.get("name"), - "apiConfiguration": ApplicationServiceUpdateAPIApplicationConfigurationRequest.from_dict(obj["apiConfiguration"]) if obj.get("apiConfiguration") is not None else None, - "oidcConfiguration": ApplicationServiceUpdateOIDCApplicationConfigurationRequest.from_dict(obj["oidcConfiguration"]) if obj.get("oidcConfiguration") is not None else None, - "samlConfiguration": ApplicationServiceUpdateSAMLApplicationConfigurationRequest.from_dict(obj["samlConfiguration"]) if obj.get("samlConfiguration") is not None else None - }) - return _obj - +from zitadel_client.models.application_service_update_api_application_configuration_request import ( + ApplicationServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_oidc_application_configuration_request import ( + ApplicationServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.application_service_update_saml_application_configuration_request import ( + ApplicationServiceUpdateSAMLApplicationConfigurationRequest, +) +ApplicationServiceUpdateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_update_application_response.py b/zitadel_client/models/application_service_update_application_response.py index 8cb737f5..95f437c4 100644 --- a/zitadel_client/models/application_service_update_application_response.py +++ b/zitadel_client/models/application_service_update_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ApplicationServiceUpdateApplicationResponse(BaseModel): """ ApplicationServiceUpdateApplicationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ApplicationServiceUpdateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ApplicationServiceUpdateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/application_service_update_oidc_application_configuration_request.py b/zitadel_client/models/application_service_update_oidc_application_configuration_request.py index 8376d46e..decb5fa2 100644 --- a/zitadel_client/models/application_service_update_oidc_application_configuration_request.py +++ b/zitadel_client/models/application_service_update_oidc_application_configuration_request.py @@ -1,57 +1,102 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from zitadel_client.models.application_service_oidc_application_type import ApplicationServiceOIDCApplicationType -from zitadel_client.models.application_service_oidc_auth_method_type import ApplicationServiceOIDCAuthMethodType -from zitadel_client.models.application_service_oidc_grant_type import ApplicationServiceOIDCGrantType -from zitadel_client.models.application_service_oidc_response_type import ApplicationServiceOIDCResponseType -from zitadel_client.models.application_service_oidc_token_type import ApplicationServiceOIDCTokenType -from zitadel_client.models.application_service_oidc_version import ApplicationServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class ApplicationServiceUpdateOIDCApplicationConfigurationRequest(BaseModel): """ ApplicationServiceUpdateOIDCApplicationConfigurationRequest - """ # noqa: E501 - redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. Any existing redirect URIs not included in this list will be removed. If not set, the redirect URIs will not be changed.", alias="redirectUris") - response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field(default=None, description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. Any existing response types not included in this list will be removed. If not set, the response types will not be changed.", alias="responseTypes") - grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field(default=None, description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. Any existing grant types not included in this list will be removed. If not set, the grant types will not be changed.", alias="grantTypes") - application_type: Optional[ApplicationServiceOIDCApplicationType] = Field(default=None, alias="applicationType") - auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. Any existing post logout redirect URIs not included in this list will be removed. If not set, the post logout redirect URIs will not be changed.", alias="postLogoutRedirectUris") - version: Optional[ApplicationServiceOIDCVersion] = None - development_mode: Optional[StrictBool] = Field(default=None, description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. If not set, the dev mode will not be changed.", alias="developmentMode") - access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. If not set, the access token role assertion will not be changed.", alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. If not set, the id token role assertion will not be changed.", alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. If not set, the id token userinfo assertion will not be changed.", alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. Any existing additional origins not included in this list will be removed. If not set, the additional origins will not be changed.", alias="additionalOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. If not set, the skip native app success page will not be changed.", alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). If not set, the back channel logout URI will not be changed.", alias="backChannelLogoutUri") - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "applicationType", "authMethodType", "postLogoutRedirectUris", "version", "developmentMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + """ + + redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="redirectUris", + description="RedirectURIs are the allowed callback URIs for the OAuth2 / OIDC flows, where the authorization code or tokens will be sent to. The redirect_uri parameter in the authorization request must exactly match one of these URIs. Any existing redirect URIs not included in this list will be removed. If not set, the redirect URIs will not be changed.", + ) + response_types: Optional[List[ApplicationServiceOIDCResponseType]] = Field( + default=None, + alias="responseTypes", + description="ResponseTypes define whether a code, id_token token or just id_token will be returned. The response_type parameter in the authorization request must exactly match one of these values. Any existing response types not included in this list will be removed. If not set, the response types will not be changed.", + ) + grant_types: Optional[List[ApplicationServiceOIDCGrantType]] = Field( + default=None, + alias="grantTypes", + description="GrantTypes define the flow type the application is allowed to use. The grant_type parameter in the token request must exactly match one of these values. Minimum one grant type must be provided, but multiple grant types can be provided to allow different flows, e.g. authorization code flow and refresh token flow. Any existing grant types not included in this list will be removed. If not set, the grant types will not be changed.", + ) + application_type: Optional[ApplicationServiceOIDCApplicationType] = Field( + default=None, alias="applicationType" + ) + auth_method_type: Optional[ApplicationServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="postLogoutRedirectUris", + description="PostLogoutRedirectURIs are the allowed URIs to redirect to after a logout. The post_logout_redirect_uri parameter in the logout request must exactly match one of these URIs. Any existing post logout redirect URIs not included in this list will be removed. If not set, the post logout redirect URIs will not be changed.", + ) + version: Optional[ApplicationServiceOIDCVersion] = Field( + default=None, alias="version" + ) + development_mode: Optional[StrictBool] = Field( + default=None, + alias="developmentMode", + description="DevelopmentMode can be enabled for development purposes. This allows the use of OIDC non-compliant and potentially insecure settings, such as the use of HTTP redirect URIs or wildcard redirect URIs. If not set, the dev mode will not be changed.", + ) + access_token_type: Optional[ApplicationServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="accessTokenRoleAssertion", + description="If AccessTokenRoleAssertion is enabled, the roles of the user are added to the access token. Ensure that the access token is a JWT token and not a bearer token. And either request the roles by scope or enable the user role assertion on the project. If not set, the access token role assertion will not be changed.", + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenRoleAssertion", + description="If IDTokenRoleAssertion is enabled, the roles of the user are added to the id token. Ensure that either the roles are requested by scope or enable the user role assertion on the project. If not set, the id token role assertion will not be changed.", + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, + alias="idTokenUserinfoAssertion", + description="If IDTokenUserinfoAssertion is enabled, the claims of profile, email, address and phone scopes are added to the id token even if an access token is issued. This can be required by some applications that do not call the userinfo endpoint after authentication or directly use the id_token for retrieving user information. Attention: this violates the OIDC specification, which states that these claims must only be requested from the userinfo endpoint if an access token is issued. This is to prevent leaking of personal information in the id token, which is often stored in the browser and therefore more vulnerable. If not set, the id token userinfo assertion will not be changed.", + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, + alias="additionalOrigins", + description="AdditionalOrigins are HTTP origins (scheme + host + port) from where the API can be used additional to the redirect_uris. This is useful if the application is used from an origin different to the redirect_uris, e.g. if the application is a SPA served in a native app, where the redirect_uri is a custom scheme, but the application is served from a https origin. Any existing additional origins not included in this list will be removed. If not set, the additional origins will not be changed.", + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, + alias="skipNativeAppSuccessPage", + description="For native apps a successful login usually shows a success page with a link to open the application again. SkipNativeAppSuccessPage can be used to skip this page and open the application directly. If not set, the skip native app success page will not be changed.", + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, + alias="backChannelLogoutUri", + description="BackChannelLogoutURI is used to notify the application about terminated sessions according to the OIDC Back-Channel Logout (https://openid.net/specs/openid-connect-backchannel-1_0.html). If not set, the back channel logout URI will not be changed.", + ) + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -59,101 +104,29 @@ class ApplicationServiceUpdateOIDCApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateOIDCApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - # set to None if development_mode (nullable) is None - # and model_fields_set contains the field - if self.development_mode is None and "development_mode" in self.model_fields_set: - _dict['developmentMode'] = None - - # set to None if access_token_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.access_token_role_assertion is None and "access_token_role_assertion" in self.model_fields_set: - _dict['accessTokenRoleAssertion'] = None - - # set to None if id_token_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.id_token_role_assertion is None and "id_token_role_assertion" in self.model_fields_set: - _dict['idTokenRoleAssertion'] = None - - # set to None if id_token_userinfo_assertion (nullable) is None - # and model_fields_set contains the field - if self.id_token_userinfo_assertion is None and "id_token_userinfo_assertion" in self.model_fields_set: - _dict['idTokenUserinfoAssertion'] = None - - # set to None if skip_native_app_success_page (nullable) is None - # and model_fields_set contains the field - if self.skip_native_app_success_page is None and "skip_native_app_success_page" in self.model_fields_set: - _dict['skipNativeAppSuccessPage'] = None - - # set to None if back_channel_logout_uri (nullable) is None - # and model_fields_set contains the field - if self.back_channel_logout_uri is None and "back_channel_logout_uri" in self.model_fields_set: - _dict['backChannelLogoutUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateOIDCApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "applicationType": obj.get("applicationType"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "developmentMode": obj.get("developmentMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +from zitadel_client.models.application_service_oidc_application_type import ( + ApplicationServiceOIDCApplicationType, +) +from zitadel_client.models.application_service_oidc_auth_method_type import ( + ApplicationServiceOIDCAuthMethodType, +) +from zitadel_client.models.application_service_oidc_grant_type import ( + ApplicationServiceOIDCGrantType, +) +from zitadel_client.models.application_service_oidc_response_type import ( + ApplicationServiceOIDCResponseType, +) +from zitadel_client.models.application_service_oidc_token_type import ( + ApplicationServiceOIDCTokenType, +) +from zitadel_client.models.application_service_oidc_version import ( + ApplicationServiceOIDCVersion, +) + +ApplicationServiceUpdateOIDCApplicationConfigurationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/application_service_update_saml_application_configuration_request.py b/zitadel_client/models/application_service_update_saml_application_configuration_request.py index 97084a7d..77e0af85 100644 --- a/zitadel_client/models/application_service_update_saml_application_configuration_request.py +++ b/zitadel_client/models/application_service_update_saml_application_configuration_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.application_service_login_version import ApplicationServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ApplicationServiceUpdateSAMLApplicationConfigurationRequest(BaseModel): """ ApplicationServiceUpdateSAMLApplicationConfigurationRequest - """ # noqa: E501 - login_version: Optional[ApplicationServiceLoginVersion] = Field(default=None, alias="loginVersion") + """ + + login_version: Optional[ApplicationServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) metadata_url: Optional[StrictStr] = Field(default=None, alias="metadataUrl") - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="metadataXml") - __properties: ClassVar[List[str]] = ["loginVersion", "metadataUrl", "metadataXml"] + metadata_xml: Optional[Base64Bytes] = Field(default=None, alias="metadataXml") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,11 @@ class ApplicationServiceUpdateSAMLApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateSAMLApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ApplicationServiceUpdateSAMLApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginVersion": ApplicationServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None, - "metadataUrl": obj.get("metadataUrl"), - "metadataXml": obj.get("metadataXml") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.application_service_login_version import ( + ApplicationServiceLoginVersion, +) +ApplicationServiceUpdateSAMLApplicationConfigurationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/authorization_service_activate_authorization_request.py b/zitadel_client/models/authorization_service_activate_authorization_request.py index b9550e6e..7cf5131a 100644 --- a/zitadel_client/models/authorization_service_activate_authorization_request.py +++ b/zitadel_client/models/authorization_service_activate_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceActivateAuthorizationRequest(BaseModel): """ AuthorizationServiceActivateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be activated.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be activated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class AuthorizationServiceActivateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceActivateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceActivateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +AuthorizationServiceActivateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_activate_authorization_response.py b/zitadel_client/models/authorization_service_activate_authorization_response.py index 557b79bb..43405349 100644 --- a/zitadel_client/models/authorization_service_activate_authorization_response.py +++ b/zitadel_client/models/authorization_service_activate_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServiceActivateAuthorizationResponse(BaseModel): """ AuthorizationServiceActivateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class AuthorizationServiceActivateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceActivateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceActivateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +AuthorizationServiceActivateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_any.py b/zitadel_client/models/authorization_service_any.py index 7c5062e3..1b7f5475 100644 --- a/zitadel_client/models/authorization_service_any.py +++ b/zitadel_client/models/authorization_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class AuthorizationServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +AuthorizationServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_authorization.py b/zitadel_client/models/authorization_service_authorization.py index 510c2c5f..b5067207 100644 --- a/zitadel_client/models/authorization_service_authorization.py +++ b/zitadel_client/models/authorization_service_authorization.py @@ -1,47 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.authorization_service_organization import AuthorizationServiceOrganization -from zitadel_client.models.authorization_service_project import AuthorizationServiceProject -from zitadel_client.models.authorization_service_role import AuthorizationServiceRole -from zitadel_client.models.authorization_service_state import AuthorizationServiceState -from zitadel_client.models.authorization_service_user import AuthorizationServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class AuthorizationServiceAuthorization(BaseModel): """ AuthorizationServiceAuthorization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - project: Optional[AuthorizationServiceProject] = None - organization: Optional[AuthorizationServiceOrganization] = None - user: Optional[AuthorizationServiceUser] = None - state: Optional[AuthorizationServiceState] = None - roles: Optional[List[AuthorizationServiceRole]] = Field(default=None, description="Roles contains the roles the user was granted for the project.") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "project", "organization", "user", "state", "roles"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + project: Optional[AuthorizationServiceProject] = Field( + default=None, alias="project" + ) + organization: Optional[AuthorizationServiceOrganization] = Field( + default=None, alias="organization" + ) + user: Optional[AuthorizationServiceUser] = Field(default=None, alias="user") + state: Optional[AuthorizationServiceState] = Field(default=None, alias="state") + roles: Optional[List[AuthorizationServiceRole]] = Field( + default=None, + alias="roles", + description="Roles contains the roles the user was granted for the project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -49,75 +57,15 @@ class AuthorizationServiceAuthorization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceAuthorization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project - if self.project: - _dict['project'] = self.project.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in roles (list) - _items = [] - if self.roles: - for _item_roles in self.roles: - if _item_roles: - _items.append(_item_roles.to_dict()) - _dict['roles'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceAuthorization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "project": AuthorizationServiceProject.from_dict(obj["project"]) if obj.get("project") is not None else None, - "organization": AuthorizationServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "user": AuthorizationServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "state": obj.get("state"), - "roles": [AuthorizationServiceRole.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.authorization_service_organization import ( + AuthorizationServiceOrganization, +) +from zitadel_client.models.authorization_service_project import ( + AuthorizationServiceProject, +) +from zitadel_client.models.authorization_service_role import AuthorizationServiceRole +from zitadel_client.models.authorization_service_state import AuthorizationServiceState +from zitadel_client.models.authorization_service_user import AuthorizationServiceUser +AuthorizationServiceAuthorization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_authorization_field_name.py b/zitadel_client/models/authorization_service_authorization_field_name.py index b26f4020..de2a4f60 100644 --- a/zitadel_client/models/authorization_service_authorization_field_name.py +++ b/zitadel_client/models/authorization_service_authorization_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class AuthorizationServiceAuthorizationFieldName(str, Enum): @@ -23,21 +13,15 @@ class AuthorizationServiceAuthorizationFieldName(str, Enum): AuthorizationServiceAuthorizationFieldName """ - """ - allowed enum values - """ - AUTHORIZATION_FIELD_NAME_UNSPECIFIED = 'AUTHORIZATION_FIELD_NAME_UNSPECIFIED' - AUTHORIZATION_FIELD_NAME_CREATED_DATE = 'AUTHORIZATION_FIELD_NAME_CREATED_DATE' - AUTHORIZATION_FIELD_NAME_CHANGED_DATE = 'AUTHORIZATION_FIELD_NAME_CHANGED_DATE' - AUTHORIZATION_FIELD_NAME_ID = 'AUTHORIZATION_FIELD_NAME_ID' - AUTHORIZATION_FIELD_NAME_USER_ID = 'AUTHORIZATION_FIELD_NAME_USER_ID' - AUTHORIZATION_FIELD_NAME_PROJECT_ID = 'AUTHORIZATION_FIELD_NAME_PROJECT_ID' - AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID' - AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AuthorizationServiceAuthorizationFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + AUTHORIZATION_FIELD_NAME_UNSPECIFIED = "AUTHORIZATION_FIELD_NAME_UNSPECIFIED" + AUTHORIZATION_FIELD_NAME_CREATED_DATE = "AUTHORIZATION_FIELD_NAME_CREATED_DATE" + AUTHORIZATION_FIELD_NAME_CHANGED_DATE = "AUTHORIZATION_FIELD_NAME_CHANGED_DATE" + AUTHORIZATION_FIELD_NAME_ID = "AUTHORIZATION_FIELD_NAME_ID" + AUTHORIZATION_FIELD_NAME_USER_ID = "AUTHORIZATION_FIELD_NAME_USER_ID" + AUTHORIZATION_FIELD_NAME_PROJECT_ID = "AUTHORIZATION_FIELD_NAME_PROJECT_ID" + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = ( + "AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID" + ) + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = ( + "AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID" + ) diff --git a/zitadel_client/models/authorization_service_authorizations_search_filter.py b/zitadel_client/models/authorization_service_authorizations_search_filter.py index b17b6d32..b8198a3e 100644 --- a/zitadel_client/models/authorization_service_authorizations_search_filter.py +++ b/zitadel_client/models/authorization_service_authorizations_search_filter.py @@ -1,51 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_id_filter import AuthorizationServiceIDFilter -from zitadel_client.models.authorization_service_in_ids_filter import AuthorizationServiceInIDsFilter -from zitadel_client.models.authorization_service_project_name_query import AuthorizationServiceProjectNameQuery -from zitadel_client.models.authorization_service_role_key_query import AuthorizationServiceRoleKeyQuery -from zitadel_client.models.authorization_service_state_query import AuthorizationServiceStateQuery -from zitadel_client.models.authorization_service_user_display_name_query import AuthorizationServiceUserDisplayNameQuery -from zitadel_client.models.authorization_service_user_preferred_login_name_query import AuthorizationServiceUserPreferredLoginNameQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServiceAuthorizationsSearchFilter(BaseModel): """ AuthorizationServiceAuthorizationsSearchFilter - """ # noqa: E501 - authorization_ids: Optional[AuthorizationServiceInIDsFilter] = Field(default=None, alias="authorizationIds") - in_user_ids: Optional[AuthorizationServiceInIDsFilter] = Field(default=None, alias="inUserIds") - organization_id: Optional[AuthorizationServiceIDFilter] = Field(default=None, alias="organizationId") - project_grant_id: Optional[AuthorizationServiceIDFilter] = Field(default=None, alias="projectGrantId") - project_id: Optional[AuthorizationServiceIDFilter] = Field(default=None, alias="projectId") - project_name: Optional[AuthorizationServiceProjectNameQuery] = Field(default=None, alias="projectName") - role_key: Optional[AuthorizationServiceRoleKeyQuery] = Field(default=None, alias="roleKey") - state: Optional[AuthorizationServiceStateQuery] = None - user_display_name: Optional[AuthorizationServiceUserDisplayNameQuery] = Field(default=None, alias="userDisplayName") - user_organization_id: Optional[AuthorizationServiceIDFilter] = Field(default=None, alias="userOrganizationId") - user_preferred_login_name: Optional[AuthorizationServiceUserPreferredLoginNameQuery] = Field(default=None, alias="userPreferredLoginName") - __properties: ClassVar[List[str]] = ["authorizationIds", "inUserIds", "organizationId", "projectGrantId", "projectId", "projectName", "roleKey", "state", "userDisplayName", "userOrganizationId", "userPreferredLoginName"] + """ + authorization_ids: Optional[AuthorizationServiceInIDsFilter] = Field( + default=None, alias="authorizationIds" + ) + in_user_ids: Optional[AuthorizationServiceInIDsFilter] = Field( + default=None, alias="inUserIds" + ) + organization_id: Optional[AuthorizationServiceIDFilter] = Field( + default=None, alias="organizationId" + ) + project_grant_id: Optional[AuthorizationServiceIDFilter] = Field( + default=None, alias="projectGrantId" + ) + project_id: Optional[AuthorizationServiceIDFilter] = Field( + default=None, alias="projectId" + ) + project_name: Optional[AuthorizationServiceProjectNameQuery] = Field( + default=None, alias="projectName" + ) + role_key: Optional[AuthorizationServiceRoleKeyQuery] = Field( + default=None, alias="roleKey" + ) + state: Optional[AuthorizationServiceStateQuery] = Field(default=None, alias="state") + user_display_name: Optional[AuthorizationServiceUserDisplayNameQuery] = Field( + default=None, alias="userDisplayName" + ) + user_organization_id: Optional[AuthorizationServiceIDFilter] = Field( + default=None, alias="userOrganizationId" + ) + user_preferred_login_name: Optional[ + AuthorizationServiceUserPreferredLoginNameQuery + ] = Field(default=None, alias="userPreferredLoginName") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -53,95 +59,26 @@ class AuthorizationServiceAuthorizationsSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceAuthorizationsSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of authorization_ids - if self.authorization_ids: - _dict['authorizationIds'] = self.authorization_ids.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids - if self.in_user_ids: - _dict['inUserIds'] = self.in_user_ids.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id - if self.organization_id: - _dict['organizationId'] = self.organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant_id - if self.project_grant_id: - _dict['projectGrantId'] = self.project_grant_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_id - if self.project_id: - _dict['projectId'] = self.project_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name - if self.project_name: - _dict['projectName'] = self.project_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key - if self.role_key: - _dict['roleKey'] = self.role_key.to_dict() - # override the default output from pydantic by calling `to_dict()` of state - if self.state: - _dict['state'] = self.state.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_display_name - if self.user_display_name: - _dict['userDisplayName'] = self.user_display_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_organization_id - if self.user_organization_id: - _dict['userOrganizationId'] = self.user_organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_preferred_login_name - if self.user_preferred_login_name: - _dict['userPreferredLoginName'] = self.user_preferred_login_name.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceAuthorizationsSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authorizationIds": AuthorizationServiceInIDsFilter.from_dict(obj["authorizationIds"]) if obj.get("authorizationIds") is not None else None, - "inUserIds": AuthorizationServiceInIDsFilter.from_dict(obj["inUserIds"]) if obj.get("inUserIds") is not None else None, - "organizationId": AuthorizationServiceIDFilter.from_dict(obj["organizationId"]) if obj.get("organizationId") is not None else None, - "projectGrantId": AuthorizationServiceIDFilter.from_dict(obj["projectGrantId"]) if obj.get("projectGrantId") is not None else None, - "projectId": AuthorizationServiceIDFilter.from_dict(obj["projectId"]) if obj.get("projectId") is not None else None, - "projectName": AuthorizationServiceProjectNameQuery.from_dict(obj["projectName"]) if obj.get("projectName") is not None else None, - "roleKey": AuthorizationServiceRoleKeyQuery.from_dict(obj["roleKey"]) if obj.get("roleKey") is not None else None, - "state": AuthorizationServiceStateQuery.from_dict(obj["state"]) if obj.get("state") is not None else None, - "userDisplayName": AuthorizationServiceUserDisplayNameQuery.from_dict(obj["userDisplayName"]) if obj.get("userDisplayName") is not None else None, - "userOrganizationId": AuthorizationServiceIDFilter.from_dict(obj["userOrganizationId"]) if obj.get("userOrganizationId") is not None else None, - "userPreferredLoginName": AuthorizationServiceUserPreferredLoginNameQuery.from_dict(obj["userPreferredLoginName"]) if obj.get("userPreferredLoginName") is not None else None - }) - return _obj - - +from zitadel_client.models.authorization_service_id_filter import ( + AuthorizationServiceIDFilter, +) +from zitadel_client.models.authorization_service_in_ids_filter import ( + AuthorizationServiceInIDsFilter, +) +from zitadel_client.models.authorization_service_project_name_query import ( + AuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.authorization_service_role_key_query import ( + AuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.authorization_service_state_query import ( + AuthorizationServiceStateQuery, +) +from zitadel_client.models.authorization_service_user_display_name_query import ( + AuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.authorization_service_user_preferred_login_name_query import ( + AuthorizationServiceUserPreferredLoginNameQuery, +) + +AuthorizationServiceAuthorizationsSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_connect_error.py b/zitadel_client/models/authorization_service_connect_error.py index afc797db..a37ea665 100644 --- a/zitadel_client/models/authorization_service_connect_error.py +++ b/zitadel_client/models/authorization_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.authorization_service_any import AuthorizationServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class AuthorizationServiceConnectErrorCodeEnum(str, Enum): + """AuthorizationServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class AuthorizationServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[AuthorizationServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[AuthorizationServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[AuthorizationServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [AuthorizationServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.authorization_service_any import AuthorizationServiceAny +AuthorizationServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_create_authorization_request.py b/zitadel_client/models/authorization_service_create_authorization_request.py index 4ef3de46..f9c12c80 100644 --- a/zitadel_client/models/authorization_service_create_authorization_request.py +++ b/zitadel_client/models/authorization_service_create_authorization_request.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class AuthorizationServiceCreateAuthorizationRequest(BaseModel): """ AuthorizationServiceCreateAuthorizationRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should be granted the authorization.", alias="userId") - project_id: Optional[StrictStr] = Field(default=None, description="Project ID is the ID of the project the user should be authorized for.", alias="projectId") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project.", alias="organizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys are the keys of the roles the user should be granted.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["userId", "projectId", "organizationId", "roleKeys"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should be granted the authorization.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Project ID is the ID of the project the user should be authorized for.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys are the keys of the roles the user should be granted.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +49,4 @@ class AuthorizationServiceCreateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceCreateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceCreateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "projectId": obj.get("projectId"), - "organizationId": obj.get("organizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +AuthorizationServiceCreateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_create_authorization_response.py b/zitadel_client/models/authorization_service_create_authorization_response.py index 7c47cfb7..a83c2411 100644 --- a/zitadel_client/models/authorization_service_create_authorization_response.py +++ b/zitadel_client/models/authorization_service_create_authorization_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceCreateAuthorizationResponse(BaseModel): """ AuthorizationServiceCreateAuthorizationResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the newly created authorization.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the newly created authorization.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class AuthorizationServiceCreateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceCreateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceCreateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +AuthorizationServiceCreateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_deactivate_authorization_request.py b/zitadel_client/models/authorization_service_deactivate_authorization_request.py index 395c8ee9..afe96254 100644 --- a/zitadel_client/models/authorization_service_deactivate_authorization_request.py +++ b/zitadel_client/models/authorization_service_deactivate_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceDeactivateAuthorizationRequest(BaseModel): """ AuthorizationServiceDeactivateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be deactivated.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be deactivated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class AuthorizationServiceDeactivateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeactivateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeactivateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +AuthorizationServiceDeactivateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_deactivate_authorization_response.py b/zitadel_client/models/authorization_service_deactivate_authorization_response.py index 2b86892a..bfc49233 100644 --- a/zitadel_client/models/authorization_service_deactivate_authorization_response.py +++ b/zitadel_client/models/authorization_service_deactivate_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServiceDeactivateAuthorizationResponse(BaseModel): """ AuthorizationServiceDeactivateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class AuthorizationServiceDeactivateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeactivateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeactivateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +AuthorizationServiceDeactivateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_delete_authorization_request.py b/zitadel_client/models/authorization_service_delete_authorization_request.py index bd3bf632..d86a5834 100644 --- a/zitadel_client/models/authorization_service_delete_authorization_request.py +++ b/zitadel_client/models/authorization_service_delete_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceDeleteAuthorizationRequest(BaseModel): """ AuthorizationServiceDeleteAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be deleted.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class AuthorizationServiceDeleteAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeleteAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeleteAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +AuthorizationServiceDeleteAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_delete_authorization_response.py b/zitadel_client/models/authorization_service_delete_authorization_response.py index 82767bac..8310bb73 100644 --- a/zitadel_client/models/authorization_service_delete_authorization_response.py +++ b/zitadel_client/models/authorization_service_delete_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServiceDeleteAuthorizationResponse(BaseModel): """ AuthorizationServiceDeleteAuthorizationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class AuthorizationServiceDeleteAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeleteAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceDeleteAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +AuthorizationServiceDeleteAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_id_filter.py b/zitadel_client/models/authorization_service_id_filter.py index d90381dc..7007eae8 100644 --- a/zitadel_client/models/authorization_service_id_filter.py +++ b/zitadel_client/models/authorization_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceIDFilter(BaseModel): """ AuthorizationServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class AuthorizationServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +AuthorizationServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_in_ids_filter.py b/zitadel_client/models/authorization_service_in_ids_filter.py index bde7c08f..061b1fb6 100644 --- a/zitadel_client/models/authorization_service_in_ids_filter.py +++ b/zitadel_client/models/authorization_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class AuthorizationServiceInIDsFilter(BaseModel): """ AuthorizationServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class AuthorizationServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +AuthorizationServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_list_authorizations_request.py b/zitadel_client/models/authorization_service_list_authorizations_request.py index b9219f03..315b234d 100644 --- a/zitadel_client/models/authorization_service_list_authorizations_request.py +++ b/zitadel_client/models/authorization_service_list_authorizations_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.authorization_service_authorization_field_name import AuthorizationServiceAuthorizationFieldName -from zitadel_client.models.authorization_service_authorizations_search_filter import AuthorizationServiceAuthorizationsSearchFilter -from zitadel_client.models.authorization_service_pagination_request import AuthorizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class AuthorizationServiceListAuthorizationsRequest(BaseModel): """ AuthorizationServiceListAuthorizationsRequest - """ # noqa: E501 - pagination: Optional[AuthorizationServicePaginationRequest] = None - sorting_column: Optional[AuthorizationServiceAuthorizationFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[AuthorizationServiceAuthorizationsSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[AuthorizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[AuthorizationServiceAuthorizationFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[AuthorizationServiceAuthorizationsSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class AuthorizationServiceListAuthorizationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceListAuthorizationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceListAuthorizationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": AuthorizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [AuthorizationServiceAuthorizationsSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.authorization_service_authorization_field_name import ( + AuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.authorization_service_authorizations_search_filter import ( + AuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.authorization_service_pagination_request import ( + AuthorizationServicePaginationRequest, +) +AuthorizationServiceListAuthorizationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_list_authorizations_response.py b/zitadel_client/models/authorization_service_list_authorizations_response.py index 5337b4d1..57e7f919 100644 --- a/zitadel_client/models/authorization_service_list_authorizations_response.py +++ b/zitadel_client/models/authorization_service_list_authorizations_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.authorization_service_authorization import AuthorizationServiceAuthorization -from zitadel_client.models.authorization_service_pagination_response import AuthorizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class AuthorizationServiceListAuthorizationsResponse(BaseModel): """ AuthorizationServiceListAuthorizationsResponse - """ # noqa: E501 - pagination: Optional[AuthorizationServicePaginationResponse] = None - authorizations: Optional[List[AuthorizationServiceAuthorization]] = Field(default=None, description="Authorizations contains the list of authorizations matching the request.") - __properties: ClassVar[List[str]] = ["pagination", "authorizations"] + """ + + pagination: Optional[AuthorizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + authorizations: Optional[List[AuthorizationServiceAuthorization]] = Field( + default=None, + alias="authorizations", + description="Authorizations contains the list of authorizations matching the request.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class AuthorizationServiceListAuthorizationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceListAuthorizationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in authorizations (list) - _items = [] - if self.authorizations: - for _item_authorizations in self.authorizations: - if _item_authorizations: - _items.append(_item_authorizations.to_dict()) - _dict['authorizations'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceListAuthorizationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": AuthorizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "authorizations": [AuthorizationServiceAuthorization.from_dict(_item) for _item in obj["authorizations"]] if obj.get("authorizations") is not None else None - }) - return _obj - +from zitadel_client.models.authorization_service_authorization import ( + AuthorizationServiceAuthorization, +) +from zitadel_client.models.authorization_service_pagination_response import ( + AuthorizationServicePaginationResponse, +) +AuthorizationServiceListAuthorizationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_organization.py b/zitadel_client/models/authorization_service_organization.py index 51b8f9c5..582d0e2e 100644 --- a/zitadel_client/models/authorization_service_organization.py +++ b/zitadel_client/models/authorization_service_organization.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceOrganization(BaseModel): """ AuthorizationServiceOrganization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the organization.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the organization.") - __properties: ClassVar[List[str]] = ["id", "name"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the organization.", + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name is the name of the organization." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class AuthorizationServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - return _obj - - +AuthorizationServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_pagination_request.py b/zitadel_client/models/authorization_service_pagination_request.py index e87cf096..2304da2a 100644 --- a/zitadel_client/models/authorization_service_pagination_request.py +++ b/zitadel_client/models/authorization_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class AuthorizationServicePaginationRequest(BaseModel): """ AuthorizationServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class AuthorizationServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +AuthorizationServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_pagination_response.py b/zitadel_client/models/authorization_service_pagination_response.py index 399ba4e0..e8e59f52 100644 --- a/zitadel_client/models/authorization_service_pagination_response.py +++ b/zitadel_client/models/authorization_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServicePaginationResponse(BaseModel): """ AuthorizationServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class AuthorizationServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +AuthorizationServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_project.py b/zitadel_client/models/authorization_service_project.py index 73a826eb..416ca819 100644 --- a/zitadel_client/models/authorization_service_project.py +++ b/zitadel_client/models/authorization_service_project.py @@ -1,36 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceProject(BaseModel): """ AuthorizationServiceProject - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the project.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the project.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization the project belongs to. This does not have to correspond with the authorizations organization. In case the authorization is given on a granted project, this is the organization that owns the project and granted it.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "name", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the project.", + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name is the name of the project." + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the ID of the organization the project belongs to. This does not have to correspond with the authorizations organization. In case the authorization is given on a granted project, this is the organization that owns the project and granted it.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +42,4 @@ class AuthorizationServiceProject(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceProject from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceProject from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +AuthorizationServiceProject.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_project_name_query.py b/zitadel_client/models/authorization_service_project_name_query.py index 8fd29ee8..44b0075d 100644 --- a/zitadel_client/models/authorization_service_project_name_query.py +++ b/zitadel_client/models/authorization_service_project_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_text_filter_method import AuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceProjectNameQuery(BaseModel): """ AuthorizationServiceProjectNameQuery - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project.") - method: Optional[AuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project.", + ) + method: Optional[AuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class AuthorizationServiceProjectNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceProjectNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceProjectNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod, +) +AuthorizationServiceProjectNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_role.py b/zitadel_client/models/authorization_service_role.py index 181ada07..a06ddabf 100644 --- a/zitadel_client/models/authorization_service_role.py +++ b/zitadel_client/models/authorization_service_role.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceRole(BaseModel): """ AuthorizationServiceRole - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Key is the unique key of the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.") - display_name: Optional[StrictStr] = Field(default=None, description="Human readable name for the role, which might be displayed to users.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="The group the role belongs to. This is used to group roles in the UI.") - __properties: ClassVar[List[str]] = ["key", "displayName", "group"] + """ + + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="Key is the unique key of the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Human readable name for the role, which might be displayed to users.", + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="The group the role belongs to. This is used to group roles in the UI.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class AuthorizationServiceRole(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceRole from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceRole from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - - +AuthorizationServiceRole.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_role_key_query.py b/zitadel_client/models/authorization_service_role_key_query.py index 78aa497b..bec2fa5a 100644 --- a/zitadel_client/models/authorization_service_role_key_query.py +++ b/zitadel_client/models/authorization_service_role_key_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_text_filter_method import AuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceRoleKeyQuery(BaseModel): """ AuthorizationServiceRoleKeyQuery - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Specify the key of the role the user was granted to search for.") - method: Optional[AuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="Specify the key of the role the user was granted to search for.", + ) + method: Optional[AuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class AuthorizationServiceRoleKeyQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceRoleKeyQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceRoleKeyQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod, +) +AuthorizationServiceRoleKeyQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_state.py b/zitadel_client/models/authorization_service_state.py index c4ded78e..2c93dbee 100644 --- a/zitadel_client/models/authorization_service_state.py +++ b/zitadel_client/models/authorization_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class AuthorizationServiceState(str, Enum): @@ -23,16 +13,6 @@ class AuthorizationServiceState(str, Enum): AuthorizationServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_ACTIVE = 'STATE_ACTIVE' - STATE_INACTIVE = 'STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AuthorizationServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_ACTIVE = "STATE_ACTIVE" + STATE_INACTIVE = "STATE_INACTIVE" diff --git a/zitadel_client/models/authorization_service_state_query.py b/zitadel_client/models/authorization_service_state_query.py index 46c7e35b..99bb8e44 100644 --- a/zitadel_client/models/authorization_service_state_query.py +++ b/zitadel_client/models/authorization_service_state_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_state import AuthorizationServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class AuthorizationServiceStateQuery(BaseModel): """ AuthorizationServiceStateQuery - """ # noqa: E501 - state: Optional[AuthorizationServiceState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[AuthorizationServiceState] = Field(default=None, alias="state") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class AuthorizationServiceStateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceStateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceStateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.authorization_service_state import AuthorizationServiceState +AuthorizationServiceStateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_text_filter_method.py b/zitadel_client/models/authorization_service_text_filter_method.py index 5c288a9b..4c66f541 100644 --- a/zitadel_client/models/authorization_service_text_filter_method.py +++ b/zitadel_client/models/authorization_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class AuthorizationServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class AuthorizationServiceTextFilterMethod(str, Enum): AuthorizationServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AuthorizationServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/authorization_service_update_authorization_request.py b/zitadel_client/models/authorization_service_update_authorization_request.py index f1cb5fbe..9c37cfc0 100644 --- a/zitadel_client/models/authorization_service_update_authorization_request.py +++ b/zitadel_client/models/authorization_service_update_authorization_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class AuthorizationServiceUpdateAuthorizationRequest(BaseModel): """ AuthorizationServiceUpdateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization.") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["id", "roleKeys"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class AuthorizationServiceUpdateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceUpdateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceUpdateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +AuthorizationServiceUpdateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_update_authorization_response.py b/zitadel_client/models/authorization_service_update_authorization_response.py index c97e8ebc..25dd1e11 100644 --- a/zitadel_client/models/authorization_service_update_authorization_response.py +++ b/zitadel_client/models/authorization_service_update_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class AuthorizationServiceUpdateAuthorizationResponse(BaseModel): """ AuthorizationServiceUpdateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class AuthorizationServiceUpdateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceUpdateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceUpdateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +AuthorizationServiceUpdateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_user.py b/zitadel_client/models/authorization_service_user.py index d9f36776..36514867 100644 --- a/zitadel_client/models/authorization_service_user.py +++ b/zitadel_client/models/authorization_service_user.py @@ -1,38 +1,52 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceUser(BaseModel): """ AuthorizationServiceUser - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID represents the ID of the user who was granted the authorization.") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="PreferredLoginName represents the preferred login name of the granted user.", alias="preferredLoginName") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName represents the public display name of the granted user.", alias="displayName") - avatar_url: Optional[StrictStr] = Field(default=None, description="AvatarURL is the URL to the user's public avatar image.", alias="avatarUrl") - organization_id: Optional[StrictStr] = Field(default=None, description="The organization the user belong to. This does not have to correspond with the authorizations organization.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "preferredLoginName", "displayName", "avatarUrl", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID represents the ID of the user who was granted the authorization.", + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="PreferredLoginName represents the preferred login name of the granted user.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName represents the public display name of the granted user.", + ) + avatar_url: Optional[StrictStr] = Field( + default=None, + alias="avatarUrl", + description="AvatarURL is the URL to the user's public avatar image.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The organization the user belong to. This does not have to correspond with the authorizations organization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +54,4 @@ class AuthorizationServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "preferredLoginName": obj.get("preferredLoginName"), - "displayName": obj.get("displayName"), - "avatarUrl": obj.get("avatarUrl"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +AuthorizationServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_user_display_name_query.py b/zitadel_client/models/authorization_service_user_display_name_query.py index 65ca71cf..3afd1263 100644 --- a/zitadel_client/models/authorization_service_user_display_name_query.py +++ b/zitadel_client/models/authorization_service_user_display_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_text_filter_method import AuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceUserDisplayNameQuery(BaseModel): """ AuthorizationServiceUserDisplayNameQuery - """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Specify the public display name of the granted user to search for.", alias="displayName") - method: Optional[AuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + """ + + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Specify the public display name of the granted user to search for.", + ) + method: Optional[AuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class AuthorizationServiceUserDisplayNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceUserDisplayNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceUserDisplayNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod, +) +AuthorizationServiceUserDisplayNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/authorization_service_user_preferred_login_name_query.py b/zitadel_client/models/authorization_service_user_preferred_login_name_query.py index b858a52d..bafc13ee 100644 --- a/zitadel_client/models/authorization_service_user_preferred_login_name_query.py +++ b/zitadel_client/models/authorization_service_user_preferred_login_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.authorization_service_text_filter_method import AuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class AuthorizationServiceUserPreferredLoginNameQuery(BaseModel): """ AuthorizationServiceUserPreferredLoginNameQuery - """ # noqa: E501 - login_name: Optional[StrictStr] = Field(default=None, description="Specify the preferred login name of the granted user to search for.", alias="loginName") - method: Optional[AuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["loginName", "method"] + """ + + login_name: Optional[StrictStr] = Field( + default=None, + alias="loginName", + description="Specify the preferred login name of the granted user to search for.", + ) + method: Optional[AuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class AuthorizationServiceUserPreferredLoginNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AuthorizationServiceUserPreferredLoginNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AuthorizationServiceUserPreferredLoginNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.authorization_service_text_filter_method import ( + AuthorizationServiceTextFilterMethod, +) +AuthorizationServiceUserPreferredLoginNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_any.py b/zitadel_client/models/beta_action_service_any.py index 3247066c..0dff10e9 100644 --- a/zitadel_client/models/beta_action_service_any.py +++ b/zitadel_client/models/beta_action_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaActionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaActionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_condition.py b/zitadel_client/models/beta_action_service_condition.py index 24cb005c..2d2665f9 100644 --- a/zitadel_client/models/beta_action_service_condition.py +++ b/zitadel_client/models/beta_action_service_condition.py @@ -1,41 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_event_execution import BetaActionServiceEventExecution -from zitadel_client.models.beta_action_service_function_execution import BetaActionServiceFunctionExecution -from zitadel_client.models.beta_action_service_request_execution import BetaActionServiceRequestExecution -from zitadel_client.models.beta_action_service_response_execution import BetaActionServiceResponseExecution -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaActionServiceCondition(BaseModel): """ BetaActionServiceCondition - """ # noqa: E501 - event: Optional[BetaActionServiceEventExecution] = None - function: Optional[BetaActionServiceFunctionExecution] = None - request: Optional[BetaActionServiceRequestExecution] = None - response: Optional[BetaActionServiceResponseExecution] = None - __properties: ClassVar[List[str]] = ["event", "function", "request", "response"] + """ + + event: Optional[BetaActionServiceEventExecution] = Field( + default=None, alias="event" + ) + function: Optional[BetaActionServiceFunctionExecution] = Field( + default=None, alias="function" + ) + request: Optional[BetaActionServiceRequestExecution] = Field( + default=None, alias="request" + ) + response: Optional[BetaActionServiceResponseExecution] = Field( + default=None, alias="response" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,67 +40,17 @@ class BetaActionServiceCondition(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceCondition from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of event - if self.event: - _dict['event'] = self.event.to_dict() - # override the default output from pydantic by calling `to_dict()` of function - if self.function: - _dict['function'] = self.function.to_dict() - # override the default output from pydantic by calling `to_dict()` of request - if self.request: - _dict['request'] = self.request.to_dict() - # override the default output from pydantic by calling `to_dict()` of response - if self.response: - _dict['response'] = self.response.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceCondition from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "event": BetaActionServiceEventExecution.from_dict(obj["event"]) if obj.get("event") is not None else None, - "function": BetaActionServiceFunctionExecution.from_dict(obj["function"]) if obj.get("function") is not None else None, - "request": BetaActionServiceRequestExecution.from_dict(obj["request"]) if obj.get("request") is not None else None, - "response": BetaActionServiceResponseExecution.from_dict(obj["response"]) if obj.get("response") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_action_service_event_execution import ( + BetaActionServiceEventExecution, +) +from zitadel_client.models.beta_action_service_function_execution import ( + BetaActionServiceFunctionExecution, +) +from zitadel_client.models.beta_action_service_request_execution import ( + BetaActionServiceRequestExecution, +) +from zitadel_client.models.beta_action_service_response_execution import ( + BetaActionServiceResponseExecution, +) + +BetaActionServiceCondition.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_connect_error.py b/zitadel_client/models/beta_action_service_connect_error.py index ea1094a6..72863119 100644 --- a/zitadel_client/models/beta_action_service_connect_error.py +++ b/zitadel_client/models/beta_action_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_any import BetaActionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaActionServiceConnectErrorCodeEnum(str, Enum): + """BetaActionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaActionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaActionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaActionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaActionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaActionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_action_service_any import BetaActionServiceAny +BetaActionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_create_target_request.py b/zitadel_client/models/beta_action_service_create_target_request.py index 52648d43..f350ccdf 100644 --- a/zitadel_client/models/beta_action_service_create_target_request.py +++ b/zitadel_client/models/beta_action_service_create_target_request.py @@ -1,41 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_rest_call import BetaActionServiceRESTCall -from zitadel_client.models.beta_action_service_rest_webhook import BetaActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceCreateTargetRequest(BaseModel): """ BetaActionServiceCreateTargetRequest - """ # noqa: E501 - name: Optional[StrictStr] = None - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = None - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") - rest_call: Optional[BetaActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["name", "timeout", "endpoint", "restAsync", "restCall", "restWebhook"] + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field(default=None, alias="endpoint") + rest_async: Optional[object] = Field(default=None, alias="restAsync") + rest_call: Optional[BetaActionServiceRESTCall] = Field( + default=None, alias="restCall" + ) + rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,63 +43,12 @@ class BetaActionServiceCreateTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceCreateTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceCreateTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "restAsync": obj.get("restAsync"), - "restCall": BetaActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": BetaActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_action_service_rest_call import ( + BetaActionServiceRESTCall, +) +from zitadel_client.models.beta_action_service_rest_webhook import ( + BetaActionServiceRESTWebhook, +) +BetaActionServiceCreateTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_create_target_response.py b/zitadel_client/models/beta_action_service_create_target_response.py index 6ea97bfe..3b7a8be2 100644 --- a/zitadel_client/models/beta_action_service_create_target_response.py +++ b/zitadel_client/models/beta_action_service_create_target_response.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceCreateTargetResponse(BaseModel): """ BetaActionServiceCreateTargetResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created target.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - signing_key: Optional[StrictStr] = Field(default=None, description="Key used to sign and check payload sent to the target.", alias="signingKey") - __properties: ClassVar[List[str]] = ["id", "creationDate", "signingKey"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created target.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + signing_key: Optional[StrictStr] = Field( + default=None, + alias="signingKey", + description="Key used to sign and check payload sent to the target.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,6 @@ class BetaActionServiceCreateTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceCreateTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceCreateTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "signingKey": obj.get("signingKey") - }) - return _obj - +from pydantic import AwareDatetime +BetaActionServiceCreateTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_delete_target_request.py b/zitadel_client/models/beta_action_service_delete_target_request.py index 016a1fde..1de1edc4 100644 --- a/zitadel_client/models/beta_action_service_delete_target_request.py +++ b/zitadel_client/models/beta_action_service_delete_target_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceDeleteTargetRequest(BaseModel): """ BetaActionServiceDeleteTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaActionServiceDeleteTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceDeleteTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceDeleteTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaActionServiceDeleteTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_delete_target_response.py b/zitadel_client/models/beta_action_service_delete_target_response.py index 23740da1..c9b94fbd 100644 --- a/zitadel_client/models/beta_action_service_delete_target_response.py +++ b/zitadel_client/models/beta_action_service_delete_target_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServiceDeleteTargetResponse(BaseModel): """ BetaActionServiceDeleteTargetResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaActionServiceDeleteTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceDeleteTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceDeleteTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaActionServiceDeleteTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_event_execution.py b/zitadel_client/models/beta_action_service_event_execution.py index 779631ec..efbc1c38 100644 --- a/zitadel_client/models/beta_action_service_event_execution.py +++ b/zitadel_client/models/beta_action_service_event_execution.py @@ -1,36 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaActionServiceEventExecution(BaseModel): """ BetaActionServiceEventExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="all events as condition.") - event: Optional[StrictStr] = Field(default=None, description="Event name as condition.") - group: Optional[StrictStr] = Field(default=None, description="Event group as condition, all events under this group.") - __properties: ClassVar[List[str]] = ["all", "event", "group"] + """ + + all: Optional[StrictBool] = Field( + default=None, alias="all", description="all events as condition." + ) + event: Optional[StrictStr] = Field( + default=None, alias="event", description="Event name as condition." + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="Event group as condition, all events under this group.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +40,4 @@ class BetaActionServiceEventExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceEventExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceEventExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "event": obj.get("event"), - "group": obj.get("group") - }) - return _obj - - +BetaActionServiceEventExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_execution.py b/zitadel_client/models/beta_action_service_execution.py index 55f7d8cf..d57fad77 100644 --- a/zitadel_client/models/beta_action_service_execution.py +++ b/zitadel_client/models/beta_action_service_execution.py @@ -1,39 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_condition import BetaActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceExecution(BaseModel): """ BetaActionServiceExecution - """ # noqa: E501 - condition: Optional[BetaActionServiceCondition] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - targets: Optional[List[StrictStr]] = Field(default=None, description="Ordered list of targets called during the execution.") - __properties: ClassVar[List[str]] = ["condition", "creationDate", "changeDate", "targets"] + """ + + condition: Optional[BetaActionServiceCondition] = Field( + default=None, alias="condition" + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + targets: Optional[List[StrictStr]] = Field( + default=None, + alias="targets", + description="Ordered list of targets called during the execution.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,58 +47,9 @@ class BetaActionServiceExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of condition - if self.condition: - _dict['condition'] = self.condition.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "condition": BetaActionServiceCondition.from_dict(obj["condition"]) if obj.get("condition") is not None else None, - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "targets": obj.get("targets") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_action_service_condition import ( + BetaActionServiceCondition, +) +BetaActionServiceExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_execution_field_name.py b/zitadel_client/models/beta_action_service_execution_field_name.py index af2d7b0b..2218a52d 100644 --- a/zitadel_client/models/beta_action_service_execution_field_name.py +++ b/zitadel_client/models/beta_action_service_execution_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaActionServiceExecutionFieldName(str, Enum): @@ -23,17 +13,7 @@ class BetaActionServiceExecutionFieldName(str, Enum): BetaActionServiceExecutionFieldName """ - """ - allowed enum values - """ - EXECUTION_FIELD_NAME_UNSPECIFIED = 'EXECUTION_FIELD_NAME_UNSPECIFIED' - EXECUTION_FIELD_NAME_ID = 'EXECUTION_FIELD_NAME_ID' - EXECUTION_FIELD_NAME_CREATED_DATE = 'EXECUTION_FIELD_NAME_CREATED_DATE' - EXECUTION_FIELD_NAME_CHANGED_DATE = 'EXECUTION_FIELD_NAME_CHANGED_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaActionServiceExecutionFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + EXECUTION_FIELD_NAME_UNSPECIFIED = "EXECUTION_FIELD_NAME_UNSPECIFIED" + EXECUTION_FIELD_NAME_ID = "EXECUTION_FIELD_NAME_ID" + EXECUTION_FIELD_NAME_CREATED_DATE = "EXECUTION_FIELD_NAME_CREATED_DATE" + EXECUTION_FIELD_NAME_CHANGED_DATE = "EXECUTION_FIELD_NAME_CHANGED_DATE" diff --git a/zitadel_client/models/beta_action_service_execution_search_filter.py b/zitadel_client/models/beta_action_service_execution_search_filter.py index 50753a23..c3594399 100644 --- a/zitadel_client/models/beta_action_service_execution_search_filter.py +++ b/zitadel_client/models/beta_action_service_execution_search_filter.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_execution_type_filter import BetaActionServiceExecutionTypeFilter -from zitadel_client.models.beta_action_service_in_conditions_filter import BetaActionServiceInConditionsFilter -from zitadel_client.models.beta_action_service_target_filter import BetaActionServiceTargetFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServiceExecutionSearchFilter(BaseModel): """ BetaActionServiceExecutionSearchFilter - """ # noqa: E501 - execution_type_filter: Optional[BetaActionServiceExecutionTypeFilter] = Field(default=None, alias="executionTypeFilter") - in_conditions_filter: Optional[BetaActionServiceInConditionsFilter] = Field(default=None, alias="inConditionsFilter") - target_filter: Optional[BetaActionServiceTargetFilter] = Field(default=None, alias="targetFilter") - __properties: ClassVar[List[str]] = ["executionTypeFilter", "inConditionsFilter", "targetFilter"] + """ + + execution_type_filter: Optional[BetaActionServiceExecutionTypeFilter] = Field( + default=None, alias="executionTypeFilter" + ) + in_conditions_filter: Optional[BetaActionServiceInConditionsFilter] = Field( + default=None, alias="inConditionsFilter" + ) + target_filter: Optional[BetaActionServiceTargetFilter] = Field( + default=None, alias="targetFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,14 @@ class BetaActionServiceExecutionSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceExecutionSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of execution_type_filter - if self.execution_type_filter: - _dict['executionTypeFilter'] = self.execution_type_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_conditions_filter - if self.in_conditions_filter: - _dict['inConditionsFilter'] = self.in_conditions_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of target_filter - if self.target_filter: - _dict['targetFilter'] = self.target_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceExecutionSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionTypeFilter": BetaActionServiceExecutionTypeFilter.from_dict(obj["executionTypeFilter"]) if obj.get("executionTypeFilter") is not None else None, - "inConditionsFilter": BetaActionServiceInConditionsFilter.from_dict(obj["inConditionsFilter"]) if obj.get("inConditionsFilter") is not None else None, - "targetFilter": BetaActionServiceTargetFilter.from_dict(obj["targetFilter"]) if obj.get("targetFilter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_execution_type_filter import ( + BetaActionServiceExecutionTypeFilter, +) +from zitadel_client.models.beta_action_service_in_conditions_filter import ( + BetaActionServiceInConditionsFilter, +) +from zitadel_client.models.beta_action_service_target_filter import ( + BetaActionServiceTargetFilter, +) +BetaActionServiceExecutionSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_execution_type.py b/zitadel_client/models/beta_action_service_execution_type.py index f37c02fe..9869a8c3 100644 --- a/zitadel_client/models/beta_action_service_execution_type.py +++ b/zitadel_client/models/beta_action_service_execution_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaActionServiceExecutionType(str, Enum): @@ -23,18 +13,8 @@ class BetaActionServiceExecutionType(str, Enum): BetaActionServiceExecutionType """ - """ - allowed enum values - """ - EXECUTION_TYPE_UNSPECIFIED = 'EXECUTION_TYPE_UNSPECIFIED' - EXECUTION_TYPE_REQUEST = 'EXECUTION_TYPE_REQUEST' - EXECUTION_TYPE_RESPONSE = 'EXECUTION_TYPE_RESPONSE' - EXECUTION_TYPE_EVENT = 'EXECUTION_TYPE_EVENT' - EXECUTION_TYPE_FUNCTION = 'EXECUTION_TYPE_FUNCTION' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaActionServiceExecutionType from a JSON string""" - return cls(json.loads(json_str)) - - + EXECUTION_TYPE_UNSPECIFIED = "EXECUTION_TYPE_UNSPECIFIED" + EXECUTION_TYPE_REQUEST = "EXECUTION_TYPE_REQUEST" + EXECUTION_TYPE_RESPONSE = "EXECUTION_TYPE_RESPONSE" + EXECUTION_TYPE_EVENT = "EXECUTION_TYPE_EVENT" + EXECUTION_TYPE_FUNCTION = "EXECUTION_TYPE_FUNCTION" diff --git a/zitadel_client/models/beta_action_service_execution_type_filter.py b/zitadel_client/models/beta_action_service_execution_type_filter.py index 913d30f5..80429087 100644 --- a/zitadel_client/models/beta_action_service_execution_type_filter.py +++ b/zitadel_client/models/beta_action_service_execution_type_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_execution_type import BetaActionServiceExecutionType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServiceExecutionTypeFilter(BaseModel): """ BetaActionServiceExecutionTypeFilter - """ # noqa: E501 - execution_type: Optional[BetaActionServiceExecutionType] = Field(default=None, alias="executionType") - __properties: ClassVar[List[str]] = ["executionType"] + """ + execution_type: Optional[BetaActionServiceExecutionType] = Field( + default=None, alias="executionType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class BetaActionServiceExecutionTypeFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceExecutionTypeFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceExecutionTypeFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionType": obj.get("executionType") - }) - return _obj - +from zitadel_client.models.beta_action_service_execution_type import ( + BetaActionServiceExecutionType, +) +BetaActionServiceExecutionTypeFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_function_execution.py b/zitadel_client/models/beta_action_service_function_execution.py index f615a480..498b7a19 100644 --- a/zitadel_client/models/beta_action_service_function_execution.py +++ b/zitadel_client/models/beta_action_service_function_execution.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceFunctionExecution(BaseModel): """ Executed on the specified function - """ # noqa: E501 - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name"] + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaActionServiceFunctionExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceFunctionExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceFunctionExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name") - }) - return _obj - - +BetaActionServiceFunctionExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_get_target_request.py b/zitadel_client/models/beta_action_service_get_target_request.py index e3c7dda2..454ae64d 100644 --- a/zitadel_client/models/beta_action_service_get_target_request.py +++ b/zitadel_client/models/beta_action_service_get_target_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceGetTargetRequest(BaseModel): """ BetaActionServiceGetTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaActionServiceGetTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceGetTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceGetTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaActionServiceGetTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_get_target_response.py b/zitadel_client/models/beta_action_service_get_target_response.py index 58a5b8dd..10d10410 100644 --- a/zitadel_client/models/beta_action_service_get_target_response.py +++ b/zitadel_client/models/beta_action_service_get_target_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_target import BetaActionServiceTarget -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaActionServiceGetTargetResponse(BaseModel): """ BetaActionServiceGetTargetResponse - """ # noqa: E501 - target: Optional[BetaActionServiceTarget] = None - __properties: ClassVar[List[str]] = ["target"] + """ + target: Optional[BetaActionServiceTarget] = Field(default=None, alias="target") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaActionServiceGetTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceGetTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of target - if self.target: - _dict['target'] = self.target.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceGetTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "target": BetaActionServiceTarget.from_dict(obj["target"]) if obj.get("target") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_target import BetaActionServiceTarget +BetaActionServiceGetTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_in_conditions_filter.py b/zitadel_client/models/beta_action_service_in_conditions_filter.py index 9d793331..d1144274 100644 --- a/zitadel_client/models/beta_action_service_in_conditions_filter.py +++ b/zitadel_client/models/beta_action_service_in_conditions_filter.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_condition import BetaActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaActionServiceInConditionsFilter(BaseModel): """ BetaActionServiceInConditionsFilter - """ # noqa: E501 - conditions: Optional[List[BetaActionServiceCondition]] = Field(default=None, description="Defines the conditions to query for.") - __properties: ClassVar[List[str]] = ["conditions"] + """ + conditions: Optional[List[BetaActionServiceCondition]] = Field( + default=None, + alias="conditions", + description="Defines the conditions to query for.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,59 +33,8 @@ class BetaActionServiceInConditionsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceInConditionsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in conditions (list) - _items = [] - if self.conditions: - for _item_conditions in self.conditions: - if _item_conditions: - _items.append(_item_conditions.to_dict()) - _dict['conditions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceInConditionsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "conditions": [BetaActionServiceCondition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_condition import ( + BetaActionServiceCondition, +) +BetaActionServiceInConditionsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_in_target_ids_filter.py b/zitadel_client/models/beta_action_service_in_target_ids_filter.py index 6c3e55d1..e6e805b7 100644 --- a/zitadel_client/models/beta_action_service_in_target_ids_filter.py +++ b/zitadel_client/models/beta_action_service_in_target_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceInTargetIDsFilter(BaseModel): """ BetaActionServiceInTargetIDsFilter - """ # noqa: E501 - target_ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.", alias="targetIds") - __properties: ClassVar[List[str]] = ["targetIds"] + """ + target_ids: Optional[List[StrictStr]] = Field( + default=None, alias="targetIds", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaActionServiceInTargetIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceInTargetIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceInTargetIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetIds": obj.get("targetIds") - }) - return _obj - - +BetaActionServiceInTargetIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_execution_functions_response.py b/zitadel_client/models/beta_action_service_list_execution_functions_response.py index e5d09479..730ca351 100644 --- a/zitadel_client/models/beta_action_service_list_execution_functions_response.py +++ b/zitadel_client/models/beta_action_service_list_execution_functions_response.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceListExecutionFunctionsResponse(BaseModel): """ BetaActionServiceListExecutionFunctionsResponse - """ # noqa: E501 - functions: Optional[List[StrictStr]] = Field(default=None, description="All available methods") - __properties: ClassVar[List[str]] = ["functions"] + """ + functions: Optional[List[StrictStr]] = Field( + default=None, alias="functions", description="All available methods" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaActionServiceListExecutionFunctionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionFunctionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionFunctionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "functions": obj.get("functions") - }) - return _obj - - +BetaActionServiceListExecutionFunctionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_execution_methods_response.py b/zitadel_client/models/beta_action_service_list_execution_methods_response.py index 26f97944..abe50127 100644 --- a/zitadel_client/models/beta_action_service_list_execution_methods_response.py +++ b/zitadel_client/models/beta_action_service_list_execution_methods_response.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceListExecutionMethodsResponse(BaseModel): """ BetaActionServiceListExecutionMethodsResponse - """ # noqa: E501 - methods: Optional[List[StrictStr]] = Field(default=None, description="All available methods") - __properties: ClassVar[List[str]] = ["methods"] + """ + methods: Optional[List[StrictStr]] = Field( + default=None, alias="methods", description="All available methods" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaActionServiceListExecutionMethodsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionMethodsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionMethodsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "methods": obj.get("methods") - }) - return _obj - - +BetaActionServiceListExecutionMethodsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_execution_services_response.py b/zitadel_client/models/beta_action_service_list_execution_services_response.py index 2a44a298..671a2155 100644 --- a/zitadel_client/models/beta_action_service_list_execution_services_response.py +++ b/zitadel_client/models/beta_action_service_list_execution_services_response.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceListExecutionServicesResponse(BaseModel): """ BetaActionServiceListExecutionServicesResponse - """ # noqa: E501 - services: Optional[List[StrictStr]] = Field(default=None, description="All available methods") - __properties: ClassVar[List[str]] = ["services"] + """ + services: Optional[List[StrictStr]] = Field( + default=None, alias="services", description="All available methods" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaActionServiceListExecutionServicesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionServicesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionServicesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "services": obj.get("services") - }) - return _obj - - +BetaActionServiceListExecutionServicesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_executions_request.py b/zitadel_client/models/beta_action_service_list_executions_request.py index 782c48de..58156d23 100644 --- a/zitadel_client/models/beta_action_service_list_executions_request.py +++ b/zitadel_client/models/beta_action_service_list_executions_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_execution_field_name import BetaActionServiceExecutionFieldName -from zitadel_client.models.beta_action_service_execution_search_filter import BetaActionServiceExecutionSearchFilter -from zitadel_client.models.beta_action_service_pagination_request import BetaActionServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaActionServiceListExecutionsRequest(BaseModel): """ BetaActionServiceListExecutionsRequest - """ # noqa: E501 - pagination: Optional[BetaActionServicePaginationRequest] = None - sorting_column: Optional[BetaActionServiceExecutionFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaActionServiceExecutionSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaActionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaActionServiceExecutionFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaActionServiceExecutionSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class BetaActionServiceListExecutionsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaActionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaActionServiceExecutionSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_execution_field_name import ( + BetaActionServiceExecutionFieldName, +) +from zitadel_client.models.beta_action_service_execution_search_filter import ( + BetaActionServiceExecutionSearchFilter, +) +from zitadel_client.models.beta_action_service_pagination_request import ( + BetaActionServicePaginationRequest, +) +BetaActionServiceListExecutionsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_executions_response.py b/zitadel_client/models/beta_action_service_list_executions_response.py index cbfd7b2d..4297f7ed 100644 --- a/zitadel_client/models/beta_action_service_list_executions_response.py +++ b/zitadel_client/models/beta_action_service_list_executions_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_execution import BetaActionServiceExecution -from zitadel_client.models.beta_action_service_pagination_response import BetaActionServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaActionServiceListExecutionsResponse(BaseModel): """ BetaActionServiceListExecutionsResponse - """ # noqa: E501 - pagination: Optional[BetaActionServicePaginationResponse] = None - executions: Optional[List[BetaActionServiceExecution]] = None - __properties: ClassVar[List[str]] = ["pagination", "executions"] + """ + + pagination: Optional[BetaActionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + executions: Optional[List[BetaActionServiceExecution]] = Field( + default=None, alias="executions" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaActionServiceListExecutionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in executions (list) - _items = [] - if self.executions: - for _item_executions in self.executions: - if _item_executions: - _items.append(_item_executions.to_dict()) - _dict['executions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListExecutionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaActionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "executions": [BetaActionServiceExecution.from_dict(_item) for _item in obj["executions"]] if obj.get("executions") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_execution import ( + BetaActionServiceExecution, +) +from zitadel_client.models.beta_action_service_pagination_response import ( + BetaActionServicePaginationResponse, +) +BetaActionServiceListExecutionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_targets_request.py b/zitadel_client/models/beta_action_service_list_targets_request.py index 64340af6..89de8789 100644 --- a/zitadel_client/models/beta_action_service_list_targets_request.py +++ b/zitadel_client/models/beta_action_service_list_targets_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_pagination_request import BetaActionServicePaginationRequest -from zitadel_client.models.beta_action_service_target_field_name import BetaActionServiceTargetFieldName -from zitadel_client.models.beta_action_service_target_search_filter import BetaActionServiceTargetSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaActionServiceListTargetsRequest(BaseModel): """ BetaActionServiceListTargetsRequest - """ # noqa: E501 - pagination: Optional[BetaActionServicePaginationRequest] = None - sorting_column: Optional[BetaActionServiceTargetFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaActionServiceTargetSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaActionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaActionServiceTargetFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaActionServiceTargetSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class BetaActionServiceListTargetsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListTargetsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListTargetsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaActionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaActionServiceTargetSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_pagination_request import ( + BetaActionServicePaginationRequest, +) +from zitadel_client.models.beta_action_service_target_field_name import ( + BetaActionServiceTargetFieldName, +) +from zitadel_client.models.beta_action_service_target_search_filter import ( + BetaActionServiceTargetSearchFilter, +) +BetaActionServiceListTargetsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_list_targets_response.py b/zitadel_client/models/beta_action_service_list_targets_response.py index 63d50760..92031ffa 100644 --- a/zitadel_client/models/beta_action_service_list_targets_response.py +++ b/zitadel_client/models/beta_action_service_list_targets_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_pagination_response import BetaActionServicePaginationResponse -from zitadel_client.models.beta_action_service_target import BetaActionServiceTarget -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaActionServiceListTargetsResponse(BaseModel): """ BetaActionServiceListTargetsResponse - """ # noqa: E501 - pagination: Optional[BetaActionServicePaginationResponse] = None - targets: Optional[List[BetaActionServiceTarget]] = None - __properties: ClassVar[List[str]] = ["pagination", "targets"] + """ + + pagination: Optional[BetaActionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + targets: Optional[List[BetaActionServiceTarget]] = Field( + default=None, alias="targets" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class BetaActionServiceListTargetsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceListTargetsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in targets (list) - _items = [] - if self.targets: - for _item_targets in self.targets: - if _item_targets: - _items.append(_item_targets.to_dict()) - _dict['targets'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceListTargetsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaActionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "targets": [BetaActionServiceTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_pagination_response import ( + BetaActionServicePaginationResponse, +) +from zitadel_client.models.beta_action_service_target import BetaActionServiceTarget +BetaActionServiceListTargetsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_pagination_request.py b/zitadel_client/models/beta_action_service_pagination_request.py index 45c4ef7a..6cc83cf4 100644 --- a/zitadel_client/models/beta_action_service_pagination_request.py +++ b/zitadel_client/models/beta_action_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaActionServicePaginationRequest(BaseModel): """ BetaActionServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaActionServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaActionServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_pagination_response.py b/zitadel_client/models/beta_action_service_pagination_response.py index b7545a37..2df9ade3 100644 --- a/zitadel_client/models/beta_action_service_pagination_response.py +++ b/zitadel_client/models/beta_action_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServicePaginationResponse(BaseModel): """ BetaActionServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaActionServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaActionServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_request_execution.py b/zitadel_client/models/beta_action_service_request_execution.py index 154f0b47..32b7f7cd 100644 --- a/zitadel_client/models/beta_action_service_request_execution.py +++ b/zitadel_client/models/beta_action_service_request_execution.py @@ -1,36 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaActionServiceRequestExecution(BaseModel): """ BetaActionServiceRequestExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="All calls to any available services and methods as condition.") - method: Optional[StrictStr] = Field(default=None, description="GRPC-method as condition.") - service: Optional[StrictStr] = Field(default=None, description="GRPC-service as condition.") - __properties: ClassVar[List[str]] = ["all", "method", "service"] + """ + + all: Optional[StrictBool] = Field( + default=None, + alias="all", + description="All calls to any available services and methods as condition.", + ) + method: Optional[StrictStr] = Field( + default=None, alias="method", description="GRPC-method as condition." + ) + service: Optional[StrictStr] = Field( + default=None, alias="service", description="GRPC-service as condition." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +40,4 @@ class BetaActionServiceRequestExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceRequestExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceRequestExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "method": obj.get("method"), - "service": obj.get("service") - }) - return _obj - - +BetaActionServiceRequestExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_response_execution.py b/zitadel_client/models/beta_action_service_response_execution.py index 14bc30a5..7fdfa5f2 100644 --- a/zitadel_client/models/beta_action_service_response_execution.py +++ b/zitadel_client/models/beta_action_service_response_execution.py @@ -1,36 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaActionServiceResponseExecution(BaseModel): """ BetaActionServiceResponseExecution - """ # noqa: E501 - all: Optional[StrictBool] = Field(default=None, description="All calls to any available services and methods as condition.") - method: Optional[StrictStr] = Field(default=None, description="GRPC-method as condition.") - service: Optional[StrictStr] = Field(default=None, description="GRPC-service as condition.") - __properties: ClassVar[List[str]] = ["all", "method", "service"] + """ + + all: Optional[StrictBool] = Field( + default=None, + alias="all", + description="All calls to any available services and methods as condition.", + ) + method: Optional[StrictStr] = Field( + default=None, alias="method", description="GRPC-method as condition." + ) + service: Optional[StrictStr] = Field( + default=None, alias="service", description="GRPC-service as condition." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +40,4 @@ class BetaActionServiceResponseExecution(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceResponseExecution from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceResponseExecution from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "all": obj.get("all"), - "method": obj.get("method"), - "service": obj.get("service") - }) - return _obj - - +BetaActionServiceResponseExecution.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_rest_call.py b/zitadel_client/models/beta_action_service_rest_call.py index 43400c33..96a7f85b 100644 --- a/zitadel_client/models/beta_action_service_rest_call.py +++ b/zitadel_client/models/beta_action_service_rest_call.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaActionServiceRESTCall(BaseModel): """ BetaActionServiceRESTCall - """ # noqa: E501 - interrupt_on_error: Optional[StrictBool] = Field(default=None, description="Define if any error stops the whole execution. By default the process continues as normal.", alias="interruptOnError") - __properties: ClassVar[List[str]] = ["interruptOnError"] + """ + interrupt_on_error: Optional[StrictBool] = Field( + default=None, + alias="interruptOnError", + description="Define if any error stops the whole execution. By default the process continues as normal.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaActionServiceRESTCall(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceRESTCall from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceRESTCall from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "interruptOnError": obj.get("interruptOnError") - }) - return _obj - - +BetaActionServiceRESTCall.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_rest_webhook.py b/zitadel_client/models/beta_action_service_rest_webhook.py index e26c2d93..43f9dd93 100644 --- a/zitadel_client/models/beta_action_service_rest_webhook.py +++ b/zitadel_client/models/beta_action_service_rest_webhook.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaActionServiceRESTWebhook(BaseModel): """ BetaActionServiceRESTWebhook - """ # noqa: E501 - interrupt_on_error: Optional[StrictBool] = Field(default=None, description="Define if any error stops the whole execution. By default the process continues as normal.", alias="interruptOnError") - __properties: ClassVar[List[str]] = ["interruptOnError"] + """ + interrupt_on_error: Optional[StrictBool] = Field( + default=None, + alias="interruptOnError", + description="Define if any error stops the whole execution. By default the process continues as normal.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaActionServiceRESTWebhook(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceRESTWebhook from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceRESTWebhook from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "interruptOnError": obj.get("interruptOnError") - }) - return _obj - - +BetaActionServiceRESTWebhook.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_set_execution_request.py b/zitadel_client/models/beta_action_service_set_execution_request.py index 8e57e25d..2648475f 100644 --- a/zitadel_client/models/beta_action_service_set_execution_request.py +++ b/zitadel_client/models/beta_action_service_set_execution_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_action_service_condition import BetaActionServiceCondition -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaActionServiceSetExecutionRequest(BaseModel): """ BetaActionServiceSetExecutionRequest - """ # noqa: E501 - condition: Optional[BetaActionServiceCondition] = None - targets: Optional[List[StrictStr]] = Field(default=None, description="Ordered list of targets called during the execution.") - __properties: ClassVar[List[str]] = ["condition", "targets"] + """ + + condition: Optional[BetaActionServiceCondition] = Field( + default=None, alias="condition" + ) + targets: Optional[List[StrictStr]] = Field( + default=None, + alias="targets", + description="Ordered list of targets called during the execution.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +37,8 @@ class BetaActionServiceSetExecutionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceSetExecutionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of condition - if self.condition: - _dict['condition'] = self.condition.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceSetExecutionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "condition": BetaActionServiceCondition.from_dict(obj["condition"]) if obj.get("condition") is not None else None, - "targets": obj.get("targets") - }) - return _obj - +from zitadel_client.models.beta_action_service_condition import ( + BetaActionServiceCondition, +) +BetaActionServiceSetExecutionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_set_execution_response.py b/zitadel_client/models/beta_action_service_set_execution_response.py index 726f06fe..a5e16ed3 100644 --- a/zitadel_client/models/beta_action_service_set_execution_response.py +++ b/zitadel_client/models/beta_action_service_set_execution_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServiceSetExecutionResponse(BaseModel): """ BetaActionServiceSetExecutionResponse - """ # noqa: E501 - set_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="setDate") - __properties: ClassVar[List[str]] = ["setDate"] + """ + set_date: Optional[AwareDatetime] = Field( + default=None, + alias="setDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaActionServiceSetExecutionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceSetExecutionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceSetExecutionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "setDate": obj.get("setDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaActionServiceSetExecutionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_target.py b/zitadel_client/models/beta_action_service_target.py index 8309b2cc..04356af9 100644 --- a/zitadel_client/models/beta_action_service_target.py +++ b/zitadel_client/models/beta_action_service_target.py @@ -1,46 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_rest_call import BetaActionServiceRESTCall -from zitadel_client.models.beta_action_service_rest_webhook import BetaActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceTarget(BaseModel): """ BetaActionServiceTarget - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the target.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - name: Optional[StrictStr] = None - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = None + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the target." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + name: Optional[StrictStr] = Field(default=None, alias="name") + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field(default=None, alias="endpoint") signing_key: Optional[StrictStr] = Field(default=None, alias="signingKey") - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") - rest_call: Optional[BetaActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "name", "timeout", "endpoint", "signingKey", "restAsync", "restCall", "restWebhook"] + rest_async: Optional[object] = Field(default=None, alias="restAsync") + rest_call: Optional[BetaActionServiceRESTCall] = Field( + default=None, alias="restCall" + ) + rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,67 +57,13 @@ class BetaActionServiceTarget(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceTarget from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceTarget from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "signingKey": obj.get("signingKey"), - "restAsync": obj.get("restAsync"), - "restCall": BetaActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": BetaActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_action_service_rest_call import ( + BetaActionServiceRESTCall, +) +from zitadel_client.models.beta_action_service_rest_webhook import ( + BetaActionServiceRESTWebhook, +) +BetaActionServiceTarget.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_target_field_name.py b/zitadel_client/models/beta_action_service_target_field_name.py index a432350d..c60bd55c 100644 --- a/zitadel_client/models/beta_action_service_target_field_name.py +++ b/zitadel_client/models/beta_action_service_target_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaActionServiceTargetFieldName(str, Enum): @@ -23,22 +13,12 @@ class BetaActionServiceTargetFieldName(str, Enum): BetaActionServiceTargetFieldName """ - """ - allowed enum values - """ - TARGET_FIELD_NAME_UNSPECIFIED = 'TARGET_FIELD_NAME_UNSPECIFIED' - TARGET_FIELD_NAME_ID = 'TARGET_FIELD_NAME_ID' - TARGET_FIELD_NAME_CREATED_DATE = 'TARGET_FIELD_NAME_CREATED_DATE' - TARGET_FIELD_NAME_CHANGED_DATE = 'TARGET_FIELD_NAME_CHANGED_DATE' - TARGET_FIELD_NAME_NAME = 'TARGET_FIELD_NAME_NAME' - TARGET_FIELD_NAME_TARGET_TYPE = 'TARGET_FIELD_NAME_TARGET_TYPE' - TARGET_FIELD_NAME_URL = 'TARGET_FIELD_NAME_URL' - TARGET_FIELD_NAME_TIMEOUT = 'TARGET_FIELD_NAME_TIMEOUT' - TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = 'TARGET_FIELD_NAME_INTERRUPT_ON_ERROR' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaActionServiceTargetFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + TARGET_FIELD_NAME_UNSPECIFIED = "TARGET_FIELD_NAME_UNSPECIFIED" + TARGET_FIELD_NAME_ID = "TARGET_FIELD_NAME_ID" + TARGET_FIELD_NAME_CREATED_DATE = "TARGET_FIELD_NAME_CREATED_DATE" + TARGET_FIELD_NAME_CHANGED_DATE = "TARGET_FIELD_NAME_CHANGED_DATE" + TARGET_FIELD_NAME_NAME = "TARGET_FIELD_NAME_NAME" + TARGET_FIELD_NAME_TARGET_TYPE = "TARGET_FIELD_NAME_TARGET_TYPE" + TARGET_FIELD_NAME_URL = "TARGET_FIELD_NAME_URL" + TARGET_FIELD_NAME_TIMEOUT = "TARGET_FIELD_NAME_TIMEOUT" + TARGET_FIELD_NAME_INTERRUPT_ON_ERROR = "TARGET_FIELD_NAME_INTERRUPT_ON_ERROR" diff --git a/zitadel_client/models/beta_action_service_target_filter.py b/zitadel_client/models/beta_action_service_target_filter.py index 0072c5e8..837cf300 100644 --- a/zitadel_client/models/beta_action_service_target_filter.py +++ b/zitadel_client/models/beta_action_service_target_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceTargetFilter(BaseModel): """ BetaActionServiceTargetFilter - """ # noqa: E501 - target_id: Optional[StrictStr] = Field(default=None, description="Defines the id to query for.", alias="targetId") - __properties: ClassVar[List[str]] = ["targetId"] + """ + target_id: Optional[StrictStr] = Field( + default=None, alias="targetId", description="Defines the id to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaActionServiceTargetFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetId": obj.get("targetId") - }) - return _obj - - +BetaActionServiceTargetFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_target_name_filter.py b/zitadel_client/models/beta_action_service_target_name_filter.py index 353ddc5a..35dc1818 100644 --- a/zitadel_client/models/beta_action_service_target_name_filter.py +++ b/zitadel_client/models/beta_action_service_target_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_text_filter_method import BetaActionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceTargetNameFilter(BaseModel): """ BetaActionServiceTargetNameFilter - """ # noqa: E501 - target_name: Optional[StrictStr] = Field(default=None, description="Defines the name of the target to query for.", alias="targetName") - method: Optional[BetaActionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["targetName", "method"] + """ + + target_name: Optional[StrictStr] = Field( + default=None, + alias="targetName", + description="Defines the name of the target to query for.", + ) + method: Optional[BetaActionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaActionServiceTargetNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "targetName": obj.get("targetName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_action_service_text_filter_method import ( + BetaActionServiceTextFilterMethod, +) +BetaActionServiceTargetNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_target_search_filter.py b/zitadel_client/models/beta_action_service_target_search_filter.py index 5c2fff1b..66b29d66 100644 --- a/zitadel_client/models/beta_action_service_target_search_filter.py +++ b/zitadel_client/models/beta_action_service_target_search_filter.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_in_target_ids_filter import BetaActionServiceInTargetIDsFilter -from zitadel_client.models.beta_action_service_target_name_filter import BetaActionServiceTargetNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaActionServiceTargetSearchFilter(BaseModel): """ BetaActionServiceTargetSearchFilter - """ # noqa: E501 - in_target_ids_filter: Optional[BetaActionServiceInTargetIDsFilter] = Field(default=None, alias="inTargetIdsFilter") - target_name_filter: Optional[BetaActionServiceTargetNameFilter] = Field(default=None, alias="targetNameFilter") - __properties: ClassVar[List[str]] = ["inTargetIdsFilter", "targetNameFilter"] + """ + + in_target_ids_filter: Optional[BetaActionServiceInTargetIDsFilter] = Field( + default=None, alias="inTargetIdsFilter" + ) + target_name_filter: Optional[BetaActionServiceTargetNameFilter] = Field( + default=None, alias="targetNameFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class BetaActionServiceTargetSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of in_target_ids_filter - if self.in_target_ids_filter: - _dict['inTargetIdsFilter'] = self.in_target_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of target_name_filter - if self.target_name_filter: - _dict['targetNameFilter'] = self.target_name_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceTargetSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inTargetIdsFilter": BetaActionServiceInTargetIDsFilter.from_dict(obj["inTargetIdsFilter"]) if obj.get("inTargetIdsFilter") is not None else None, - "targetNameFilter": BetaActionServiceTargetNameFilter.from_dict(obj["targetNameFilter"]) if obj.get("targetNameFilter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_action_service_in_target_ids_filter import ( + BetaActionServiceInTargetIDsFilter, +) +from zitadel_client.models.beta_action_service_target_name_filter import ( + BetaActionServiceTargetNameFilter, +) +BetaActionServiceTargetSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_text_filter_method.py b/zitadel_client/models/beta_action_service_text_filter_method.py index c450a2e4..6157ee94 100644 --- a/zitadel_client/models/beta_action_service_text_filter_method.py +++ b/zitadel_client/models/beta_action_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaActionServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class BetaActionServiceTextFilterMethod(str, Enum): BetaActionServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaActionServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/beta_action_service_update_target_request.py b/zitadel_client/models/beta_action_service_update_target_request.py index 1505496d..2e18a28a 100644 --- a/zitadel_client/models/beta_action_service_update_target_request.py +++ b/zitadel_client/models/beta_action_service_update_target_request.py @@ -1,43 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_action_service_rest_call import BetaActionServiceRESTCall -from zitadel_client.models.beta_action_service_rest_webhook import BetaActionServiceRESTWebhook -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceUpdateTargetRequest(BaseModel): """ BetaActionServiceUpdateTargetRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - endpoint: Optional[StrictStr] = None - expiration_signing_key: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="expirationSigningKey") - rest_async: Optional[Dict[str, Any]] = Field(default=None, alias="restAsync") - rest_call: Optional[BetaActionServiceRESTCall] = Field(default=None, alias="restCall") - rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field(default=None, alias="restWebhook") - __properties: ClassVar[List[str]] = ["id", "name", "timeout", "endpoint", "expirationSigningKey", "restAsync", "restCall", "restWebhook"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + endpoint: Optional[StrictStr] = Field(default=None, alias="endpoint") + expiration_signing_key: Optional[ProtobufDuration] = Field( + default=None, + alias="expirationSigningKey", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + rest_async: Optional[object] = Field(default=None, alias="restAsync") + rest_call: Optional[BetaActionServiceRESTCall] = Field( + default=None, alias="restCall" + ) + rest_webhook: Optional[BetaActionServiceRESTWebhook] = Field( + default=None, alias="restWebhook" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,75 +49,12 @@ class BetaActionServiceUpdateTargetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceUpdateTargetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of rest_call - if self.rest_call: - _dict['restCall'] = self.rest_call.to_dict() - # override the default output from pydantic by calling `to_dict()` of rest_webhook - if self.rest_webhook: - _dict['restWebhook'] = self.rest_webhook.to_dict() - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if endpoint (nullable) is None - # and model_fields_set contains the field - if self.endpoint is None and "endpoint" in self.model_fields_set: - _dict['endpoint'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceUpdateTargetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "timeout": obj.get("timeout"), - "endpoint": obj.get("endpoint"), - "expirationSigningKey": obj.get("expirationSigningKey"), - "restAsync": obj.get("restAsync"), - "restCall": BetaActionServiceRESTCall.from_dict(obj["restCall"]) if obj.get("restCall") is not None else None, - "restWebhook": BetaActionServiceRESTWebhook.from_dict(obj["restWebhook"]) if obj.get("restWebhook") is not None else None - }) - return _obj - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_action_service_rest_call import ( + BetaActionServiceRESTCall, +) +from zitadel_client.models.beta_action_service_rest_webhook import ( + BetaActionServiceRESTWebhook, +) +BetaActionServiceUpdateTargetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_action_service_update_target_response.py b/zitadel_client/models/beta_action_service_update_target_response.py index cad9ad1b..11889081 100644 --- a/zitadel_client/models/beta_action_service_update_target_response.py +++ b/zitadel_client/models/beta_action_service_update_target_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaActionServiceUpdateTargetResponse(BaseModel): """ BetaActionServiceUpdateTargetResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - signing_key: Optional[StrictStr] = Field(default=None, description="Key used to sign and check payload sent to the target.", alias="signingKey") - __properties: ClassVar[List[str]] = ["changeDate", "signingKey"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + signing_key: Optional[StrictStr] = Field( + default=None, + alias="signingKey", + description="Key used to sign and check payload sent to the target.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,58 +39,6 @@ class BetaActionServiceUpdateTargetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaActionServiceUpdateTargetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if signing_key (nullable) is None - # and model_fields_set contains the field - if self.signing_key is None and "signing_key" in self.model_fields_set: - _dict['signingKey'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaActionServiceUpdateTargetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate"), - "signingKey": obj.get("signingKey") - }) - return _obj - +from pydantic import AwareDatetime +BetaActionServiceUpdateTargetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_any.py b/zitadel_client/models/beta_app_service_any.py index 7f4d6952..4d4b1b02 100644 --- a/zitadel_client/models/beta_app_service_any.py +++ b/zitadel_client/models/beta_app_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaAppServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaAppServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_api_auth_method_type.py b/zitadel_client/models/beta_app_service_api_auth_method_type.py index 626d49c1..cebe15b6 100644 --- a/zitadel_client/models/beta_app_service_api_auth_method_type.py +++ b/zitadel_client/models/beta_app_service_api_auth_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceAPIAuthMethodType(str, Enum): @@ -23,15 +13,5 @@ class BetaAppServiceAPIAuthMethodType(str, Enum): BetaAppServiceAPIAuthMethodType """ - """ - allowed enum values - """ - API_AUTH_METHOD_TYPE_BASIC = 'API_AUTH_METHOD_TYPE_BASIC' - API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceAPIAuthMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + API_AUTH_METHOD_TYPE_BASIC = "API_AUTH_METHOD_TYPE_BASIC" + API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT" diff --git a/zitadel_client/models/beta_app_service_api_config.py b/zitadel_client/models/beta_app_service_api_config.py index 3ba5ac77..60b19e39 100644 --- a/zitadel_client/models/beta_app_service_api_config.py +++ b/zitadel_client/models/beta_app_service_api_config.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_api_auth_method_type import BetaAppServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceAPIConfig(BaseModel): """ BetaAppServiceAPIConfig - """ # noqa: E501 + """ + client_id: Optional[StrictStr] = Field(default=None, alias="clientId") - auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["clientId", "authMethodType"] + auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaAppServiceAPIConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceAPIConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceAPIConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.beta_app_service_api_auth_method_type import ( + BetaAppServiceAPIAuthMethodType, +) +BetaAppServiceAPIConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_app_sorting.py b/zitadel_client/models/beta_app_service_app_sorting.py index 71ae158c..6583113e 100644 --- a/zitadel_client/models/beta_app_service_app_sorting.py +++ b/zitadel_client/models/beta_app_service_app_sorting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceAppSorting(str, Enum): @@ -23,18 +13,8 @@ class BetaAppServiceAppSorting(str, Enum): BetaAppServiceAppSorting """ - """ - allowed enum values - """ - APP_SORT_BY_ID = 'APP_SORT_BY_ID' - APP_SORT_BY_NAME = 'APP_SORT_BY_NAME' - APP_SORT_BY_STATE = 'APP_SORT_BY_STATE' - APP_SORT_BY_CREATION_DATE = 'APP_SORT_BY_CREATION_DATE' - APP_SORT_BY_CHANGE_DATE = 'APP_SORT_BY_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceAppSorting from a JSON string""" - return cls(json.loads(json_str)) - - + APP_SORT_BY_ID = "APP_SORT_BY_ID" + APP_SORT_BY_NAME = "APP_SORT_BY_NAME" + APP_SORT_BY_STATE = "APP_SORT_BY_STATE" + APP_SORT_BY_CREATION_DATE = "APP_SORT_BY_CREATION_DATE" + APP_SORT_BY_CHANGE_DATE = "APP_SORT_BY_CHANGE_DATE" diff --git a/zitadel_client/models/beta_app_service_app_state.py b/zitadel_client/models/beta_app_service_app_state.py index 9b51a9dd..30de42d9 100644 --- a/zitadel_client/models/beta_app_service_app_state.py +++ b/zitadel_client/models/beta_app_service_app_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceAppState(str, Enum): @@ -23,17 +13,7 @@ class BetaAppServiceAppState(str, Enum): BetaAppServiceAppState """ - """ - allowed enum values - """ - APP_STATE_UNSPECIFIED = 'APP_STATE_UNSPECIFIED' - APP_STATE_ACTIVE = 'APP_STATE_ACTIVE' - APP_STATE_INACTIVE = 'APP_STATE_INACTIVE' - APP_STATE_REMOVED = 'APP_STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceAppState from a JSON string""" - return cls(json.loads(json_str)) - - + APP_STATE_UNSPECIFIED = "APP_STATE_UNSPECIFIED" + APP_STATE_ACTIVE = "APP_STATE_ACTIVE" + APP_STATE_INACTIVE = "APP_STATE_INACTIVE" + APP_STATE_REMOVED = "APP_STATE_REMOVED" diff --git a/zitadel_client/models/beta_app_service_application.py b/zitadel_client/models/beta_app_service_application.py index 5e9b44fc..0bab5ac7 100644 --- a/zitadel_client/models/beta_app_service_application.py +++ b/zitadel_client/models/beta_app_service_application.py @@ -1,46 +1,49 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_api_config import BetaAppServiceAPIConfig -from zitadel_client.models.beta_app_service_app_state import BetaAppServiceAppState -from zitadel_client.models.beta_app_service_oidc_config import BetaAppServiceOIDCConfig -from zitadel_client.models.beta_app_service_saml_config import BetaAppServiceSAMLConfig -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceApplication(BaseModel): """ BetaAppServiceApplication - """ # noqa: E501 - id: Optional[StrictStr] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - state: Optional[BetaAppServiceAppState] = None - name: Optional[StrictStr] = None - api_config: Optional[BetaAppServiceAPIConfig] = Field(default=None, alias="apiConfig") - oidc_config: Optional[BetaAppServiceOIDCConfig] = Field(default=None, alias="oidcConfig") - saml_config: Optional[BetaAppServiceSAMLConfig] = Field(default=None, alias="samlConfig") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "state", "name", "apiConfig", "oidcConfig", "samlConfig"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[BetaAppServiceAppState] = Field(default=None, alias="state") + name: Optional[StrictStr] = Field(default=None, alias="name") + api_config: Optional[BetaAppServiceAPIConfig] = Field( + default=None, alias="apiConfig" + ) + oidc_config: Optional[BetaAppServiceOIDCConfig] = Field( + default=None, alias="oidcConfig" + ) + saml_config: Optional[BetaAppServiceSAMLConfig] = Field( + default=None, alias="samlConfig" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,68 +51,10 @@ class BetaAppServiceApplication(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceApplication from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_config - if self.api_config: - _dict['apiConfig'] = self.api_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_config - if self.oidc_config: - _dict['oidcConfig'] = self.oidc_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_config - if self.saml_config: - _dict['samlConfig'] = self.saml_config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceApplication from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "state": obj.get("state"), - "name": obj.get("name"), - "apiConfig": BetaAppServiceAPIConfig.from_dict(obj["apiConfig"]) if obj.get("apiConfig") is not None else None, - "oidcConfig": BetaAppServiceOIDCConfig.from_dict(obj["oidcConfig"]) if obj.get("oidcConfig") is not None else None, - "samlConfig": BetaAppServiceSAMLConfig.from_dict(obj["samlConfig"]) if obj.get("samlConfig") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_app_service_api_config import BetaAppServiceAPIConfig +from zitadel_client.models.beta_app_service_app_state import BetaAppServiceAppState +from zitadel_client.models.beta_app_service_oidc_config import BetaAppServiceOIDCConfig +from zitadel_client.models.beta_app_service_saml_config import BetaAppServiceSAMLConfig +BetaAppServiceApplication.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_application_key.py b/zitadel_client/models/beta_app_service_application_key.py index 7ff89b73..be7b0b9b 100644 --- a/zitadel_client/models/beta_app_service_application_key.py +++ b/zitadel_client/models/beta_app_service_application_key.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceApplicationKey(BaseModel): """ BetaAppServiceApplicationKey - """ # noqa: E501 - id: Optional[StrictStr] = None + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") application_id: Optional[StrictStr] = Field(default=None, alias="applicationId") project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["id", "applicationId", "projectId", "creationDate", "organizationId", "expirationDate"] + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +43,6 @@ class BetaAppServiceApplicationKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "applicationId": obj.get("applicationId"), - "projectId": obj.get("projectId"), - "creationDate": obj.get("creationDate"), - "organizationId": obj.get("organizationId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceApplicationKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_application_keys_sorting.py b/zitadel_client/models/beta_app_service_application_keys_sorting.py index ba3cf6e1..b41041d5 100644 --- a/zitadel_client/models/beta_app_service_application_keys_sorting.py +++ b/zitadel_client/models/beta_app_service_application_keys_sorting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceApplicationKeysSorting(str, Enum): @@ -23,20 +13,12 @@ class BetaAppServiceApplicationKeysSorting(str, Enum): BetaAppServiceApplicationKeysSorting """ - """ - allowed enum values - """ - APPLICATION_KEYS_SORT_BY_ID = 'APPLICATION_KEYS_SORT_BY_ID' - APPLICATION_KEYS_SORT_BY_PROJECT_ID = 'APPLICATION_KEYS_SORT_BY_PROJECT_ID' - APPLICATION_KEYS_SORT_BY_APPLICATION_ID = 'APPLICATION_KEYS_SORT_BY_APPLICATION_ID' - APPLICATION_KEYS_SORT_BY_CREATION_DATE = 'APPLICATION_KEYS_SORT_BY_CREATION_DATE' - APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = 'APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID' - APPLICATION_KEYS_SORT_BY_EXPIRATION = 'APPLICATION_KEYS_SORT_BY_EXPIRATION' - APPLICATION_KEYS_SORT_BY_TYPE = 'APPLICATION_KEYS_SORT_BY_TYPE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceApplicationKeysSorting from a JSON string""" - return cls(json.loads(json_str)) - - + APPLICATION_KEYS_SORT_BY_ID = "APPLICATION_KEYS_SORT_BY_ID" + APPLICATION_KEYS_SORT_BY_PROJECT_ID = "APPLICATION_KEYS_SORT_BY_PROJECT_ID" + APPLICATION_KEYS_SORT_BY_APPLICATION_ID = "APPLICATION_KEYS_SORT_BY_APPLICATION_ID" + APPLICATION_KEYS_SORT_BY_CREATION_DATE = "APPLICATION_KEYS_SORT_BY_CREATION_DATE" + APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID = ( + "APPLICATION_KEYS_SORT_BY_ORGANIZATION_ID" + ) + APPLICATION_KEYS_SORT_BY_EXPIRATION = "APPLICATION_KEYS_SORT_BY_EXPIRATION" + APPLICATION_KEYS_SORT_BY_TYPE = "APPLICATION_KEYS_SORT_BY_TYPE" diff --git a/zitadel_client/models/beta_app_service_application_name_query.py b/zitadel_client/models/beta_app_service_application_name_query.py index 2b7fffda..66746f3c 100644 --- a/zitadel_client/models/beta_app_service_application_name_query.py +++ b/zitadel_client/models/beta_app_service_application_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_text_filter_method import BetaAppServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceApplicationNameQuery(BaseModel): """ BetaAppServiceApplicationNameQuery - """ # noqa: E501 - name: Optional[StrictStr] = None - method: Optional[BetaAppServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + name: Optional[StrictStr] = Field(default=None, alias="name") + method: Optional[BetaAppServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaAppServiceApplicationNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_app_service_text_filter_method import ( + BetaAppServiceTextFilterMethod, +) +BetaAppServiceApplicationNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_application_search_filter.py b/zitadel_client/models/beta_app_service_application_search_filter.py index 5d29c499..61a4470d 100644 --- a/zitadel_client/models/beta_app_service_application_search_filter.py +++ b/zitadel_client/models/beta_app_service_application_search_filter.py @@ -1,40 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_app_state import BetaAppServiceAppState -from zitadel_client.models.beta_app_service_application_name_query import BetaAppServiceApplicationNameQuery -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaAppServiceApplicationSearchFilter(BaseModel): """ BetaAppServiceApplicationSearchFilter - """ # noqa: E501 + """ + api_app_only: Optional[StrictBool] = Field(default=None, alias="apiAppOnly") - name_filter: Optional[BetaAppServiceApplicationNameQuery] = Field(default=None, alias="nameFilter") + name_filter: Optional[BetaAppServiceApplicationNameQuery] = Field( + default=None, alias="nameFilter" + ) oidc_app_only: Optional[StrictBool] = Field(default=None, alias="oidcAppOnly") saml_app_only: Optional[StrictBool] = Field(default=None, alias="samlAppOnly") - state_filter: Optional[BetaAppServiceAppState] = Field(default=None, alias="stateFilter") - __properties: ClassVar[List[str]] = ["apiAppOnly", "nameFilter", "oidcAppOnly", "samlAppOnly", "stateFilter"] + state_filter: Optional[BetaAppServiceAppState] = Field( + default=None, alias="stateFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,59 +38,9 @@ class BetaAppServiceApplicationSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of name_filter - if self.name_filter: - _dict['nameFilter'] = self.name_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceApplicationSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "apiAppOnly": obj.get("apiAppOnly"), - "nameFilter": BetaAppServiceApplicationNameQuery.from_dict(obj["nameFilter"]) if obj.get("nameFilter") is not None else None, - "oidcAppOnly": obj.get("oidcAppOnly"), - "samlAppOnly": obj.get("samlAppOnly"), - "stateFilter": obj.get("stateFilter") - }) - return _obj - +from zitadel_client.models.beta_app_service_app_state import BetaAppServiceAppState +from zitadel_client.models.beta_app_service_application_name_query import ( + BetaAppServiceApplicationNameQuery, +) +BetaAppServiceApplicationSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_connect_error.py b/zitadel_client/models/beta_app_service_connect_error.py index 5082adaf..1d2b61df 100644 --- a/zitadel_client/models/beta_app_service_connect_error.py +++ b/zitadel_client/models/beta_app_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_any import BetaAppServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaAppServiceConnectErrorCodeEnum(str, Enum): + """BetaAppServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaAppServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaAppServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaAppServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaAppServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaAppServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_app_service_any import BetaAppServiceAny +BetaAppServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_api_application_request.py b/zitadel_client/models/beta_app_service_create_api_application_request.py index a4571277..63e19f24 100644 --- a/zitadel_client/models/beta_app_service_create_api_application_request.py +++ b/zitadel_client/models/beta_app_service_create_api_application_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_api_auth_method_type import BetaAppServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceCreateAPIApplicationRequest(BaseModel): """ BetaAppServiceCreateAPIApplicationRequest - """ # noqa: E501 - auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["authMethodType"] + """ + auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class BetaAppServiceCreateAPIApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateAPIApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateAPIApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.beta_app_service_api_auth_method_type import ( + BetaAppServiceAPIAuthMethodType, +) +BetaAppServiceCreateAPIApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_api_application_response.py b/zitadel_client/models/beta_app_service_create_api_application_response.py index 51288dd7..48f9da88 100644 --- a/zitadel_client/models/beta_app_service_create_api_application_response.py +++ b/zitadel_client/models/beta_app_service_create_api_application_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateAPIApplicationResponse(BaseModel): """ BetaAppServiceCreateAPIApplicationResponse - """ # noqa: E501 + """ + client_id: Optional[StrictStr] = Field(default=None, alias="clientId") client_secret: Optional[StrictStr] = Field(default=None, alias="clientSecret") - __properties: ClassVar[List[str]] = ["clientId", "clientSecret"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaAppServiceCreateAPIApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateAPIApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateAPIApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "clientSecret": obj.get("clientSecret") - }) - return _obj - - +BetaAppServiceCreateAPIApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_application_key_request.py b/zitadel_client/models/beta_app_service_create_application_key_request.py index af6a4b4d..224f00ae 100644 --- a/zitadel_client/models/beta_app_service_create_application_key_request.py +++ b/zitadel_client/models/beta_app_service_create_application_key_request.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateApplicationKeyRequest(BaseModel): """ BetaAppServiceCreateApplicationKeyRequest - """ # noqa: E501 + """ + app_id: Optional[StrictStr] = Field(default=None, alias="appId") project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["appId", "projectId", "expirationDate"] + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +36,6 @@ class BetaAppServiceCreateApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "appId": obj.get("appId"), - "projectId": obj.get("projectId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceCreateApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_application_key_response.py b/zitadel_client/models/beta_app_service_create_application_key_response.py index 40d7be42..b72c1aa5 100644 --- a/zitadel_client/models/beta_app_service_create_application_key_response.py +++ b/zitadel_client/models/beta_app_service_create_application_key_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateApplicationKeyResponse(BaseModel): """ BetaAppServiceCreateApplicationKeyResponse - """ # noqa: E501 - id: Optional[StrictStr] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - key_details: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="keyDetails") - __properties: ClassVar[List[str]] = ["id", "creationDate", "keyDetails"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + key_details: Optional[Base64Bytes] = Field(default=None, alias="keyDetails") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +36,7 @@ class BetaAppServiceCreateApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "keyDetails": obj.get("keyDetails") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +BetaAppServiceCreateApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_application_request.py b/zitadel_client/models/beta_app_service_create_application_request.py index 51eede78..f550dc8e 100644 --- a/zitadel_client/models/beta_app_service_create_application_request.py +++ b/zitadel_client/models/beta_app_service_create_application_request.py @@ -1,42 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_create_api_application_request import BetaAppServiceCreateAPIApplicationRequest -from zitadel_client.models.beta_app_service_create_oidc_application_request import BetaAppServiceCreateOIDCApplicationRequest -from zitadel_client.models.beta_app_service_create_saml_application_request import BetaAppServiceCreateSAMLApplicationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateApplicationRequest(BaseModel): """ BetaAppServiceCreateApplicationRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - api_request: Optional[BetaAppServiceCreateAPIApplicationRequest] = Field(default=None, alias="apiRequest") - oidc_request: Optional[BetaAppServiceCreateOIDCApplicationRequest] = Field(default=None, alias="oidcRequest") - saml_request: Optional[BetaAppServiceCreateSAMLApplicationRequest] = Field(default=None, alias="samlRequest") - __properties: ClassVar[List[str]] = ["projectId", "id", "name", "apiRequest", "oidcRequest", "samlRequest"] + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + api_request: Optional[BetaAppServiceCreateAPIApplicationRequest] = Field( + default=None, alias="apiRequest" + ) + oidc_request: Optional[BetaAppServiceCreateOIDCApplicationRequest] = Field( + default=None, alias="oidcRequest" + ) + saml_request: Optional[BetaAppServiceCreateSAMLApplicationRequest] = Field( + default=None, alias="samlRequest" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,66 +41,14 @@ class BetaAppServiceCreateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_request - if self.api_request: - _dict['apiRequest'] = self.api_request.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_request - if self.oidc_request: - _dict['oidcRequest'] = self.oidc_request.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_request - if self.saml_request: - _dict['samlRequest'] = self.saml_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "id": obj.get("id"), - "name": obj.get("name"), - "apiRequest": BetaAppServiceCreateAPIApplicationRequest.from_dict(obj["apiRequest"]) if obj.get("apiRequest") is not None else None, - "oidcRequest": BetaAppServiceCreateOIDCApplicationRequest.from_dict(obj["oidcRequest"]) if obj.get("oidcRequest") is not None else None, - "samlRequest": BetaAppServiceCreateSAMLApplicationRequest.from_dict(obj["samlRequest"]) if obj.get("samlRequest") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_create_api_application_request import ( + BetaAppServiceCreateAPIApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_oidc_application_request import ( + BetaAppServiceCreateOIDCApplicationRequest, +) +from zitadel_client.models.beta_app_service_create_saml_application_request import ( + BetaAppServiceCreateSAMLApplicationRequest, +) +BetaAppServiceCreateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_application_response.py b/zitadel_client/models/beta_app_service_create_application_response.py index a0386adc..4901cb2d 100644 --- a/zitadel_client/models/beta_app_service_create_application_response.py +++ b/zitadel_client/models/beta_app_service_create_application_response.py @@ -1,41 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_create_api_application_response import BetaAppServiceCreateAPIApplicationResponse -from zitadel_client.models.beta_app_service_create_oidc_application_response import BetaAppServiceCreateOIDCApplicationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateApplicationResponse(BaseModel): """ BetaAppServiceCreateApplicationResponse - """ # noqa: E501 + """ + app_id: Optional[StrictStr] = Field(default=None, alias="appId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - api_response: Optional[BetaAppServiceCreateAPIApplicationResponse] = Field(default=None, alias="apiResponse") - oidc_response: Optional[BetaAppServiceCreateOIDCApplicationResponse] = Field(default=None, alias="oidcResponse") - saml_response: Optional[Dict[str, Any]] = Field(default=None, alias="samlResponse") - __properties: ClassVar[List[str]] = ["appId", "creationDate", "apiResponse", "oidcResponse", "samlResponse"] + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + api_response: Optional[BetaAppServiceCreateAPIApplicationResponse] = Field( + default=None, alias="apiResponse" + ) + oidc_response: Optional[BetaAppServiceCreateOIDCApplicationResponse] = Field( + default=None, alias="oidcResponse" + ) + saml_response: Optional[object] = Field(default=None, alias="samlResponse") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,62 +42,12 @@ class BetaAppServiceCreateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_response - if self.api_response: - _dict['apiResponse'] = self.api_response.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_response - if self.oidc_response: - _dict['oidcResponse'] = self.oidc_response.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "appId": obj.get("appId"), - "creationDate": obj.get("creationDate"), - "apiResponse": BetaAppServiceCreateAPIApplicationResponse.from_dict(obj["apiResponse"]) if obj.get("apiResponse") is not None else None, - "oidcResponse": BetaAppServiceCreateOIDCApplicationResponse.from_dict(obj["oidcResponse"]) if obj.get("oidcResponse") is not None else None, - "samlResponse": obj.get("samlResponse") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_app_service_create_api_application_response import ( + BetaAppServiceCreateAPIApplicationResponse, +) +from zitadel_client.models.beta_app_service_create_oidc_application_response import ( + BetaAppServiceCreateOIDCApplicationResponse, +) +BetaAppServiceCreateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_oidc_application_request.py b/zitadel_client/models/beta_app_service_create_oidc_application_request.py index a28d10d7..cd3fa174 100644 --- a/zitadel_client/models/beta_app_service_create_oidc_application_request.py +++ b/zitadel_client/models/beta_app_service_create_oidc_application_request.py @@ -1,57 +1,78 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from zitadel_client.models.beta_app_service_oidc_app_type import BetaAppServiceOIDCAppType -from zitadel_client.models.beta_app_service_oidc_auth_method_type import BetaAppServiceOIDCAuthMethodType -from zitadel_client.models.beta_app_service_oidc_grant_type import BetaAppServiceOIDCGrantType -from zitadel_client.models.beta_app_service_oidc_response_type import BetaAppServiceOIDCResponseType -from zitadel_client.models.beta_app_service_oidc_token_type import BetaAppServiceOIDCTokenType -from zitadel_client.models.beta_app_service_oidc_version import BetaAppServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaAppServiceCreateOIDCApplicationRequest(BaseModel): """ BetaAppServiceCreateOIDCApplicationRequest - """ # noqa: E501 - redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Callback URI of the authorization request where the code or tokens will be sent to", alias="redirectUris") - response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field(default=None, alias="responseTypes") - grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field(default=None, alias="grantTypes") + """ + + redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="redirectUris", + description="Callback URI of the authorization request where the code or tokens will be sent to", + ) + response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field( + default=None, alias="responseTypes" + ) + grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field( + default=None, alias="grantTypes" + ) app_type: Optional[BetaAppServiceOIDCAppType] = Field(default=None, alias="appType") - auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="ZITADEL will redirect to this link after a successful logout", alias="postLogoutRedirectUris") - version: Optional[BetaAppServiceOIDCVersion] = None + auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, + alias="postLogoutRedirectUris", + description="ZITADEL will redirect to this link after a successful logout", + ) + version: Optional[BetaAppServiceOIDCVersion] = Field(default=None, alias="version") dev_mode: Optional[StrictBool] = Field(default=None, alias="devMode") - access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, alias="additionalOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, alias="backChannelLogoutUri") - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "appType", "authMethodType", "postLogoutRedirectUris", "version", "devMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="accessTokenRoleAssertion" + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenRoleAssertion" + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenUserinfoAssertion" + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, alias="additionalOrigins" + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, alias="skipNativeAppSuccessPage" + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, alias="backChannelLogoutUri" + ) + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -59,71 +80,27 @@ class BetaAppServiceCreateOIDCApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateOIDCApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateOIDCApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "appType": obj.get("appType"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "devMode": obj.get("devMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +from zitadel_client.models.beta_app_service_oidc_app_type import ( + BetaAppServiceOIDCAppType, +) +from zitadel_client.models.beta_app_service_oidc_auth_method_type import ( + BetaAppServiceOIDCAuthMethodType, +) +from zitadel_client.models.beta_app_service_oidc_grant_type import ( + BetaAppServiceOIDCGrantType, +) +from zitadel_client.models.beta_app_service_oidc_response_type import ( + BetaAppServiceOIDCResponseType, +) +from zitadel_client.models.beta_app_service_oidc_token_type import ( + BetaAppServiceOIDCTokenType, +) +from zitadel_client.models.beta_app_service_oidc_version import ( + BetaAppServiceOIDCVersion, +) + +BetaAppServiceCreateOIDCApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_oidc_application_response.py b/zitadel_client/models/beta_app_service_create_oidc_application_response.py index 14eb3fff..475ebaf5 100644 --- a/zitadel_client/models/beta_app_service_create_oidc_application_response.py +++ b/zitadel_client/models/beta_app_service_create_oidc_application_response.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_oidc_localized_message import BetaAppServiceOIDCLocalizedMessage -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaAppServiceCreateOIDCApplicationResponse(BaseModel): """ BetaAppServiceCreateOIDCApplicationResponse - """ # noqa: E501 + """ + client_id: Optional[StrictStr] = Field(default=None, alias="clientId") client_secret: Optional[StrictStr] = Field(default=None, alias="clientSecret") none_compliant: Optional[StrictBool] = Field(default=None, alias="noneCompliant") - compliance_problems: Optional[List[BetaAppServiceOIDCLocalizedMessage]] = Field(default=None, alias="complianceProblems") - __properties: ClassVar[List[str]] = ["clientId", "clientSecret", "noneCompliant", "complianceProblems"] + compliance_problems: Optional[List[BetaAppServiceOIDCLocalizedMessage]] = Field( + default=None, alias="complianceProblems" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,62 +35,8 @@ class BetaAppServiceCreateOIDCApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateOIDCApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in compliance_problems (list) - _items = [] - if self.compliance_problems: - for _item_compliance_problems in self.compliance_problems: - if _item_compliance_problems: - _items.append(_item_compliance_problems.to_dict()) - _dict['complianceProblems'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateOIDCApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "clientSecret": obj.get("clientSecret"), - "noneCompliant": obj.get("noneCompliant"), - "complianceProblems": [BetaAppServiceOIDCLocalizedMessage.from_dict(_item) for _item in obj["complianceProblems"]] if obj.get("complianceProblems") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_oidc_localized_message import ( + BetaAppServiceOIDCLocalizedMessage, +) +BetaAppServiceCreateOIDCApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_create_saml_application_request.py b/zitadel_client/models/beta_app_service_create_saml_application_request.py index d5ce77cf..8556c835 100644 --- a/zitadel_client/models/beta_app_service_create_saml_application_request.py +++ b/zitadel_client/models/beta_app_service_create_saml_application_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceCreateSAMLApplicationRequest(BaseModel): """ BetaAppServiceCreateSAMLApplicationRequest - """ # noqa: E501 - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") + """ + + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) metadata_url: Optional[StrictStr] = Field(default=None, alias="metadataUrl") - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="metadataXml") - __properties: ClassVar[List[str]] = ["loginVersion", "metadataUrl", "metadataXml"] + metadata_xml: Optional[Base64Bytes] = Field(default=None, alias="metadataXml") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,9 @@ class BetaAppServiceCreateSAMLApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateSAMLApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceCreateSAMLApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None, - "metadataUrl": obj.get("metadataUrl"), - "metadataXml": obj.get("metadataXml") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +BetaAppServiceCreateSAMLApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_deactivate_application_request.py b/zitadel_client/models/beta_app_service_deactivate_application_request.py index e6fabd97..9cb2980f 100644 --- a/zitadel_client/models/beta_app_service_deactivate_application_request.py +++ b/zitadel_client/models/beta_app_service_deactivate_application_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceDeactivateApplicationRequest(BaseModel): """ BetaAppServiceDeactivateApplicationRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["projectId", "id"] + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaAppServiceDeactivateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeactivateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeactivateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "id": obj.get("id") - }) - return _obj - - +BetaAppServiceDeactivateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_deactivate_application_response.py b/zitadel_client/models/beta_app_service_deactivate_application_response.py index 3836cf5b..7def3993 100644 --- a/zitadel_client/models/beta_app_service_deactivate_application_response.py +++ b/zitadel_client/models/beta_app_service_deactivate_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceDeactivateApplicationResponse(BaseModel): """ BetaAppServiceDeactivateApplicationResponse - """ # noqa: E501 - deactivation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deactivationDate") - __properties: ClassVar[List[str]] = ["deactivationDate"] + """ + deactivation_date: Optional[AwareDatetime] = Field( + default=None, + alias="deactivationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAppServiceDeactivateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeactivateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeactivateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deactivationDate": obj.get("deactivationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceDeactivateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_delete_application_key_request.py b/zitadel_client/models/beta_app_service_delete_application_key_request.py index f48b8db6..6ec5cf1e 100644 --- a/zitadel_client/models/beta_app_service_delete_application_key_request.py +++ b/zitadel_client/models/beta_app_service_delete_application_key_request.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceDeleteApplicationKeyRequest(BaseModel): """ BetaAppServiceDeleteApplicationKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = None + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") project_id: Optional[StrictStr] = Field(default=None, alias="projectId") application_id: Optional[StrictStr] = Field(default=None, alias="applicationId") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "projectId", "applicationId", "organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class BetaAppServiceDeleteApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "projectId": obj.get("projectId"), - "applicationId": obj.get("applicationId"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaAppServiceDeleteApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_delete_application_key_response.py b/zitadel_client/models/beta_app_service_delete_application_key_response.py index ad56f797..a7fabca8 100644 --- a/zitadel_client/models/beta_app_service_delete_application_key_response.py +++ b/zitadel_client/models/beta_app_service_delete_application_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceDeleteApplicationKeyResponse(BaseModel): """ BetaAppServiceDeleteApplicationKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAppServiceDeleteApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceDeleteApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_delete_application_request.py b/zitadel_client/models/beta_app_service_delete_application_request.py index 1c785a6b..b5d295aa 100644 --- a/zitadel_client/models/beta_app_service_delete_application_request.py +++ b/zitadel_client/models/beta_app_service_delete_application_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceDeleteApplicationRequest(BaseModel): """ BetaAppServiceDeleteApplicationRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["projectId", "id"] + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaAppServiceDeleteApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "id": obj.get("id") - }) - return _obj - - +BetaAppServiceDeleteApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_delete_application_response.py b/zitadel_client/models/beta_app_service_delete_application_response.py index 1d5d09b1..5213bd2d 100644 --- a/zitadel_client/models/beta_app_service_delete_application_response.py +++ b/zitadel_client/models/beta_app_service_delete_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceDeleteApplicationResponse(BaseModel): """ BetaAppServiceDeleteApplicationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAppServiceDeleteApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceDeleteApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceDeleteApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_get_application_key_request.py b/zitadel_client/models/beta_app_service_get_application_key_request.py index 858dc74c..f3f90e89 100644 --- a/zitadel_client/models/beta_app_service_get_application_key_request.py +++ b/zitadel_client/models/beta_app_service_get_application_key_request.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceGetApplicationKeyRequest(BaseModel): """ BetaAppServiceGetApplicationKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = None + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") project_id: Optional[StrictStr] = Field(default=None, alias="projectId") application_id: Optional[StrictStr] = Field(default=None, alias="applicationId") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "projectId", "applicationId", "organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class BetaAppServiceGetApplicationKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "projectId": obj.get("projectId"), - "applicationId": obj.get("applicationId"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaAppServiceGetApplicationKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_get_application_key_response.py b/zitadel_client/models/beta_app_service_get_application_key_response.py index 8312b53f..371b928f 100644 --- a/zitadel_client/models/beta_app_service_get_application_key_response.py +++ b/zitadel_client/models/beta_app_service_get_application_key_response.py @@ -1,37 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceGetApplicationKeyResponse(BaseModel): """ BetaAppServiceGetApplicationKeyResponse - """ # noqa: E501 - id: Optional[StrictStr] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate", "expirationDate"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +40,6 @@ class BetaAppServiceGetApplicationKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceGetApplicationKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_get_application_request.py b/zitadel_client/models/beta_app_service_get_application_request.py index 8df61f14..12ec49e4 100644 --- a/zitadel_client/models/beta_app_service_get_application_request.py +++ b/zitadel_client/models/beta_app_service_get_application_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceGetApplicationRequest(BaseModel): """ BetaAppServiceGetApplicationRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaAppServiceGetApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaAppServiceGetApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_get_application_response.py b/zitadel_client/models/beta_app_service_get_application_response.py index f29c5bf8..fa6c5e7b 100644 --- a/zitadel_client/models/beta_app_service_get_application_response.py +++ b/zitadel_client/models/beta_app_service_get_application_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_application import BetaAppServiceApplication -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaAppServiceGetApplicationResponse(BaseModel): """ BetaAppServiceGetApplicationResponse - """ # noqa: E501 - app: Optional[BetaAppServiceApplication] = None - __properties: ClassVar[List[str]] = ["app"] + """ + app: Optional[BetaAppServiceApplication] = Field(default=None, alias="app") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaAppServiceGetApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of app - if self.app: - _dict['app'] = self.app.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceGetApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "app": BetaAppServiceApplication.from_dict(obj["app"]) if obj.get("app") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_application import BetaAppServiceApplication +BetaAppServiceGetApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_list_application_keys_request.py b/zitadel_client/models/beta_app_service_list_application_keys_request.py index bed1a386..25112c70 100644 --- a/zitadel_client/models/beta_app_service_list_application_keys_request.py +++ b/zitadel_client/models/beta_app_service_list_application_keys_request.py @@ -1,40 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_application_keys_sorting import BetaAppServiceApplicationKeysSorting -from zitadel_client.models.beta_app_service_pagination_request import BetaAppServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceListApplicationKeysRequest(BaseModel): """ BetaAppServiceListApplicationKeysRequest - """ # noqa: E501 - pagination: Optional[BetaAppServicePaginationRequest] = None - sorting_column: Optional[BetaAppServiceApplicationKeysSorting] = Field(default=None, alias="sortingColumn") + """ + + pagination: Optional[BetaAppServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaAppServiceApplicationKeysSorting] = Field( + default=None, alias="sortingColumn" + ) application_id: Optional[StrictStr] = Field(default=None, alias="applicationId") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "applicationId", "organizationId", "projectId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,59 +38,11 @@ class BetaAppServiceListApplicationKeysRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationKeysRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationKeysRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaAppServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "applicationId": obj.get("applicationId"), - "organizationId": obj.get("organizationId"), - "projectId": obj.get("projectId") - }) - return _obj - +from zitadel_client.models.beta_app_service_application_keys_sorting import ( + BetaAppServiceApplicationKeysSorting, +) +from zitadel_client.models.beta_app_service_pagination_request import ( + BetaAppServicePaginationRequest, +) +BetaAppServiceListApplicationKeysRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_list_application_keys_response.py b/zitadel_client/models/beta_app_service_list_application_keys_response.py index c27a1252..2f97e586 100644 --- a/zitadel_client/models/beta_app_service_list_application_keys_response.py +++ b/zitadel_client/models/beta_app_service_list_application_keys_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_application_key import BetaAppServiceApplicationKey -from zitadel_client.models.beta_app_service_pagination_response import BetaAppServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaAppServiceListApplicationKeysResponse(BaseModel): """ BetaAppServiceListApplicationKeysResponse - """ # noqa: E501 - keys: Optional[List[BetaAppServiceApplicationKey]] = None - pagination: Optional[BetaAppServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["keys", "pagination"] + """ + + keys: Optional[List[BetaAppServiceApplicationKey]] = Field( + default=None, alias="keys" + ) + pagination: Optional[BetaAppServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaAppServiceListApplicationKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in keys (list) - _items = [] - if self.keys: - for _item_keys in self.keys: - if _item_keys: - _items.append(_item_keys.to_dict()) - _dict['keys'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keys": [BetaAppServiceApplicationKey.from_dict(_item) for _item in obj["keys"]] if obj.get("keys") is not None else None, - "pagination": BetaAppServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_application_key import ( + BetaAppServiceApplicationKey, +) +from zitadel_client.models.beta_app_service_pagination_response import ( + BetaAppServicePaginationResponse, +) +BetaAppServiceListApplicationKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_list_applications_request.py b/zitadel_client/models/beta_app_service_list_applications_request.py index 28c3ce06..608cb215 100644 --- a/zitadel_client/models/beta_app_service_list_applications_request.py +++ b/zitadel_client/models/beta_app_service_list_applications_request.py @@ -1,40 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_app_sorting import BetaAppServiceAppSorting -from zitadel_client.models.beta_app_service_application_search_filter import BetaAppServiceApplicationSearchFilter -from zitadel_client.models.beta_app_service_pagination_request import BetaAppServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaAppServiceListApplicationsRequest(BaseModel): """ BetaAppServiceListApplicationsRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - pagination: Optional[BetaAppServicePaginationRequest] = None - filters: Optional[List[BetaAppServiceApplicationSearchFilter]] = Field(default=None, description="criteria the client is looking for") - sorting_column: Optional[BetaAppServiceAppSorting] = Field(default=None, alias="sortingColumn") - __properties: ClassVar[List[str]] = ["projectId", "pagination", "filters", "sortingColumn"] + pagination: Optional[BetaAppServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filters: Optional[List[BetaAppServiceApplicationSearchFilter]] = Field( + default=None, alias="filters", description="criteria the client is looking for" + ) + sorting_column: Optional[BetaAppServiceAppSorting] = Field( + default=None, alias="sortingColumn" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +39,12 @@ class BetaAppServiceListApplicationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "pagination": BetaAppServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filters": [BetaAppServiceApplicationSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, - "sortingColumn": obj.get("sortingColumn") - }) - return _obj - - +from zitadel_client.models.beta_app_service_app_sorting import BetaAppServiceAppSorting +from zitadel_client.models.beta_app_service_application_search_filter import ( + BetaAppServiceApplicationSearchFilter, +) +from zitadel_client.models.beta_app_service_pagination_request import ( + BetaAppServicePaginationRequest, +) + +BetaAppServiceListApplicationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_list_applications_response.py b/zitadel_client/models/beta_app_service_list_applications_response.py index 67a53ae0..411e0ebc 100644 --- a/zitadel_client/models/beta_app_service_list_applications_response.py +++ b/zitadel_client/models/beta_app_service_list_applications_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_application import BetaAppServiceApplication -from zitadel_client.models.beta_app_service_pagination_response import BetaAppServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaAppServiceListApplicationsResponse(BaseModel): """ BetaAppServiceListApplicationsResponse - """ # noqa: E501 - applications: Optional[List[BetaAppServiceApplication]] = None - pagination: Optional[BetaAppServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["applications", "pagination"] + """ + + applications: Optional[List[BetaAppServiceApplication]] = Field( + default=None, alias="applications" + ) + pagination: Optional[BetaAppServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class BetaAppServiceListApplicationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in applications (list) - _items = [] - if self.applications: - for _item_applications in self.applications: - if _item_applications: - _items.append(_item_applications.to_dict()) - _dict['applications'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceListApplicationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "applications": [BetaAppServiceApplication.from_dict(_item) for _item in obj["applications"]] if obj.get("applications") is not None else None, - "pagination": BetaAppServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_application import BetaAppServiceApplication +from zitadel_client.models.beta_app_service_pagination_response import ( + BetaAppServicePaginationResponse, +) +BetaAppServiceListApplicationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_login_v2.py b/zitadel_client/models/beta_app_service_login_v2.py index f3ac01ac..88bf4117 100644 --- a/zitadel_client/models/beta_app_service_login_v2.py +++ b/zitadel_client/models/beta_app_service_login_v2.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceLoginV2(BaseModel): """ BetaAppServiceLoginV2 - """ # noqa: E501 - base_uri: Optional[StrictStr] = Field(default=None, description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", alias="baseUri") - __properties: ClassVar[List[str]] = ["baseUri"] + """ + + base_uri: Optional[StrictStr] = Field( + default=None, + alias="baseUri", + description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class BetaAppServiceLoginV2(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceLoginV2 from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if base_uri (nullable) is None - # and model_fields_set contains the field - if self.base_uri is None and "base_uri" in self.model_fields_set: - _dict['baseUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceLoginV2 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "baseUri": obj.get("baseUri") - }) - return _obj - - +BetaAppServiceLoginV2.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_login_version.py b/zitadel_client/models/beta_app_service_login_version.py index ecc0a02d..7b9ffd74 100644 --- a/zitadel_client/models/beta_app_service_login_version.py +++ b/zitadel_client/models/beta_app_service_login_version.py @@ -1,36 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_login_v2 import BetaAppServiceLoginV2 -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceLoginVersion(BaseModel): """ BetaAppServiceLoginVersion - """ # noqa: E501 - login_v1: Optional[Dict[str, Any]] = Field(default=None, alias="loginV1") + """ + + login_v1: Optional[object] = Field(default=None, alias="loginV1") login_v2: Optional[BetaAppServiceLoginV2] = Field(default=None, alias="loginV2") - __properties: ClassVar[List[str]] = ["loginV1", "loginV2"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +30,6 @@ class BetaAppServiceLoginVersion(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceLoginVersion from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceLoginVersion from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginV1": obj.get("loginV1"), - "loginV2": BetaAppServiceLoginV2.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_login_v2 import BetaAppServiceLoginV2 +BetaAppServiceLoginVersion.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_oidc_app_type.py b/zitadel_client/models/beta_app_service_oidc_app_type.py index 2f11f657..6e4027cb 100644 --- a/zitadel_client/models/beta_app_service_oidc_app_type.py +++ b/zitadel_client/models/beta_app_service_oidc_app_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCAppType(str, Enum): @@ -23,16 +13,6 @@ class BetaAppServiceOIDCAppType(str, Enum): BetaAppServiceOIDCAppType """ - """ - allowed enum values - """ - OIDC_APP_TYPE_WEB = 'OIDC_APP_TYPE_WEB' - OIDC_APP_TYPE_USER_AGENT = 'OIDC_APP_TYPE_USER_AGENT' - OIDC_APP_TYPE_NATIVE = 'OIDC_APP_TYPE_NATIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCAppType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_APP_TYPE_WEB = "OIDC_APP_TYPE_WEB" + OIDC_APP_TYPE_USER_AGENT = "OIDC_APP_TYPE_USER_AGENT" + OIDC_APP_TYPE_NATIVE = "OIDC_APP_TYPE_NATIVE" diff --git a/zitadel_client/models/beta_app_service_oidc_auth_method_type.py b/zitadel_client/models/beta_app_service_oidc_auth_method_type.py index a1a407e1..b6c767d3 100644 --- a/zitadel_client/models/beta_app_service_oidc_auth_method_type.py +++ b/zitadel_client/models/beta_app_service_oidc_auth_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCAuthMethodType(str, Enum): @@ -23,17 +13,7 @@ class BetaAppServiceOIDCAuthMethodType(str, Enum): BetaAppServiceOIDCAuthMethodType """ - """ - allowed enum values - """ - OIDC_AUTH_METHOD_TYPE_BASIC = 'OIDC_AUTH_METHOD_TYPE_BASIC' - OIDC_AUTH_METHOD_TYPE_POST = 'OIDC_AUTH_METHOD_TYPE_POST' - OIDC_AUTH_METHOD_TYPE_NONE = 'OIDC_AUTH_METHOD_TYPE_NONE' - OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = 'OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCAuthMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_AUTH_METHOD_TYPE_BASIC = "OIDC_AUTH_METHOD_TYPE_BASIC" + OIDC_AUTH_METHOD_TYPE_POST = "OIDC_AUTH_METHOD_TYPE_POST" + OIDC_AUTH_METHOD_TYPE_NONE = "OIDC_AUTH_METHOD_TYPE_NONE" + OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT = "OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT" diff --git a/zitadel_client/models/beta_app_service_oidc_config.py b/zitadel_client/models/beta_app_service_oidc_config.py index 876b3de3..e10bb6fe 100644 --- a/zitadel_client/models/beta_app_service_oidc_config.py +++ b/zitadel_client/models/beta_app_service_oidc_config.py @@ -1,62 +1,80 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from zitadel_client.models.beta_app_service_oidc_app_type import BetaAppServiceOIDCAppType -from zitadel_client.models.beta_app_service_oidc_auth_method_type import BetaAppServiceOIDCAuthMethodType -from zitadel_client.models.beta_app_service_oidc_grant_type import BetaAppServiceOIDCGrantType -from zitadel_client.models.beta_app_service_oidc_localized_message import BetaAppServiceOIDCLocalizedMessage -from zitadel_client.models.beta_app_service_oidc_response_type import BetaAppServiceOIDCResponseType -from zitadel_client.models.beta_app_service_oidc_token_type import BetaAppServiceOIDCTokenType -from zitadel_client.models.beta_app_service_oidc_version import BetaAppServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaAppServiceOIDCConfig(BaseModel): """ BetaAppServiceOIDCConfig - """ # noqa: E501 + """ + redirect_uris: Optional[List[StrictStr]] = Field(default=None, alias="redirectUris") - response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field(default=None, alias="responseTypes") - grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field(default=None, alias="grantTypes") + response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field( + default=None, alias="responseTypes" + ) + grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field( + default=None, alias="grantTypes" + ) app_type: Optional[BetaAppServiceOIDCAppType] = Field(default=None, alias="appType") client_id: Optional[StrictStr] = Field(default=None, alias="clientId") - auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, alias="postLogoutRedirectUris") - version: Optional[BetaAppServiceOIDCVersion] = None + auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, alias="postLogoutRedirectUris" + ) + version: Optional[BetaAppServiceOIDCVersion] = Field(default=None, alias="version") none_compliant: Optional[StrictBool] = Field(default=None, alias="noneCompliant") - compliance_problems: Optional[List[BetaAppServiceOIDCLocalizedMessage]] = Field(default=None, alias="complianceProblems") + compliance_problems: Optional[List[BetaAppServiceOIDCLocalizedMessage]] = Field( + default=None, alias="complianceProblems" + ) dev_mode: Optional[StrictBool] = Field(default=None, alias="devMode") - access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, alias="additionalOrigins") - allowed_origins: Optional[List[StrictStr]] = Field(default=None, alias="allowedOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, alias="backChannelLogoutUri") - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "appType", "clientId", "authMethodType", "postLogoutRedirectUris", "version", "noneCompliant", "complianceProblems", "devMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "allowedOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="accessTokenRoleAssertion" + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenRoleAssertion" + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenUserinfoAssertion" + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, alias="additionalOrigins" + ) + allowed_origins: Optional[List[StrictStr]] = Field( + default=None, alias="allowedOrigins" + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, alias="skipNativeAppSuccessPage" + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, alias="backChannelLogoutUri" + ) + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -64,82 +82,30 @@ class BetaAppServiceOIDCConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceOIDCConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in compliance_problems (list) - _items = [] - if self.compliance_problems: - for _item_compliance_problems in self.compliance_problems: - if _item_compliance_problems: - _items.append(_item_compliance_problems.to_dict()) - _dict['complianceProblems'] = _items - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceOIDCConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "appType": obj.get("appType"), - "clientId": obj.get("clientId"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "noneCompliant": obj.get("noneCompliant"), - "complianceProblems": [BetaAppServiceOIDCLocalizedMessage.from_dict(_item) for _item in obj["complianceProblems"]] if obj.get("complianceProblems") is not None else None, - "devMode": obj.get("devMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "allowedOrigins": obj.get("allowedOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +from zitadel_client.models.beta_app_service_oidc_app_type import ( + BetaAppServiceOIDCAppType, +) +from zitadel_client.models.beta_app_service_oidc_auth_method_type import ( + BetaAppServiceOIDCAuthMethodType, +) +from zitadel_client.models.beta_app_service_oidc_grant_type import ( + BetaAppServiceOIDCGrantType, +) +from zitadel_client.models.beta_app_service_oidc_localized_message import ( + BetaAppServiceOIDCLocalizedMessage, +) +from zitadel_client.models.beta_app_service_oidc_response_type import ( + BetaAppServiceOIDCResponseType, +) +from zitadel_client.models.beta_app_service_oidc_token_type import ( + BetaAppServiceOIDCTokenType, +) +from zitadel_client.models.beta_app_service_oidc_version import ( + BetaAppServiceOIDCVersion, +) + +BetaAppServiceOIDCConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_oidc_grant_type.py b/zitadel_client/models/beta_app_service_oidc_grant_type.py index 67a73603..76cec1af 100644 --- a/zitadel_client/models/beta_app_service_oidc_grant_type.py +++ b/zitadel_client/models/beta_app_service_oidc_grant_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCGrantType(str, Enum): @@ -23,18 +13,8 @@ class BetaAppServiceOIDCGrantType(str, Enum): BetaAppServiceOIDCGrantType """ - """ - allowed enum values - """ - OIDC_GRANT_TYPE_AUTHORIZATION_CODE = 'OIDC_GRANT_TYPE_AUTHORIZATION_CODE' - OIDC_GRANT_TYPE_IMPLICIT = 'OIDC_GRANT_TYPE_IMPLICIT' - OIDC_GRANT_TYPE_REFRESH_TOKEN = 'OIDC_GRANT_TYPE_REFRESH_TOKEN' - OIDC_GRANT_TYPE_DEVICE_CODE = 'OIDC_GRANT_TYPE_DEVICE_CODE' - OIDC_GRANT_TYPE_TOKEN_EXCHANGE = 'OIDC_GRANT_TYPE_TOKEN_EXCHANGE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCGrantType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_GRANT_TYPE_AUTHORIZATION_CODE = "OIDC_GRANT_TYPE_AUTHORIZATION_CODE" + OIDC_GRANT_TYPE_IMPLICIT = "OIDC_GRANT_TYPE_IMPLICIT" + OIDC_GRANT_TYPE_REFRESH_TOKEN = "OIDC_GRANT_TYPE_REFRESH_TOKEN" + OIDC_GRANT_TYPE_DEVICE_CODE = "OIDC_GRANT_TYPE_DEVICE_CODE" + OIDC_GRANT_TYPE_TOKEN_EXCHANGE = "OIDC_GRANT_TYPE_TOKEN_EXCHANGE" diff --git a/zitadel_client/models/beta_app_service_oidc_localized_message.py b/zitadel_client/models/beta_app_service_oidc_localized_message.py index ad46711e..51807c9b 100644 --- a/zitadel_client/models/beta_app_service_oidc_localized_message.py +++ b/zitadel_client/models/beta_app_service_oidc_localized_message.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceOIDCLocalizedMessage(BaseModel): """ BetaAppServiceOIDCLocalizedMessage - """ # noqa: E501 - key: Optional[StrictStr] = None - localized_message: Optional[StrictStr] = Field(default=None, alias="localizedMessage") - __properties: ClassVar[List[str]] = ["key", "localizedMessage"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + localized_message: Optional[StrictStr] = Field( + default=None, alias="localizedMessage" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class BetaAppServiceOIDCLocalizedMessage(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceOIDCLocalizedMessage from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceOIDCLocalizedMessage from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "localizedMessage": obj.get("localizedMessage") - }) - return _obj - - +BetaAppServiceOIDCLocalizedMessage.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_oidc_response_type.py b/zitadel_client/models/beta_app_service_oidc_response_type.py index ea1f650c..0edd48ab 100644 --- a/zitadel_client/models/beta_app_service_oidc_response_type.py +++ b/zitadel_client/models/beta_app_service_oidc_response_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCResponseType(str, Enum): @@ -23,17 +13,7 @@ class BetaAppServiceOIDCResponseType(str, Enum): BetaAppServiceOIDCResponseType """ - """ - allowed enum values - """ - OIDC_RESPONSE_TYPE_UNSPECIFIED = 'OIDC_RESPONSE_TYPE_UNSPECIFIED' - OIDC_RESPONSE_TYPE_CODE = 'OIDC_RESPONSE_TYPE_CODE' - OIDC_RESPONSE_TYPE_ID_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN' - OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = 'OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCResponseType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_RESPONSE_TYPE_UNSPECIFIED = "OIDC_RESPONSE_TYPE_UNSPECIFIED" + OIDC_RESPONSE_TYPE_CODE = "OIDC_RESPONSE_TYPE_CODE" + OIDC_RESPONSE_TYPE_ID_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN" + OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN = "OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN" diff --git a/zitadel_client/models/beta_app_service_oidc_token_type.py b/zitadel_client/models/beta_app_service_oidc_token_type.py index fc605caa..28f5a928 100644 --- a/zitadel_client/models/beta_app_service_oidc_token_type.py +++ b/zitadel_client/models/beta_app_service_oidc_token_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCTokenType(str, Enum): @@ -23,15 +13,5 @@ class BetaAppServiceOIDCTokenType(str, Enum): BetaAppServiceOIDCTokenType """ - """ - allowed enum values - """ - OIDC_TOKEN_TYPE_BEARER = 'OIDC_TOKEN_TYPE_BEARER' - OIDC_TOKEN_TYPE_JWT = 'OIDC_TOKEN_TYPE_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCTokenType from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_TOKEN_TYPE_BEARER = "OIDC_TOKEN_TYPE_BEARER" + OIDC_TOKEN_TYPE_JWT = "OIDC_TOKEN_TYPE_JWT" diff --git a/zitadel_client/models/beta_app_service_oidc_version.py b/zitadel_client/models/beta_app_service_oidc_version.py index b2c01913..ac2fc4a4 100644 --- a/zitadel_client/models/beta_app_service_oidc_version.py +++ b/zitadel_client/models/beta_app_service_oidc_version.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceOIDCVersion(str, Enum): @@ -23,14 +13,4 @@ class BetaAppServiceOIDCVersion(str, Enum): BetaAppServiceOIDCVersion """ - """ - allowed enum values - """ - OIDC_VERSION_1_0 = 'OIDC_VERSION_1_0' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceOIDCVersion from a JSON string""" - return cls(json.loads(json_str)) - - + OIDC_VERSION_1_0 = "OIDC_VERSION_1_0" diff --git a/zitadel_client/models/beta_app_service_pagination_request.py b/zitadel_client/models/beta_app_service_pagination_request.py index f38e09ad..d5c2dc07 100644 --- a/zitadel_client/models/beta_app_service_pagination_request.py +++ b/zitadel_client/models/beta_app_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaAppServicePaginationRequest(BaseModel): """ BetaAppServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaAppServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaAppServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_pagination_response.py b/zitadel_client/models/beta_app_service_pagination_response.py index 9e4a476f..89e5378a 100644 --- a/zitadel_client/models/beta_app_service_pagination_response.py +++ b/zitadel_client/models/beta_app_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServicePaginationResponse(BaseModel): """ BetaAppServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaAppServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaAppServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_reactivate_application_request.py b/zitadel_client/models/beta_app_service_reactivate_application_request.py index 47330637..4bdd779e 100644 --- a/zitadel_client/models/beta_app_service_reactivate_application_request.py +++ b/zitadel_client/models/beta_app_service_reactivate_application_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceReactivateApplicationRequest(BaseModel): """ BetaAppServiceReactivateApplicationRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["projectId", "id"] + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaAppServiceReactivateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceReactivateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceReactivateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "id": obj.get("id") - }) - return _obj - - +BetaAppServiceReactivateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_reactivate_application_response.py b/zitadel_client/models/beta_app_service_reactivate_application_response.py index f29aae49..821a3b77 100644 --- a/zitadel_client/models/beta_app_service_reactivate_application_response.py +++ b/zitadel_client/models/beta_app_service_reactivate_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceReactivateApplicationResponse(BaseModel): """ BetaAppServiceReactivateApplicationResponse - """ # noqa: E501 - reactivation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="reactivationDate") - __properties: ClassVar[List[str]] = ["reactivationDate"] + """ + reactivation_date: Optional[AwareDatetime] = Field( + default=None, + alias="reactivationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAppServiceReactivateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceReactivateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceReactivateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "reactivationDate": obj.get("reactivationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceReactivateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_regenerate_client_secret_request.py b/zitadel_client/models/beta_app_service_regenerate_client_secret_request.py index b4595eae..764fc4ae 100644 --- a/zitadel_client/models/beta_app_service_regenerate_client_secret_request.py +++ b/zitadel_client/models/beta_app_service_regenerate_client_secret_request.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaAppServiceRegenerateClientSecretRequest(BaseModel): """ BetaAppServiceRegenerateClientSecretRequest - """ # noqa: E501 + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") application_id: Optional[StrictStr] = Field(default=None, alias="applicationId") is_api: Optional[StrictBool] = Field(default=None, alias="isApi") is_oidc: Optional[StrictBool] = Field(default=None, alias="isOidc") - __properties: ClassVar[List[str]] = ["projectId", "applicationId", "isApi", "isOidc"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class BetaAppServiceRegenerateClientSecretRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceRegenerateClientSecretRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceRegenerateClientSecretRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "applicationId": obj.get("applicationId"), - "isApi": obj.get("isApi"), - "isOidc": obj.get("isOidc") - }) - return _obj - - +BetaAppServiceRegenerateClientSecretRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_regenerate_client_secret_response.py b/zitadel_client/models/beta_app_service_regenerate_client_secret_response.py index 6627e6a3..f4245ed3 100644 --- a/zitadel_client/models/beta_app_service_regenerate_client_secret_response.py +++ b/zitadel_client/models/beta_app_service_regenerate_client_secret_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceRegenerateClientSecretResponse(BaseModel): """ BetaAppServiceRegenerateClientSecretResponse - """ # noqa: E501 + """ + client_secret: Optional[StrictStr] = Field(default=None, alias="clientSecret") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["clientSecret", "creationDate"] + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,6 @@ class BetaAppServiceRegenerateClientSecretResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceRegenerateClientSecretResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceRegenerateClientSecretResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientSecret": obj.get("clientSecret"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceRegenerateClientSecretResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_saml_config.py b/zitadel_client/models/beta_app_service_saml_config.py index 17c7b24e..8d5c815f 100644 --- a/zitadel_client/models/beta_app_service_saml_config.py +++ b/zitadel_client/models/beta_app_service_saml_config.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceSAMLConfig(BaseModel): """ BetaAppServiceSAMLConfig - """ # noqa: E501 - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") + """ + + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) metadata_url: Optional[StrictStr] = Field(default=None, alias="metadataUrl") - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="metadataXml") - __properties: ClassVar[List[str]] = ["loginVersion", "metadataUrl", "metadataXml"] + metadata_xml: Optional[Base64Bytes] = Field(default=None, alias="metadataXml") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,9 @@ class BetaAppServiceSAMLConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceSAMLConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceSAMLConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None, - "metadataUrl": obj.get("metadataUrl"), - "metadataXml": obj.get("metadataXml") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +BetaAppServiceSAMLConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_text_filter_method.py b/zitadel_client/models/beta_app_service_text_filter_method.py index b0ef666d..e9f578d0 100644 --- a/zitadel_client/models/beta_app_service_text_filter_method.py +++ b/zitadel_client/models/beta_app_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAppServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class BetaAppServiceTextFilterMethod(str, Enum): BetaAppServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAppServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/beta_app_service_update_api_application_configuration_request.py b/zitadel_client/models/beta_app_service_update_api_application_configuration_request.py index 990bf55f..e0f3b082 100644 --- a/zitadel_client/models/beta_app_service_update_api_application_configuration_request.py +++ b/zitadel_client/models/beta_app_service_update_api_application_configuration_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_api_auth_method_type import BetaAppServiceAPIAuthMethodType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceUpdateAPIApplicationConfigurationRequest(BaseModel): """ BetaAppServiceUpdateAPIApplicationConfigurationRequest - """ # noqa: E501 - auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field(default=None, alias="authMethodType") - __properties: ClassVar[List[str]] = ["authMethodType"] + """ + auth_method_type: Optional[BetaAppServiceAPIAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class BetaAppServiceUpdateAPIApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateAPIApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateAPIApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authMethodType": obj.get("authMethodType") - }) - return _obj - +from zitadel_client.models.beta_app_service_api_auth_method_type import ( + BetaAppServiceAPIAuthMethodType, +) +BetaAppServiceUpdateAPIApplicationConfigurationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_update_application_request.py b/zitadel_client/models/beta_app_service_update_application_request.py index 1a99c005..2d00501a 100644 --- a/zitadel_client/models/beta_app_service_update_application_request.py +++ b/zitadel_client/models/beta_app_service_update_application_request.py @@ -1,42 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_app_service_update_api_application_configuration_request import BetaAppServiceUpdateAPIApplicationConfigurationRequest -from zitadel_client.models.beta_app_service_update_oidc_application_configuration_request import BetaAppServiceUpdateOIDCApplicationConfigurationRequest -from zitadel_client.models.beta_app_service_update_saml_application_configuration_request import BetaAppServiceUpdateSAMLApplicationConfigurationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceUpdateApplicationRequest(BaseModel): """ BetaAppServiceUpdateApplicationRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, alias="projectId") - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - api_configuration_request: Optional[BetaAppServiceUpdateAPIApplicationConfigurationRequest] = Field(default=None, alias="apiConfigurationRequest") - oidc_configuration_request: Optional[BetaAppServiceUpdateOIDCApplicationConfigurationRequest] = Field(default=None, alias="oidcConfigurationRequest") - saml_configuration_request: Optional[BetaAppServiceUpdateSAMLApplicationConfigurationRequest] = Field(default=None, alias="samlConfigurationRequest") - __properties: ClassVar[List[str]] = ["projectId", "id", "name", "apiConfigurationRequest", "oidcConfigurationRequest", "samlConfigurationRequest"] + """ + project_id: Optional[StrictStr] = Field(default=None, alias="projectId") + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + api_configuration_request: Optional[ + BetaAppServiceUpdateAPIApplicationConfigurationRequest + ] = Field(default=None, alias="apiConfigurationRequest") + oidc_configuration_request: Optional[ + BetaAppServiceUpdateOIDCApplicationConfigurationRequest + ] = Field(default=None, alias="oidcConfigurationRequest") + saml_configuration_request: Optional[ + BetaAppServiceUpdateSAMLApplicationConfigurationRequest + ] = Field(default=None, alias="samlConfigurationRequest") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,66 +41,14 @@ class BetaAppServiceUpdateApplicationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateApplicationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of api_configuration_request - if self.api_configuration_request: - _dict['apiConfigurationRequest'] = self.api_configuration_request.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_configuration_request - if self.oidc_configuration_request: - _dict['oidcConfigurationRequest'] = self.oidc_configuration_request.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml_configuration_request - if self.saml_configuration_request: - _dict['samlConfigurationRequest'] = self.saml_configuration_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateApplicationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "id": obj.get("id"), - "name": obj.get("name"), - "apiConfigurationRequest": BetaAppServiceUpdateAPIApplicationConfigurationRequest.from_dict(obj["apiConfigurationRequest"]) if obj.get("apiConfigurationRequest") is not None else None, - "oidcConfigurationRequest": BetaAppServiceUpdateOIDCApplicationConfigurationRequest.from_dict(obj["oidcConfigurationRequest"]) if obj.get("oidcConfigurationRequest") is not None else None, - "samlConfigurationRequest": BetaAppServiceUpdateSAMLApplicationConfigurationRequest.from_dict(obj["samlConfigurationRequest"]) if obj.get("samlConfigurationRequest") is not None else None - }) - return _obj - +from zitadel_client.models.beta_app_service_update_api_application_configuration_request import ( + BetaAppServiceUpdateAPIApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_oidc_application_configuration_request import ( + BetaAppServiceUpdateOIDCApplicationConfigurationRequest, +) +from zitadel_client.models.beta_app_service_update_saml_application_configuration_request import ( + BetaAppServiceUpdateSAMLApplicationConfigurationRequest, +) +BetaAppServiceUpdateApplicationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_update_application_response.py b/zitadel_client/models/beta_app_service_update_application_response.py index f5228e07..65362f7b 100644 --- a/zitadel_client/models/beta_app_service_update_application_response.py +++ b/zitadel_client/models/beta_app_service_update_application_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAppServiceUpdateApplicationResponse(BaseModel): """ BetaAppServiceUpdateApplicationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAppServiceUpdateApplicationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateApplicationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateApplicationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAppServiceUpdateApplicationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_app_service_update_oidc_application_configuration_request.py b/zitadel_client/models/beta_app_service_update_oidc_application_configuration_request.py index 071640df..3e5f5623 100644 --- a/zitadel_client/models/beta_app_service_update_oidc_application_configuration_request.py +++ b/zitadel_client/models/beta_app_service_update_oidc_application_configuration_request.py @@ -1,57 +1,72 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from zitadel_client.models.beta_app_service_oidc_app_type import BetaAppServiceOIDCAppType -from zitadel_client.models.beta_app_service_oidc_auth_method_type import BetaAppServiceOIDCAuthMethodType -from zitadel_client.models.beta_app_service_oidc_grant_type import BetaAppServiceOIDCGrantType -from zitadel_client.models.beta_app_service_oidc_response_type import BetaAppServiceOIDCResponseType -from zitadel_client.models.beta_app_service_oidc_token_type import BetaAppServiceOIDCTokenType -from zitadel_client.models.beta_app_service_oidc_version import BetaAppServiceOIDCVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaAppServiceUpdateOIDCApplicationConfigurationRequest(BaseModel): """ BetaAppServiceUpdateOIDCApplicationConfigurationRequest - """ # noqa: E501 + """ + redirect_uris: Optional[List[StrictStr]] = Field(default=None, alias="redirectUris") - response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field(default=None, alias="responseTypes") - grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field(default=None, alias="grantTypes") + response_types: Optional[List[BetaAppServiceOIDCResponseType]] = Field( + default=None, alias="responseTypes" + ) + grant_types: Optional[List[BetaAppServiceOIDCGrantType]] = Field( + default=None, alias="grantTypes" + ) app_type: Optional[BetaAppServiceOIDCAppType] = Field(default=None, alias="appType") - auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field(default=None, alias="authMethodType") - post_logout_redirect_uris: Optional[List[StrictStr]] = Field(default=None, alias="postLogoutRedirectUris") - version: Optional[BetaAppServiceOIDCVersion] = None + auth_method_type: Optional[BetaAppServiceOIDCAuthMethodType] = Field( + default=None, alias="authMethodType" + ) + post_logout_redirect_uris: Optional[List[StrictStr]] = Field( + default=None, alias="postLogoutRedirectUris" + ) + version: Optional[BetaAppServiceOIDCVersion] = Field(default=None, alias="version") dev_mode: Optional[StrictBool] = Field(default=None, alias="devMode") - access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field(default=None, alias="accessTokenType") - access_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="accessTokenRoleAssertion") - id_token_role_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenRoleAssertion") - id_token_userinfo_assertion: Optional[StrictBool] = Field(default=None, alias="idTokenUserinfoAssertion") - clock_skew: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="clockSkew") - additional_origins: Optional[List[StrictStr]] = Field(default=None, alias="additionalOrigins") - skip_native_app_success_page: Optional[StrictBool] = Field(default=None, alias="skipNativeAppSuccessPage") - back_channel_logout_uri: Optional[StrictStr] = Field(default=None, alias="backChannelLogoutUri") - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") - __properties: ClassVar[List[str]] = ["redirectUris", "responseTypes", "grantTypes", "appType", "authMethodType", "postLogoutRedirectUris", "version", "devMode", "accessTokenType", "accessTokenRoleAssertion", "idTokenRoleAssertion", "idTokenUserinfoAssertion", "clockSkew", "additionalOrigins", "skipNativeAppSuccessPage", "backChannelLogoutUri", "loginVersion"] + access_token_type: Optional[BetaAppServiceOIDCTokenType] = Field( + default=None, alias="accessTokenType" + ) + access_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="accessTokenRoleAssertion" + ) + id_token_role_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenRoleAssertion" + ) + id_token_userinfo_assertion: Optional[StrictBool] = Field( + default=None, alias="idTokenUserinfoAssertion" + ) + clock_skew: Optional[ProtobufDuration] = Field( + default=None, + alias="clockSkew", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + additional_origins: Optional[List[StrictStr]] = Field( + default=None, alias="additionalOrigins" + ) + skip_native_app_success_page: Optional[StrictBool] = Field( + default=None, alias="skipNativeAppSuccessPage" + ) + back_channel_logout_uri: Optional[StrictStr] = Field( + default=None, alias="backChannelLogoutUri" + ) + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -59,101 +74,29 @@ class BetaAppServiceUpdateOIDCApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateOIDCApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - # set to None if dev_mode (nullable) is None - # and model_fields_set contains the field - if self.dev_mode is None and "dev_mode" in self.model_fields_set: - _dict['devMode'] = None - - # set to None if access_token_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.access_token_role_assertion is None and "access_token_role_assertion" in self.model_fields_set: - _dict['accessTokenRoleAssertion'] = None - - # set to None if id_token_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.id_token_role_assertion is None and "id_token_role_assertion" in self.model_fields_set: - _dict['idTokenRoleAssertion'] = None - - # set to None if id_token_userinfo_assertion (nullable) is None - # and model_fields_set contains the field - if self.id_token_userinfo_assertion is None and "id_token_userinfo_assertion" in self.model_fields_set: - _dict['idTokenUserinfoAssertion'] = None - - # set to None if skip_native_app_success_page (nullable) is None - # and model_fields_set contains the field - if self.skip_native_app_success_page is None and "skip_native_app_success_page" in self.model_fields_set: - _dict['skipNativeAppSuccessPage'] = None - - # set to None if back_channel_logout_uri (nullable) is None - # and model_fields_set contains the field - if self.back_channel_logout_uri is None and "back_channel_logout_uri" in self.model_fields_set: - _dict['backChannelLogoutUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateOIDCApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "redirectUris": obj.get("redirectUris"), - "responseTypes": obj.get("responseTypes"), - "grantTypes": obj.get("grantTypes"), - "appType": obj.get("appType"), - "authMethodType": obj.get("authMethodType"), - "postLogoutRedirectUris": obj.get("postLogoutRedirectUris"), - "version": obj.get("version"), - "devMode": obj.get("devMode"), - "accessTokenType": obj.get("accessTokenType"), - "accessTokenRoleAssertion": obj.get("accessTokenRoleAssertion"), - "idTokenRoleAssertion": obj.get("idTokenRoleAssertion"), - "idTokenUserinfoAssertion": obj.get("idTokenUserinfoAssertion"), - "clockSkew": obj.get("clockSkew"), - "additionalOrigins": obj.get("additionalOrigins"), - "skipNativeAppSuccessPage": obj.get("skipNativeAppSuccessPage"), - "backChannelLogoutUri": obj.get("backChannelLogoutUri"), - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +from zitadel_client.models.beta_app_service_oidc_app_type import ( + BetaAppServiceOIDCAppType, +) +from zitadel_client.models.beta_app_service_oidc_auth_method_type import ( + BetaAppServiceOIDCAuthMethodType, +) +from zitadel_client.models.beta_app_service_oidc_grant_type import ( + BetaAppServiceOIDCGrantType, +) +from zitadel_client.models.beta_app_service_oidc_response_type import ( + BetaAppServiceOIDCResponseType, +) +from zitadel_client.models.beta_app_service_oidc_token_type import ( + BetaAppServiceOIDCTokenType, +) +from zitadel_client.models.beta_app_service_oidc_version import ( + BetaAppServiceOIDCVersion, +) + +BetaAppServiceUpdateOIDCApplicationConfigurationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_app_service_update_saml_application_configuration_request.py b/zitadel_client/models/beta_app_service_update_saml_application_configuration_request.py index f28799fe..97c11a24 100644 --- a/zitadel_client/models/beta_app_service_update_saml_application_configuration_request.py +++ b/zitadel_client/models/beta_app_service_update_saml_application_configuration_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_app_service_login_version import BetaAppServiceLoginVersion -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAppServiceUpdateSAMLApplicationConfigurationRequest(BaseModel): """ BetaAppServiceUpdateSAMLApplicationConfigurationRequest - """ # noqa: E501 - login_version: Optional[BetaAppServiceLoginVersion] = Field(default=None, alias="loginVersion") + """ + + login_version: Optional[BetaAppServiceLoginVersion] = Field( + default=None, alias="loginVersion" + ) metadata_url: Optional[StrictStr] = Field(default=None, alias="metadataUrl") - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="metadataXml") - __properties: ClassVar[List[str]] = ["loginVersion", "metadataUrl", "metadataXml"] + metadata_xml: Optional[Base64Bytes] = Field(default=None, alias="metadataXml") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,11 @@ class BetaAppServiceUpdateSAMLApplicationConfigurationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateSAMLApplicationConfigurationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_version - if self.login_version: - _dict['loginVersion'] = self.login_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAppServiceUpdateSAMLApplicationConfigurationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginVersion": BetaAppServiceLoginVersion.from_dict(obj["loginVersion"]) if obj.get("loginVersion") is not None else None, - "metadataUrl": obj.get("metadataUrl"), - "metadataXml": obj.get("metadataXml") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.beta_app_service_login_version import ( + BetaAppServiceLoginVersion, +) +BetaAppServiceUpdateSAMLApplicationConfigurationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_authorization_service_activate_authorization_request.py b/zitadel_client/models/beta_authorization_service_activate_authorization_request.py index 07d9795b..59e0615c 100644 --- a/zitadel_client/models/beta_authorization_service_activate_authorization_request.py +++ b/zitadel_client/models/beta_authorization_service_activate_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceActivateAuthorizationRequest(BaseModel): """ BetaAuthorizationServiceActivateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be activated.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be activated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaAuthorizationServiceActivateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceActivateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceActivateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaAuthorizationServiceActivateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_activate_authorization_response.py b/zitadel_client/models/beta_authorization_service_activate_authorization_response.py index 7ac06b50..0c88c59b 100644 --- a/zitadel_client/models/beta_authorization_service_activate_authorization_response.py +++ b/zitadel_client/models/beta_authorization_service_activate_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServiceActivateAuthorizationResponse(BaseModel): """ BetaAuthorizationServiceActivateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAuthorizationServiceActivateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceActivateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceActivateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAuthorizationServiceActivateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_any.py b/zitadel_client/models/beta_authorization_service_any.py index 87a8a0b6..d4a1f8a5 100644 --- a/zitadel_client/models/beta_authorization_service_any.py +++ b/zitadel_client/models/beta_authorization_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaAuthorizationServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaAuthorizationServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_authorization.py b/zitadel_client/models/beta_authorization_service_authorization.py index 6b4e9d1c..ccca059b 100644 --- a/zitadel_client/models/beta_authorization_service_authorization.py +++ b/zitadel_client/models/beta_authorization_service_authorization.py @@ -1,48 +1,79 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_authorization_service_state import BetaAuthorizationServiceState -from zitadel_client.models.beta_authorization_service_user import BetaAuthorizationServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaAuthorizationServiceAuthorization(BaseModel): """ BetaAuthorizationServiceAuthorization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization.") - project_id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the project the user was granted the authorization for.", alias="projectId") - project_name: Optional[StrictStr] = Field(default=None, description="Name is the name of the project the user was granted the authorization for.", alias="projectName") - project_organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization the project belongs to.", alias="projectOrganizationId") - project_grant_id: Optional[StrictStr] = Field(default=None, description="ID of the granted project, only provided if it is a granted project.", alias="projectGrantId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="ID of the organization the project is granted to, only provided if it is a granted project.", alias="grantedOrganizationId") - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the authorization belongs to.", alias="organizationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - state: Optional[BetaAuthorizationServiceState] = None - user: Optional[BetaAuthorizationServiceUser] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles contains the roles the user was granted for the project.") - __properties: ClassVar[List[str]] = ["id", "projectId", "projectName", "projectOrganizationId", "projectGrantId", "grantedOrganizationId", "organizationId", "creationDate", "changeDate", "state", "user", "roles"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ID is the unique identifier of the project the user was granted the authorization for.", + ) + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="Name is the name of the project the user was granted the authorization for.", + ) + project_organization_id: Optional[StrictStr] = Field( + default=None, + alias="projectOrganizationId", + description="OrganizationID is the ID of the organization the project belongs to.", + ) + project_grant_id: Optional[StrictStr] = Field( + default=None, + alias="projectGrantId", + description="ID of the granted project, only provided if it is a granted project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="ID of the organization the project is granted to, only provided if it is a granted project.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the authorization belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[BetaAuthorizationServiceState] = Field(default=None, alias="state") + user: Optional[BetaAuthorizationServiceUser] = Field(default=None, alias="user") + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles contains the roles the user was granted for the project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,76 +81,12 @@ class BetaAuthorizationServiceAuthorization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAuthorization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # set to None if project_grant_id (nullable) is None - # and model_fields_set contains the field - if self.project_grant_id is None and "project_grant_id" in self.model_fields_set: - _dict['projectGrantId'] = None - - # set to None if granted_organization_id (nullable) is None - # and model_fields_set contains the field - if self.granted_organization_id is None and "granted_organization_id" in self.model_fields_set: - _dict['grantedOrganizationId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAuthorization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "projectId": obj.get("projectId"), - "projectName": obj.get("projectName"), - "projectOrganizationId": obj.get("projectOrganizationId"), - "projectGrantId": obj.get("projectGrantId"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "organizationId": obj.get("organizationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "state": obj.get("state"), - "user": BetaAuthorizationServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "roles": obj.get("roles") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_authorization_service_state import ( + BetaAuthorizationServiceState, +) +from zitadel_client.models.beta_authorization_service_user import ( + BetaAuthorizationServiceUser, +) +BetaAuthorizationServiceAuthorization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_authorization_field_name.py b/zitadel_client/models/beta_authorization_service_authorization_field_name.py index e7f311e4..1123c4e6 100644 --- a/zitadel_client/models/beta_authorization_service_authorization_field_name.py +++ b/zitadel_client/models/beta_authorization_service_authorization_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAuthorizationServiceAuthorizationFieldName(str, Enum): @@ -23,21 +13,15 @@ class BetaAuthorizationServiceAuthorizationFieldName(str, Enum): BetaAuthorizationServiceAuthorizationFieldName """ - """ - allowed enum values - """ - AUTHORIZATION_FIELD_NAME_UNSPECIFIED = 'AUTHORIZATION_FIELD_NAME_UNSPECIFIED' - AUTHORIZATION_FIELD_NAME_CREATED_DATE = 'AUTHORIZATION_FIELD_NAME_CREATED_DATE' - AUTHORIZATION_FIELD_NAME_CHANGED_DATE = 'AUTHORIZATION_FIELD_NAME_CHANGED_DATE' - AUTHORIZATION_FIELD_NAME_ID = 'AUTHORIZATION_FIELD_NAME_ID' - AUTHORIZATION_FIELD_NAME_USER_ID = 'AUTHORIZATION_FIELD_NAME_USER_ID' - AUTHORIZATION_FIELD_NAME_PROJECT_ID = 'AUTHORIZATION_FIELD_NAME_PROJECT_ID' - AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID' - AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = 'AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAuthorizationServiceAuthorizationFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + AUTHORIZATION_FIELD_NAME_UNSPECIFIED = "AUTHORIZATION_FIELD_NAME_UNSPECIFIED" + AUTHORIZATION_FIELD_NAME_CREATED_DATE = "AUTHORIZATION_FIELD_NAME_CREATED_DATE" + AUTHORIZATION_FIELD_NAME_CHANGED_DATE = "AUTHORIZATION_FIELD_NAME_CHANGED_DATE" + AUTHORIZATION_FIELD_NAME_ID = "AUTHORIZATION_FIELD_NAME_ID" + AUTHORIZATION_FIELD_NAME_USER_ID = "AUTHORIZATION_FIELD_NAME_USER_ID" + AUTHORIZATION_FIELD_NAME_PROJECT_ID = "AUTHORIZATION_FIELD_NAME_PROJECT_ID" + AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID = ( + "AUTHORIZATION_FIELD_NAME_ORGANIZATION_ID" + ) + AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID = ( + "AUTHORIZATION_FIELD_NAME_USER_ORGANIZATION_ID" + ) diff --git a/zitadel_client/models/beta_authorization_service_authorizations_search_filter.py b/zitadel_client/models/beta_authorization_service_authorizations_search_filter.py index c60df891..7c83233f 100644 --- a/zitadel_client/models/beta_authorization_service_authorizations_search_filter.py +++ b/zitadel_client/models/beta_authorization_service_authorizations_search_filter.py @@ -1,52 +1,62 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_id_filter import BetaAuthorizationServiceIDFilter -from zitadel_client.models.beta_authorization_service_in_ids_filter import BetaAuthorizationServiceInIDsFilter -from zitadel_client.models.beta_authorization_service_project_name_query import BetaAuthorizationServiceProjectNameQuery -from zitadel_client.models.beta_authorization_service_role_key_query import BetaAuthorizationServiceRoleKeyQuery -from zitadel_client.models.beta_authorization_service_state_query import BetaAuthorizationServiceStateQuery -from zitadel_client.models.beta_authorization_service_user_display_name_query import BetaAuthorizationServiceUserDisplayNameQuery -from zitadel_client.models.beta_authorization_service_user_preferred_login_name_query import BetaAuthorizationServiceUserPreferredLoginNameQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServiceAuthorizationsSearchFilter(BaseModel): """ BetaAuthorizationServiceAuthorizationsSearchFilter - """ # noqa: E501 - authorization_ids: Optional[BetaAuthorizationServiceInIDsFilter] = Field(default=None, alias="authorizationIds") - in_user_ids: Optional[BetaAuthorizationServiceInIDsFilter] = Field(default=None, alias="inUserIds") - organization_id: Optional[BetaAuthorizationServiceIDFilter] = Field(default=None, alias="organizationId") - project_grant_id: Optional[BetaAuthorizationServiceIDFilter] = Field(default=None, alias="projectGrantId") - project_id: Optional[BetaAuthorizationServiceIDFilter] = Field(default=None, alias="projectId") - project_name: Optional[BetaAuthorizationServiceProjectNameQuery] = Field(default=None, alias="projectName") - role_key: Optional[BetaAuthorizationServiceRoleKeyQuery] = Field(default=None, alias="roleKey") - state: Optional[BetaAuthorizationServiceStateQuery] = None - user_display_name: Optional[BetaAuthorizationServiceUserDisplayNameQuery] = Field(default=None, alias="userDisplayName") - user_id: Optional[BetaAuthorizationServiceIDFilter] = Field(default=None, alias="userId") - user_organization_id: Optional[BetaAuthorizationServiceIDFilter] = Field(default=None, alias="userOrganizationId") - user_preferred_login_name: Optional[BetaAuthorizationServiceUserPreferredLoginNameQuery] = Field(default=None, alias="userPreferredLoginName") - __properties: ClassVar[List[str]] = ["authorizationIds", "inUserIds", "organizationId", "projectGrantId", "projectId", "projectName", "roleKey", "state", "userDisplayName", "userId", "userOrganizationId", "userPreferredLoginName"] + """ + authorization_ids: Optional[BetaAuthorizationServiceInIDsFilter] = Field( + default=None, alias="authorizationIds" + ) + in_user_ids: Optional[BetaAuthorizationServiceInIDsFilter] = Field( + default=None, alias="inUserIds" + ) + organization_id: Optional[BetaAuthorizationServiceIDFilter] = Field( + default=None, alias="organizationId" + ) + project_grant_id: Optional[BetaAuthorizationServiceIDFilter] = Field( + default=None, alias="projectGrantId" + ) + project_id: Optional[BetaAuthorizationServiceIDFilter] = Field( + default=None, alias="projectId" + ) + project_name: Optional[BetaAuthorizationServiceProjectNameQuery] = Field( + default=None, alias="projectName" + ) + role_key: Optional[BetaAuthorizationServiceRoleKeyQuery] = Field( + default=None, alias="roleKey" + ) + state: Optional[BetaAuthorizationServiceStateQuery] = Field( + default=None, alias="state" + ) + user_display_name: Optional[BetaAuthorizationServiceUserDisplayNameQuery] = Field( + default=None, alias="userDisplayName" + ) + user_id: Optional[BetaAuthorizationServiceIDFilter] = Field( + default=None, alias="userId" + ) + user_organization_id: Optional[BetaAuthorizationServiceIDFilter] = Field( + default=None, alias="userOrganizationId" + ) + user_preferred_login_name: Optional[ + BetaAuthorizationServiceUserPreferredLoginNameQuery + ] = Field(default=None, alias="userPreferredLoginName") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -54,99 +64,26 @@ class BetaAuthorizationServiceAuthorizationsSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAuthorizationsSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of authorization_ids - if self.authorization_ids: - _dict['authorizationIds'] = self.authorization_ids.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids - if self.in_user_ids: - _dict['inUserIds'] = self.in_user_ids.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id - if self.organization_id: - _dict['organizationId'] = self.organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant_id - if self.project_grant_id: - _dict['projectGrantId'] = self.project_grant_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_id - if self.project_id: - _dict['projectId'] = self.project_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name - if self.project_name: - _dict['projectName'] = self.project_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key - if self.role_key: - _dict['roleKey'] = self.role_key.to_dict() - # override the default output from pydantic by calling `to_dict()` of state - if self.state: - _dict['state'] = self.state.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_display_name - if self.user_display_name: - _dict['userDisplayName'] = self.user_display_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_id - if self.user_id: - _dict['userId'] = self.user_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_organization_id - if self.user_organization_id: - _dict['userOrganizationId'] = self.user_organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_preferred_login_name - if self.user_preferred_login_name: - _dict['userPreferredLoginName'] = self.user_preferred_login_name.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceAuthorizationsSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authorizationIds": BetaAuthorizationServiceInIDsFilter.from_dict(obj["authorizationIds"]) if obj.get("authorizationIds") is not None else None, - "inUserIds": BetaAuthorizationServiceInIDsFilter.from_dict(obj["inUserIds"]) if obj.get("inUserIds") is not None else None, - "organizationId": BetaAuthorizationServiceIDFilter.from_dict(obj["organizationId"]) if obj.get("organizationId") is not None else None, - "projectGrantId": BetaAuthorizationServiceIDFilter.from_dict(obj["projectGrantId"]) if obj.get("projectGrantId") is not None else None, - "projectId": BetaAuthorizationServiceIDFilter.from_dict(obj["projectId"]) if obj.get("projectId") is not None else None, - "projectName": BetaAuthorizationServiceProjectNameQuery.from_dict(obj["projectName"]) if obj.get("projectName") is not None else None, - "roleKey": BetaAuthorizationServiceRoleKeyQuery.from_dict(obj["roleKey"]) if obj.get("roleKey") is not None else None, - "state": BetaAuthorizationServiceStateQuery.from_dict(obj["state"]) if obj.get("state") is not None else None, - "userDisplayName": BetaAuthorizationServiceUserDisplayNameQuery.from_dict(obj["userDisplayName"]) if obj.get("userDisplayName") is not None else None, - "userId": BetaAuthorizationServiceIDFilter.from_dict(obj["userId"]) if obj.get("userId") is not None else None, - "userOrganizationId": BetaAuthorizationServiceIDFilter.from_dict(obj["userOrganizationId"]) if obj.get("userOrganizationId") is not None else None, - "userPreferredLoginName": BetaAuthorizationServiceUserPreferredLoginNameQuery.from_dict(obj["userPreferredLoginName"]) if obj.get("userPreferredLoginName") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_authorization_service_id_filter import ( + BetaAuthorizationServiceIDFilter, +) +from zitadel_client.models.beta_authorization_service_in_ids_filter import ( + BetaAuthorizationServiceInIDsFilter, +) +from zitadel_client.models.beta_authorization_service_project_name_query import ( + BetaAuthorizationServiceProjectNameQuery, +) +from zitadel_client.models.beta_authorization_service_role_key_query import ( + BetaAuthorizationServiceRoleKeyQuery, +) +from zitadel_client.models.beta_authorization_service_state_query import ( + BetaAuthorizationServiceStateQuery, +) +from zitadel_client.models.beta_authorization_service_user_display_name_query import ( + BetaAuthorizationServiceUserDisplayNameQuery, +) +from zitadel_client.models.beta_authorization_service_user_preferred_login_name_query import ( + BetaAuthorizationServiceUserPreferredLoginNameQuery, +) + +BetaAuthorizationServiceAuthorizationsSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_connect_error.py b/zitadel_client/models/beta_authorization_service_connect_error.py index 234697ca..34fbf426 100644 --- a/zitadel_client/models/beta_authorization_service_connect_error.py +++ b/zitadel_client/models/beta_authorization_service_connect_error.py @@ -1,122 +1,171 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_authorization_service_any import BetaAuthorizationServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaAuthorizationServiceConnectErrorCodeEnum(str, Enum): + """BetaAuthorizationServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaAuthorizationServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaAuthorizationServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaAuthorizationServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaAuthorizationServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaAuthorizationServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_authorization_service_any import ( + BetaAuthorizationServiceAny, +) +BetaAuthorizationServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_create_authorization_request.py b/zitadel_client/models/beta_authorization_service_create_authorization_request.py index 7e53888d..fd8a42a5 100644 --- a/zitadel_client/models/beta_authorization_service_create_authorization_request.py +++ b/zitadel_client/models/beta_authorization_service_create_authorization_request.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaAuthorizationServiceCreateAuthorizationRequest(BaseModel): """ BetaAuthorizationServiceCreateAuthorizationRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should be granted the authorization.", alias="userId") - project_id: Optional[StrictStr] = Field(default=None, description="Project ID is the ID of the project the user should be authorized for.", alias="projectId") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. If omitted, the authorization is created on the projects organization.", alias="organizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys are the keys of the roles the user should be granted.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["userId", "projectId", "organizationId", "roleKeys"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should be granted the authorization.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Project ID is the ID of the project the user should be authorized for.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the ID of the organization on which the authorization should be created. The organization must either own the project or have a grant for the project. If omitted, the authorization is created on the projects organization.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys are the keys of the roles the user should be granted.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,60 +49,4 @@ class BetaAuthorizationServiceCreateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceCreateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if organization_id (nullable) is None - # and model_fields_set contains the field - if self.organization_id is None and "organization_id" in self.model_fields_set: - _dict['organizationId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceCreateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "projectId": obj.get("projectId"), - "organizationId": obj.get("organizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +BetaAuthorizationServiceCreateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_create_authorization_response.py b/zitadel_client/models/beta_authorization_service_create_authorization_response.py index 8a23f119..015fc6ed 100644 --- a/zitadel_client/models/beta_authorization_service_create_authorization_response.py +++ b/zitadel_client/models/beta_authorization_service_create_authorization_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceCreateAuthorizationResponse(BaseModel): """ BetaAuthorizationServiceCreateAuthorizationResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the newly created authorization.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the newly created authorization.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class BetaAuthorizationServiceCreateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceCreateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceCreateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAuthorizationServiceCreateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_deactivate_authorization_request.py b/zitadel_client/models/beta_authorization_service_deactivate_authorization_request.py index ea613ad9..359b60aa 100644 --- a/zitadel_client/models/beta_authorization_service_deactivate_authorization_request.py +++ b/zitadel_client/models/beta_authorization_service_deactivate_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceDeactivateAuthorizationRequest(BaseModel): """ BetaAuthorizationServiceDeactivateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be deactivated.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be deactivated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaAuthorizationServiceDeactivateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeactivateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeactivateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaAuthorizationServiceDeactivateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_deactivate_authorization_response.py b/zitadel_client/models/beta_authorization_service_deactivate_authorization_response.py index 5f417811..0e8acdd3 100644 --- a/zitadel_client/models/beta_authorization_service_deactivate_authorization_response.py +++ b/zitadel_client/models/beta_authorization_service_deactivate_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServiceDeactivateAuthorizationResponse(BaseModel): """ BetaAuthorizationServiceDeactivateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaAuthorizationServiceDeactivateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeactivateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeactivateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAuthorizationServiceDeactivateAuthorizationResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_authorization_service_delete_authorization_request.py b/zitadel_client/models/beta_authorization_service_delete_authorization_request.py index 1879ec8b..878418d5 100644 --- a/zitadel_client/models/beta_authorization_service_delete_authorization_request.py +++ b/zitadel_client/models/beta_authorization_service_delete_authorization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceDeleteAuthorizationRequest(BaseModel): """ BetaAuthorizationServiceDeleteAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization that should be deleted.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization that should be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaAuthorizationServiceDeleteAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeleteAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeleteAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaAuthorizationServiceDeleteAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_delete_authorization_response.py b/zitadel_client/models/beta_authorization_service_delete_authorization_response.py index e7fe1c27..79982723 100644 --- a/zitadel_client/models/beta_authorization_service_delete_authorization_response.py +++ b/zitadel_client/models/beta_authorization_service_delete_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServiceDeleteAuthorizationResponse(BaseModel): """ BetaAuthorizationServiceDeleteAuthorizationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAuthorizationServiceDeleteAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeleteAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceDeleteAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAuthorizationServiceDeleteAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_id_filter.py b/zitadel_client/models/beta_authorization_service_id_filter.py index 37e5dadf..aa9e9696 100644 --- a/zitadel_client/models/beta_authorization_service_id_filter.py +++ b/zitadel_client/models/beta_authorization_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceIDFilter(BaseModel): """ BetaAuthorizationServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaAuthorizationServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaAuthorizationServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_in_ids_filter.py b/zitadel_client/models/beta_authorization_service_in_ids_filter.py index 873668ab..abfe5ea2 100644 --- a/zitadel_client/models/beta_authorization_service_in_ids_filter.py +++ b/zitadel_client/models/beta_authorization_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaAuthorizationServiceInIDsFilter(BaseModel): """ BetaAuthorizationServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaAuthorizationServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +BetaAuthorizationServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_list_authorizations_request.py b/zitadel_client/models/beta_authorization_service_list_authorizations_request.py index e3f358d3..0345caf0 100644 --- a/zitadel_client/models/beta_authorization_service_list_authorizations_request.py +++ b/zitadel_client/models/beta_authorization_service_list_authorizations_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_authorization_service_authorization_field_name import BetaAuthorizationServiceAuthorizationFieldName -from zitadel_client.models.beta_authorization_service_authorizations_search_filter import BetaAuthorizationServiceAuthorizationsSearchFilter -from zitadel_client.models.beta_authorization_service_pagination_request import BetaAuthorizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaAuthorizationServiceListAuthorizationsRequest(BaseModel): """ BetaAuthorizationServiceListAuthorizationsRequest - """ # noqa: E501 - pagination: Optional[BetaAuthorizationServicePaginationRequest] = None - sorting_column: Optional[BetaAuthorizationServiceAuthorizationFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaAuthorizationServiceAuthorizationsSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaAuthorizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaAuthorizationServiceAuthorizationFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaAuthorizationServiceAuthorizationsSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class BetaAuthorizationServiceListAuthorizationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceListAuthorizationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceListAuthorizationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaAuthorizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaAuthorizationServiceAuthorizationsSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_authorization_service_authorization_field_name import ( + BetaAuthorizationServiceAuthorizationFieldName, +) +from zitadel_client.models.beta_authorization_service_authorizations_search_filter import ( + BetaAuthorizationServiceAuthorizationsSearchFilter, +) +from zitadel_client.models.beta_authorization_service_pagination_request import ( + BetaAuthorizationServicePaginationRequest, +) +BetaAuthorizationServiceListAuthorizationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_list_authorizations_response.py b/zitadel_client/models/beta_authorization_service_list_authorizations_response.py index 34dd81d1..abf4b825 100644 --- a/zitadel_client/models/beta_authorization_service_list_authorizations_response.py +++ b/zitadel_client/models/beta_authorization_service_list_authorizations_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_authorization_service_authorization import BetaAuthorizationServiceAuthorization -from zitadel_client.models.beta_authorization_service_pagination_response import BetaAuthorizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaAuthorizationServiceListAuthorizationsResponse(BaseModel): """ BetaAuthorizationServiceListAuthorizationsResponse - """ # noqa: E501 - pagination: Optional[BetaAuthorizationServicePaginationResponse] = None - authorizations: Optional[List[BetaAuthorizationServiceAuthorization]] = None - __properties: ClassVar[List[str]] = ["pagination", "authorizations"] + """ + + pagination: Optional[BetaAuthorizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + authorizations: Optional[List[BetaAuthorizationServiceAuthorization]] = Field( + default=None, alias="authorizations" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaAuthorizationServiceListAuthorizationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceListAuthorizationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in authorizations (list) - _items = [] - if self.authorizations: - for _item_authorizations in self.authorizations: - if _item_authorizations: - _items.append(_item_authorizations.to_dict()) - _dict['authorizations'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceListAuthorizationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaAuthorizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "authorizations": [BetaAuthorizationServiceAuthorization.from_dict(_item) for _item in obj["authorizations"]] if obj.get("authorizations") is not None else None - }) - return _obj - +from zitadel_client.models.beta_authorization_service_authorization import ( + BetaAuthorizationServiceAuthorization, +) +from zitadel_client.models.beta_authorization_service_pagination_response import ( + BetaAuthorizationServicePaginationResponse, +) +BetaAuthorizationServiceListAuthorizationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_pagination_request.py b/zitadel_client/models/beta_authorization_service_pagination_request.py index 33570546..0ca50bc6 100644 --- a/zitadel_client/models/beta_authorization_service_pagination_request.py +++ b/zitadel_client/models/beta_authorization_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaAuthorizationServicePaginationRequest(BaseModel): """ BetaAuthorizationServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaAuthorizationServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaAuthorizationServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_pagination_response.py b/zitadel_client/models/beta_authorization_service_pagination_response.py index 605283e0..868088f8 100644 --- a/zitadel_client/models/beta_authorization_service_pagination_response.py +++ b/zitadel_client/models/beta_authorization_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServicePaginationResponse(BaseModel): """ BetaAuthorizationServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaAuthorizationServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaAuthorizationServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_project_name_query.py b/zitadel_client/models/beta_authorization_service_project_name_query.py index 7c5fdabc..0344ce65 100644 --- a/zitadel_client/models/beta_authorization_service_project_name_query.py +++ b/zitadel_client/models/beta_authorization_service_project_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_text_filter_method import BetaAuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceProjectNameQuery(BaseModel): """ BetaAuthorizationServiceProjectNameQuery - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project.") - method: Optional[BetaAuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Specify the name of the project the user was granted the authorization for to search for. Note that this will also include authorizations granted for project grants of the same project.", + ) + method: Optional[BetaAuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaAuthorizationServiceProjectNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceProjectNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceProjectNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod, +) +BetaAuthorizationServiceProjectNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_role_key_query.py b/zitadel_client/models/beta_authorization_service_role_key_query.py index b8ca0b96..995d4eed 100644 --- a/zitadel_client/models/beta_authorization_service_role_key_query.py +++ b/zitadel_client/models/beta_authorization_service_role_key_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_text_filter_method import BetaAuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceRoleKeyQuery(BaseModel): """ BetaAuthorizationServiceRoleKeyQuery - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Specify the key of the role the user was granted to search for.") - method: Optional[BetaAuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="Specify the key of the role the user was granted to search for.", + ) + method: Optional[BetaAuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaAuthorizationServiceRoleKeyQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceRoleKeyQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceRoleKeyQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod, +) +BetaAuthorizationServiceRoleKeyQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_state.py b/zitadel_client/models/beta_authorization_service_state.py index d640080e..16ba0ed1 100644 --- a/zitadel_client/models/beta_authorization_service_state.py +++ b/zitadel_client/models/beta_authorization_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAuthorizationServiceState(str, Enum): @@ -23,16 +13,6 @@ class BetaAuthorizationServiceState(str, Enum): BetaAuthorizationServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_ACTIVE = 'STATE_ACTIVE' - STATE_INACTIVE = 'STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAuthorizationServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_ACTIVE = "STATE_ACTIVE" + STATE_INACTIVE = "STATE_INACTIVE" diff --git a/zitadel_client/models/beta_authorization_service_state_query.py b/zitadel_client/models/beta_authorization_service_state_query.py index 849d52b1..f30f569c 100644 --- a/zitadel_client/models/beta_authorization_service_state_query.py +++ b/zitadel_client/models/beta_authorization_service_state_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_state import BetaAuthorizationServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaAuthorizationServiceStateQuery(BaseModel): """ BetaAuthorizationServiceStateQuery - """ # noqa: E501 - state: Optional[BetaAuthorizationServiceState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[BetaAuthorizationServiceState] = Field(default=None, alias="state") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,8 @@ class BetaAuthorizationServiceStateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceStateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceStateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.beta_authorization_service_state import ( + BetaAuthorizationServiceState, +) +BetaAuthorizationServiceStateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_text_filter_method.py b/zitadel_client/models/beta_authorization_service_text_filter_method.py index ef551212..849fb2cd 100644 --- a/zitadel_client/models/beta_authorization_service_text_filter_method.py +++ b/zitadel_client/models/beta_authorization_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaAuthorizationServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class BetaAuthorizationServiceTextFilterMethod(str, Enum): BetaAuthorizationServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaAuthorizationServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/beta_authorization_service_update_authorization_request.py b/zitadel_client/models/beta_authorization_service_update_authorization_request.py index 7b0bbe4d..19ba6c00 100644 --- a/zitadel_client/models/beta_authorization_service_update_authorization_request.py +++ b/zitadel_client/models/beta_authorization_service_update_authorization_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaAuthorizationServiceUpdateAuthorizationRequest(BaseModel): """ BetaAuthorizationServiceUpdateAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the authorization.") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["id", "roleKeys"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the authorization.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys are the keys of the roles the user should be granted. Note that any role keys previously granted to the user and not present in the list will be revoked.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaAuthorizationServiceUpdateAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUpdateAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUpdateAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +BetaAuthorizationServiceUpdateAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_update_authorization_response.py b/zitadel_client/models/beta_authorization_service_update_authorization_response.py index e3f0bb39..df32917f 100644 --- a/zitadel_client/models/beta_authorization_service_update_authorization_response.py +++ b/zitadel_client/models/beta_authorization_service_update_authorization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaAuthorizationServiceUpdateAuthorizationResponse(BaseModel): """ BetaAuthorizationServiceUpdateAuthorizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaAuthorizationServiceUpdateAuthorizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUpdateAuthorizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUpdateAuthorizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaAuthorizationServiceUpdateAuthorizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_user.py b/zitadel_client/models/beta_authorization_service_user.py index b06b048b..1449e5e7 100644 --- a/zitadel_client/models/beta_authorization_service_user.py +++ b/zitadel_client/models/beta_authorization_service_user.py @@ -1,38 +1,52 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceUser(BaseModel): """ BetaAuthorizationServiceUser - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID represents the ID of the user who was granted the authorization.") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="PreferredLoginName represents the preferred login name of the granted user.", alias="preferredLoginName") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName represents the public display name of the granted user.", alias="displayName") - avatar_url: Optional[StrictStr] = Field(default=None, description="AvatarURL is the URL to the user's public avatar image.", alias="avatarUrl") - organization_id: Optional[StrictStr] = Field(default=None, description="The organization the user belong to. This does not have to correspond with the authorizations organization.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "preferredLoginName", "displayName", "avatarUrl", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID represents the ID of the user who was granted the authorization.", + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="PreferredLoginName represents the preferred login name of the granted user.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName represents the public display name of the granted user.", + ) + avatar_url: Optional[StrictStr] = Field( + default=None, + alias="avatarUrl", + description="AvatarURL is the URL to the user's public avatar image.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The organization the user belong to. This does not have to correspond with the authorizations organization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +54,4 @@ class BetaAuthorizationServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "preferredLoginName": obj.get("preferredLoginName"), - "displayName": obj.get("displayName"), - "avatarUrl": obj.get("avatarUrl"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaAuthorizationServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_user_display_name_query.py b/zitadel_client/models/beta_authorization_service_user_display_name_query.py index 0d469ea4..78806701 100644 --- a/zitadel_client/models/beta_authorization_service_user_display_name_query.py +++ b/zitadel_client/models/beta_authorization_service_user_display_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_text_filter_method import BetaAuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceUserDisplayNameQuery(BaseModel): """ BetaAuthorizationServiceUserDisplayNameQuery - """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Specify the public display name of the granted user to search for.", alias="displayName") - method: Optional[BetaAuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + """ + + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Specify the public display name of the granted user to search for.", + ) + method: Optional[BetaAuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaAuthorizationServiceUserDisplayNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUserDisplayNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUserDisplayNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod, +) +BetaAuthorizationServiceUserDisplayNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_authorization_service_user_preferred_login_name_query.py b/zitadel_client/models/beta_authorization_service_user_preferred_login_name_query.py index bda2e727..9c94137b 100644 --- a/zitadel_client/models/beta_authorization_service_user_preferred_login_name_query.py +++ b/zitadel_client/models/beta_authorization_service_user_preferred_login_name_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_authorization_service_text_filter_method import BetaAuthorizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaAuthorizationServiceUserPreferredLoginNameQuery(BaseModel): """ BetaAuthorizationServiceUserPreferredLoginNameQuery - """ # noqa: E501 - login_name: Optional[StrictStr] = Field(default=None, description="Specify the preferred login name of the granted user to search for.", alias="loginName") - method: Optional[BetaAuthorizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["loginName", "method"] + """ + + login_name: Optional[StrictStr] = Field( + default=None, + alias="loginName", + description="Specify the preferred login name of the granted user to search for.", + ) + method: Optional[BetaAuthorizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaAuthorizationServiceUserPreferredLoginNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUserPreferredLoginNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaAuthorizationServiceUserPreferredLoginNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_authorization_service_text_filter_method import ( + BetaAuthorizationServiceTextFilterMethod, +) +BetaAuthorizationServiceUserPreferredLoginNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_any.py b/zitadel_client/models/beta_feature_service_any.py index 0345e5b9..08215a6c 100644 --- a/zitadel_client/models/beta_feature_service_any.py +++ b/zitadel_client/models/beta_feature_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaFeatureServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaFeatureServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_connect_error.py b/zitadel_client/models/beta_feature_service_connect_error.py index dc8aff6f..9a185aca 100644 --- a/zitadel_client/models/beta_feature_service_connect_error.py +++ b/zitadel_client/models/beta_feature_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_feature_service_any import BetaFeatureServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaFeatureServiceConnectErrorCodeEnum(str, Enum): + """BetaFeatureServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaFeatureServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaFeatureServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaFeatureServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaFeatureServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaFeatureServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_feature_service_any import BetaFeatureServiceAny +BetaFeatureServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_details.py b/zitadel_client/models/beta_feature_service_details.py index 9212aa28..cd1135d7 100644 --- a/zitadel_client/models/beta_feature_service_details.py +++ b/zitadel_client/models/beta_feature_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaFeatureServiceDetails(BaseModel): """ BetaFeatureServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class BetaFeatureServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaFeatureServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_feature_flag.py b/zitadel_client/models/beta_feature_service_feature_flag.py index 53234d29..e26c2834 100644 --- a/zitadel_client/models/beta_feature_service_feature_flag.py +++ b/zitadel_client/models/beta_feature_service_feature_flag.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_source import BetaFeatureServiceSource -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaFeatureServiceFeatureFlag(BaseModel): """ FeatureFlag is a simple boolean Feature setting, without further payload. - """ # noqa: E501 - enabled: Optional[StrictBool] = None - source: Optional[BetaFeatureServiceSource] = None - __properties: ClassVar[List[str]] = ["enabled", "source"] + """ + enabled: Optional[StrictBool] = Field(default=None, alias="enabled") + source: Optional[BetaFeatureServiceSource] = Field(default=None, alias="source") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,6 @@ class BetaFeatureServiceFeatureFlag(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceFeatureFlag from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceFeatureFlag from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "enabled": obj.get("enabled"), - "source": obj.get("source") - }) - return _obj - +from zitadel_client.models.beta_feature_service_source import BetaFeatureServiceSource +BetaFeatureServiceFeatureFlag.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_instance_features_request.py b/zitadel_client/models/beta_feature_service_get_instance_features_request.py index 5d5ee834..e8aa37d4 100644 --- a/zitadel_client/models/beta_feature_service_get_instance_features_request.py +++ b/zitadel_client/models/beta_feature_service_get_instance_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaFeatureServiceGetInstanceFeaturesRequest(BaseModel): """ BetaFeatureServiceGetInstanceFeaturesRequest - """ # noqa: E501 - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["inheritance"] + """ + + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaFeatureServiceGetInstanceFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetInstanceFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetInstanceFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inheritance": obj.get("inheritance") - }) - return _obj - - +BetaFeatureServiceGetInstanceFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_instance_features_response.py b/zitadel_client/models/beta_feature_service_get_instance_features_response.py index 1302661b..50117fc0 100644 --- a/zitadel_client/models/beta_feature_service_get_instance_features_response.py +++ b/zitadel_client/models/beta_feature_service_get_instance_features_response.py @@ -1,43 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from zitadel_client.models.beta_feature_service_feature_flag import BetaFeatureServiceFeatureFlag -from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import BetaFeatureServiceImprovedPerformanceFeatureFlag -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaFeatureServiceGetInstanceFeaturesResponse(BaseModel): """ BetaFeatureServiceGetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - login_default_org: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="loginDefaultOrg") - user_schema: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="oidcTokenExchange") - improved_performance: Optional[BetaFeatureServiceImprovedPerformanceFeatureFlag] = Field(default=None, alias="improvedPerformance") - debug_oidc_parent_error: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="debugOidcParentError") - oidc_single_v1_session_termination: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="oidcSingleV1SessionTermination") - __properties: ClassVar[List[str]] = ["details", "loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "debugOidcParentError", "oidcSingleV1SessionTermination"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + login_default_org: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="loginDefaultOrg" + ) + user_schema: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="userSchema" + ) + oidc_token_exchange: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="oidcTokenExchange" + ) + improved_performance: Optional[BetaFeatureServiceImprovedPerformanceFeatureFlag] = ( + Field(default=None, alias="improvedPerformance") + ) + debug_oidc_parent_error: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="debugOidcParentError" + ) + oidc_single_v1_session_termination: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,79 +47,12 @@ class BetaFeatureServiceGetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_default_org - if self.login_default_org: - _dict['loginDefaultOrg'] = self.login_default_org.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_schema - if self.user_schema: - _dict['userSchema'] = self.user_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_token_exchange - if self.oidc_token_exchange: - _dict['oidcTokenExchange'] = self.oidc_token_exchange.to_dict() - # override the default output from pydantic by calling `to_dict()` of improved_performance - if self.improved_performance: - _dict['improvedPerformance'] = self.improved_performance.to_dict() - # override the default output from pydantic by calling `to_dict()` of debug_oidc_parent_error - if self.debug_oidc_parent_error: - _dict['debugOidcParentError'] = self.debug_oidc_parent_error.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_single_v1_session_termination - if self.oidc_single_v1_session_termination: - _dict['oidcSingleV1SessionTermination'] = self.oidc_single_v1_session_termination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "loginDefaultOrg": BetaFeatureServiceFeatureFlag.from_dict(obj["loginDefaultOrg"]) if obj.get("loginDefaultOrg") is not None else None, - "userSchema": BetaFeatureServiceFeatureFlag.from_dict(obj["userSchema"]) if obj.get("userSchema") is not None else None, - "oidcTokenExchange": BetaFeatureServiceFeatureFlag.from_dict(obj["oidcTokenExchange"]) if obj.get("oidcTokenExchange") is not None else None, - "improvedPerformance": BetaFeatureServiceImprovedPerformanceFeatureFlag.from_dict(obj["improvedPerformance"]) if obj.get("improvedPerformance") is not None else None, - "debugOidcParentError": BetaFeatureServiceFeatureFlag.from_dict(obj["debugOidcParentError"]) if obj.get("debugOidcParentError") is not None else None, - "oidcSingleV1SessionTermination": BetaFeatureServiceFeatureFlag.from_dict(obj["oidcSingleV1SessionTermination"]) if obj.get("oidcSingleV1SessionTermination") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +from zitadel_client.models.beta_feature_service_feature_flag import ( + BetaFeatureServiceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import ( + BetaFeatureServiceImprovedPerformanceFeatureFlag, +) + +BetaFeatureServiceGetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_organization_features_request.py b/zitadel_client/models/beta_feature_service_get_organization_features_request.py index 2e5fecb4..8c8aedae 100644 --- a/zitadel_client/models/beta_feature_service_get_organization_features_request.py +++ b/zitadel_client/models/beta_feature_service_get_organization_features_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaFeatureServiceGetOrganizationFeaturesRequest(BaseModel): """ BetaFeatureServiceGetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["organizationId", "inheritance"] + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaFeatureServiceGetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "inheritance": obj.get("inheritance") - }) - return _obj - - +BetaFeatureServiceGetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_organization_features_response.py b/zitadel_client/models/beta_feature_service_get_organization_features_response.py index fce850bc..6192a6d6 100644 --- a/zitadel_client/models/beta_feature_service_get_organization_features_response.py +++ b/zitadel_client/models/beta_feature_service_get_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceGetOrganizationFeaturesResponse(BaseModel): """ BetaFeatureServiceGetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceGetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceGetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_system_features_response.py b/zitadel_client/models/beta_feature_service_get_system_features_response.py index 764bcd4f..34b1f099 100644 --- a/zitadel_client/models/beta_feature_service_get_system_features_response.py +++ b/zitadel_client/models/beta_feature_service_get_system_features_response.py @@ -1,42 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from zitadel_client.models.beta_feature_service_feature_flag import BetaFeatureServiceFeatureFlag -from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import BetaFeatureServiceImprovedPerformanceFeatureFlag -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaFeatureServiceGetSystemFeaturesResponse(BaseModel): """ BetaFeatureServiceGetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - login_default_org: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="loginDefaultOrg") - user_schema: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="oidcTokenExchange") - improved_performance: Optional[BetaFeatureServiceImprovedPerformanceFeatureFlag] = Field(default=None, alias="improvedPerformance") - oidc_single_v1_session_termination: Optional[BetaFeatureServiceFeatureFlag] = Field(default=None, alias="oidcSingleV1SessionTermination") - __properties: ClassVar[List[str]] = ["details", "loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "oidcSingleV1SessionTermination"] + """ + + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + login_default_org: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="loginDefaultOrg" + ) + user_schema: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="userSchema" + ) + oidc_token_exchange: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="oidcTokenExchange" + ) + improved_performance: Optional[BetaFeatureServiceImprovedPerformanceFeatureFlag] = ( + Field(default=None, alias="improvedPerformance") + ) + oidc_single_v1_session_termination: Optional[BetaFeatureServiceFeatureFlag] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,75 +44,12 @@ class BetaFeatureServiceGetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_default_org - if self.login_default_org: - _dict['loginDefaultOrg'] = self.login_default_org.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_schema - if self.user_schema: - _dict['userSchema'] = self.user_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_token_exchange - if self.oidc_token_exchange: - _dict['oidcTokenExchange'] = self.oidc_token_exchange.to_dict() - # override the default output from pydantic by calling `to_dict()` of improved_performance - if self.improved_performance: - _dict['improvedPerformance'] = self.improved_performance.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_single_v1_session_termination - if self.oidc_single_v1_session_termination: - _dict['oidcSingleV1SessionTermination'] = self.oidc_single_v1_session_termination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "loginDefaultOrg": BetaFeatureServiceFeatureFlag.from_dict(obj["loginDefaultOrg"]) if obj.get("loginDefaultOrg") is not None else None, - "userSchema": BetaFeatureServiceFeatureFlag.from_dict(obj["userSchema"]) if obj.get("userSchema") is not None else None, - "oidcTokenExchange": BetaFeatureServiceFeatureFlag.from_dict(obj["oidcTokenExchange"]) if obj.get("oidcTokenExchange") is not None else None, - "improvedPerformance": BetaFeatureServiceImprovedPerformanceFeatureFlag.from_dict(obj["improvedPerformance"]) if obj.get("improvedPerformance") is not None else None, - "oidcSingleV1SessionTermination": BetaFeatureServiceFeatureFlag.from_dict(obj["oidcSingleV1SessionTermination"]) if obj.get("oidcSingleV1SessionTermination") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +from zitadel_client.models.beta_feature_service_feature_flag import ( + BetaFeatureServiceFeatureFlag, +) +from zitadel_client.models.beta_feature_service_improved_performance_feature_flag import ( + BetaFeatureServiceImprovedPerformanceFeatureFlag, +) + +BetaFeatureServiceGetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_user_features_request.py b/zitadel_client/models/beta_feature_service_get_user_features_request.py index 1955f97d..d67374ba 100644 --- a/zitadel_client/models/beta_feature_service_get_user_features_request.py +++ b/zitadel_client/models/beta_feature_service_get_user_features_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaFeatureServiceGetUserFeaturesRequest(BaseModel): """ BetaFeatureServiceGetUserFeaturesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["userId", "inheritance"] + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaFeatureServiceGetUserFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetUserFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetUserFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "inheritance": obj.get("inheritance") - }) - return _obj - - +BetaFeatureServiceGetUserFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_get_user_features_response.py b/zitadel_client/models/beta_feature_service_get_user_features_response.py index 83279cd8..ebb48524 100644 --- a/zitadel_client/models/beta_feature_service_get_user_features_response.py +++ b/zitadel_client/models/beta_feature_service_get_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceGetUserFeaturesResponse(BaseModel): """ BetaFeatureServiceGetUserFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceGetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceGetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceGetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_improved_performance.py b/zitadel_client/models/beta_feature_service_improved_performance.py index 775b8cb0..c36db910 100644 --- a/zitadel_client/models/beta_feature_service_improved_performance.py +++ b/zitadel_client/models/beta_feature_service_improved_performance.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaFeatureServiceImprovedPerformance(str, Enum): @@ -23,18 +13,10 @@ class BetaFeatureServiceImprovedPerformance(str, Enum): BetaFeatureServiceImprovedPerformance """ - """ - allowed enum values - """ - IMPROVED_PERFORMANCE_UNSPECIFIED = 'IMPROVED_PERFORMANCE_UNSPECIFIED' - IMPROVED_PERFORMANCE_PROJECT_GRANT = 'IMPROVED_PERFORMANCE_PROJECT_GRANT' - IMPROVED_PERFORMANCE_PROJECT = 'IMPROVED_PERFORMANCE_PROJECT' - IMPROVED_PERFORMANCE_USER_GRANT = 'IMPROVED_PERFORMANCE_USER_GRANT' - IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = 'IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaFeatureServiceImprovedPerformance from a JSON string""" - return cls(json.loads(json_str)) - - + IMPROVED_PERFORMANCE_UNSPECIFIED = "IMPROVED_PERFORMANCE_UNSPECIFIED" + IMPROVED_PERFORMANCE_PROJECT_GRANT = "IMPROVED_PERFORMANCE_PROJECT_GRANT" + IMPROVED_PERFORMANCE_PROJECT = "IMPROVED_PERFORMANCE_PROJECT" + IMPROVED_PERFORMANCE_USER_GRANT = "IMPROVED_PERFORMANCE_USER_GRANT" + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = ( + "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED" + ) diff --git a/zitadel_client/models/beta_feature_service_improved_performance_feature_flag.py b/zitadel_client/models/beta_feature_service_improved_performance_feature_flag.py index cc7c30ef..04cf6c99 100644 --- a/zitadel_client/models/beta_feature_service_improved_performance_feature_flag.py +++ b/zitadel_client/models/beta_feature_service_improved_performance_feature_flag.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_feature_service_improved_performance import BetaFeatureServiceImprovedPerformance -from zitadel_client.models.beta_feature_service_source import BetaFeatureServiceSource -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaFeatureServiceImprovedPerformanceFeatureFlag(BaseModel): """ BetaFeatureServiceImprovedPerformanceFeatureFlag - """ # noqa: E501 - execution_paths: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field(default=None, alias="executionPaths") - source: Optional[BetaFeatureServiceSource] = None - __properties: ClassVar[List[str]] = ["executionPaths", "source"] + """ + execution_paths: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field( + default=None, alias="executionPaths" + ) + source: Optional[BetaFeatureServiceSource] = Field(default=None, alias="source") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +32,9 @@ class BetaFeatureServiceImprovedPerformanceFeatureFlag(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceImprovedPerformanceFeatureFlag from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceImprovedPerformanceFeatureFlag from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionPaths": obj.get("executionPaths"), - "source": obj.get("source") - }) - return _obj - +from zitadel_client.models.beta_feature_service_improved_performance import ( + BetaFeatureServiceImprovedPerformance, +) +from zitadel_client.models.beta_feature_service_source import BetaFeatureServiceSource +BetaFeatureServiceImprovedPerformanceFeatureFlag.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_instance_features_response.py b/zitadel_client/models/beta_feature_service_reset_instance_features_response.py index a9edce24..f42a322e 100644 --- a/zitadel_client/models/beta_feature_service_reset_instance_features_response.py +++ b/zitadel_client/models/beta_feature_service_reset_instance_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceResetInstanceFeaturesResponse(BaseModel): """ BetaFeatureServiceResetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceResetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceResetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_organization_features_request.py b/zitadel_client/models/beta_feature_service_reset_organization_features_request.py index de97e2aa..9add7faa 100644 --- a/zitadel_client/models/beta_feature_service_reset_organization_features_request.py +++ b/zitadel_client/models/beta_feature_service_reset_organization_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaFeatureServiceResetOrganizationFeaturesRequest(BaseModel): """ BetaFeatureServiceResetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaFeatureServiceResetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaFeatureServiceResetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_organization_features_response.py b/zitadel_client/models/beta_feature_service_reset_organization_features_response.py index a56a0d42..04e26f8b 100644 --- a/zitadel_client/models/beta_feature_service_reset_organization_features_response.py +++ b/zitadel_client/models/beta_feature_service_reset_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceResetOrganizationFeaturesResponse(BaseModel): """ BetaFeatureServiceResetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceResetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceResetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_system_features_response.py b/zitadel_client/models/beta_feature_service_reset_system_features_response.py index 5b56236b..d1959a27 100644 --- a/zitadel_client/models/beta_feature_service_reset_system_features_response.py +++ b/zitadel_client/models/beta_feature_service_reset_system_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceResetSystemFeaturesResponse(BaseModel): """ BetaFeatureServiceResetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceResetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceResetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_user_features_request.py b/zitadel_client/models/beta_feature_service_reset_user_features_request.py index f85922d7..4cc15989 100644 --- a/zitadel_client/models/beta_feature_service_reset_user_features_request.py +++ b/zitadel_client/models/beta_feature_service_reset_user_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaFeatureServiceResetUserFeaturesRequest(BaseModel): """ BetaFeatureServiceResetUserFeaturesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaFeatureServiceResetUserFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetUserFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetUserFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaFeatureServiceResetUserFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_reset_user_features_response.py b/zitadel_client/models/beta_feature_service_reset_user_features_response.py index c20ad74d..dbba9b36 100644 --- a/zitadel_client/models/beta_feature_service_reset_user_features_response.py +++ b/zitadel_client/models/beta_feature_service_reset_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceResetUserFeaturesResponse(BaseModel): """ BetaFeatureServiceResetUserFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceResetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceResetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceResetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_instance_features_request.py b/zitadel_client/models/beta_feature_service_set_instance_features_request.py index bb7a5613..8d02f299 100644 --- a/zitadel_client/models/beta_feature_service_set_instance_features_request.py +++ b/zitadel_client/models/beta_feature_service_set_instance_features_request.py @@ -1,40 +1,58 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_feature_service_improved_performance import BetaFeatureServiceImprovedPerformance -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictBool +from typing import Any, List, Optional + class BetaFeatureServiceSetInstanceFeaturesRequest(BaseModel): """ BetaFeatureServiceSetInstanceFeaturesRequest - """ # noqa: E501 - login_default_org: Optional[StrictBool] = Field(default=None, alias="loginDefaultOrg") + """ + + login_default_org: Optional[StrictBool] = Field( + default=None, alias="loginDefaultOrg" + ) user_schema: Optional[StrictBool] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="oidcTokenExchange") - improved_performance: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field(default=None, alias="improvedPerformance") - debug_oidc_parent_error: Optional[StrictBool] = Field(default=None, alias="debugOidcParentError") - oidc_single_v1_session_termination: Optional[StrictBool] = Field(default=None, alias="oidcSingleV1SessionTermination") - __properties: ClassVar[List[str]] = ["loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "debugOidcParentError", "oidcSingleV1SessionTermination"] + # .. deprecated:: This property is deprecated. + oidc_token_exchange: Optional[StrictBool] = Field( + default=None, + alias="oidcTokenExchange", + description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) + improved_performance: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field( + default=None, alias="improvedPerformance" + ) + debug_oidc_parent_error: Optional[StrictBool] = Field( + default=None, alias="debugOidcParentError" + ) + oidc_single_v1_session_termination: Optional[StrictBool] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + @field_validator("oidc_token_exchange") + def oidc_token_exchange_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `oidc_token_exchange` is set.""" + if value is not None: + warnings.warn( + "field 'oidc_token_exchange' on BetaFeatureServiceSetInstanceFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,82 +60,8 @@ class BetaFeatureServiceSetInstanceFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetInstanceFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if login_default_org (nullable) is None - # and model_fields_set contains the field - if self.login_default_org is None and "login_default_org" in self.model_fields_set: - _dict['loginDefaultOrg'] = None - - # set to None if user_schema (nullable) is None - # and model_fields_set contains the field - if self.user_schema is None and "user_schema" in self.model_fields_set: - _dict['userSchema'] = None - - # set to None if oidc_token_exchange (nullable) is None - # and model_fields_set contains the field - if self.oidc_token_exchange is None and "oidc_token_exchange" in self.model_fields_set: - _dict['oidcTokenExchange'] = None - - # set to None if debug_oidc_parent_error (nullable) is None - # and model_fields_set contains the field - if self.debug_oidc_parent_error is None and "debug_oidc_parent_error" in self.model_fields_set: - _dict['debugOidcParentError'] = None - - # set to None if oidc_single_v1_session_termination (nullable) is None - # and model_fields_set contains the field - if self.oidc_single_v1_session_termination is None and "oidc_single_v1_session_termination" in self.model_fields_set: - _dict['oidcSingleV1SessionTermination'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetInstanceFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginDefaultOrg": obj.get("loginDefaultOrg"), - "userSchema": obj.get("userSchema"), - "oidcTokenExchange": obj.get("oidcTokenExchange"), - "improvedPerformance": obj.get("improvedPerformance"), - "debugOidcParentError": obj.get("debugOidcParentError"), - "oidcSingleV1SessionTermination": obj.get("oidcSingleV1SessionTermination") - }) - return _obj - +from zitadel_client.models.beta_feature_service_improved_performance import ( + BetaFeatureServiceImprovedPerformance, +) +BetaFeatureServiceSetInstanceFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_instance_features_response.py b/zitadel_client/models/beta_feature_service_set_instance_features_response.py index 4228738a..b40783ed 100644 --- a/zitadel_client/models/beta_feature_service_set_instance_features_response.py +++ b/zitadel_client/models/beta_feature_service_set_instance_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceSetInstanceFeaturesResponse(BaseModel): """ BetaFeatureServiceSetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceSetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceSetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_organization_features_request.py b/zitadel_client/models/beta_feature_service_set_organization_features_request.py index 090d9919..240e979f 100644 --- a/zitadel_client/models/beta_feature_service_set_organization_features_request.py +++ b/zitadel_client/models/beta_feature_service_set_organization_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaFeatureServiceSetOrganizationFeaturesRequest(BaseModel): """ BetaFeatureServiceSetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaFeatureServiceSetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaFeatureServiceSetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_organization_features_response.py b/zitadel_client/models/beta_feature_service_set_organization_features_response.py index 27da759c..62183877 100644 --- a/zitadel_client/models/beta_feature_service_set_organization_features_response.py +++ b/zitadel_client/models/beta_feature_service_set_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceSetOrganizationFeaturesResponse(BaseModel): """ BetaFeatureServiceSetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceSetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceSetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_system_features_request.py b/zitadel_client/models/beta_feature_service_set_system_features_request.py index 896fefad..ac23ae51 100644 --- a/zitadel_client/models/beta_feature_service_set_system_features_request.py +++ b/zitadel_client/models/beta_feature_service_set_system_features_request.py @@ -1,39 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_feature_service_improved_performance import BetaFeatureServiceImprovedPerformance -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictBool +from typing import Any, List, Optional + class BetaFeatureServiceSetSystemFeaturesRequest(BaseModel): """ BetaFeatureServiceSetSystemFeaturesRequest - """ # noqa: E501 - login_default_org: Optional[StrictBool] = Field(default=None, alias="loginDefaultOrg") + """ + + login_default_org: Optional[StrictBool] = Field( + default=None, alias="loginDefaultOrg" + ) user_schema: Optional[StrictBool] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="oidcTokenExchange") - improved_performance: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field(default=None, alias="improvedPerformance") - oidc_single_v1_session_termination: Optional[StrictBool] = Field(default=None, alias="oidcSingleV1SessionTermination") - __properties: ClassVar[List[str]] = ["loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "oidcSingleV1SessionTermination"] + # .. deprecated:: This property is deprecated. + oidc_token_exchange: Optional[StrictBool] = Field( + default=None, + alias="oidcTokenExchange", + description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) + improved_performance: Optional[List[BetaFeatureServiceImprovedPerformance]] = Field( + default=None, alias="improvedPerformance" + ) + oidc_single_v1_session_termination: Optional[StrictBool] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + @field_validator("oidc_token_exchange") + def oidc_token_exchange_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `oidc_token_exchange` is set.""" + if value is not None: + warnings.warn( + "field 'oidc_token_exchange' on BetaFeatureServiceSetSystemFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,76 +57,8 @@ class BetaFeatureServiceSetSystemFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetSystemFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if login_default_org (nullable) is None - # and model_fields_set contains the field - if self.login_default_org is None and "login_default_org" in self.model_fields_set: - _dict['loginDefaultOrg'] = None - - # set to None if user_schema (nullable) is None - # and model_fields_set contains the field - if self.user_schema is None and "user_schema" in self.model_fields_set: - _dict['userSchema'] = None - - # set to None if oidc_token_exchange (nullable) is None - # and model_fields_set contains the field - if self.oidc_token_exchange is None and "oidc_token_exchange" in self.model_fields_set: - _dict['oidcTokenExchange'] = None - - # set to None if oidc_single_v1_session_termination (nullable) is None - # and model_fields_set contains the field - if self.oidc_single_v1_session_termination is None and "oidc_single_v1_session_termination" in self.model_fields_set: - _dict['oidcSingleV1SessionTermination'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetSystemFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginDefaultOrg": obj.get("loginDefaultOrg"), - "userSchema": obj.get("userSchema"), - "oidcTokenExchange": obj.get("oidcTokenExchange"), - "improvedPerformance": obj.get("improvedPerformance"), - "oidcSingleV1SessionTermination": obj.get("oidcSingleV1SessionTermination") - }) - return _obj - +from zitadel_client.models.beta_feature_service_improved_performance import ( + BetaFeatureServiceImprovedPerformance, +) +BetaFeatureServiceSetSystemFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_system_features_response.py b/zitadel_client/models/beta_feature_service_set_system_features_response.py index eaa23073..50bb9dd0 100644 --- a/zitadel_client/models/beta_feature_service_set_system_features_response.py +++ b/zitadel_client/models/beta_feature_service_set_system_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceSetSystemFeaturesResponse(BaseModel): """ BetaFeatureServiceSetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceSetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceSetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_user_feature_request.py b/zitadel_client/models/beta_feature_service_set_user_feature_request.py index 04cde3fc..df25387d 100644 --- a/zitadel_client/models/beta_feature_service_set_user_feature_request.py +++ b/zitadel_client/models/beta_feature_service_set_user_feature_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaFeatureServiceSetUserFeatureRequest(BaseModel): """ BetaFeatureServiceSetUserFeatureRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaFeatureServiceSetUserFeatureRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetUserFeatureRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetUserFeatureRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaFeatureServiceSetUserFeatureRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_set_user_features_response.py b/zitadel_client/models/beta_feature_service_set_user_features_response.py index 7e946b99..0f78dc12 100644 --- a/zitadel_client/models/beta_feature_service_set_user_features_response.py +++ b/zitadel_client/models/beta_feature_service_set_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaFeatureServiceSetUserFeaturesResponse(BaseModel): """ BetaFeatureServiceSetUserFeaturesResponse - """ # noqa: E501 - details: Optional[BetaFeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaFeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaFeatureServiceSetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaFeatureServiceSetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaFeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_feature_service_details import BetaFeatureServiceDetails +BetaFeatureServiceSetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_feature_service_source.py b/zitadel_client/models/beta_feature_service_source.py index 9d9b9924..2d828e0d 100644 --- a/zitadel_client/models/beta_feature_service_source.py +++ b/zitadel_client/models/beta_feature_service_source.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaFeatureServiceSource(str, Enum): @@ -23,20 +13,10 @@ class BetaFeatureServiceSource(str, Enum): BetaFeatureServiceSource """ - """ - allowed enum values - """ - SOURCE_UNSPECIFIED = 'SOURCE_UNSPECIFIED' - SOURCE_SYSTEM = 'SOURCE_SYSTEM' - SOURCE_INSTANCE = 'SOURCE_INSTANCE' - SOURCE_ORGANIZATION = 'SOURCE_ORGANIZATION' - SOURCE_PROJECT = 'SOURCE_PROJECT' - SOURCE_APP = 'SOURCE_APP' - SOURCE_USER = 'SOURCE_USER' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaFeatureServiceSource from a JSON string""" - return cls(json.loads(json_str)) - - + SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED" + SOURCE_SYSTEM = "SOURCE_SYSTEM" + SOURCE_INSTANCE = "SOURCE_INSTANCE" + SOURCE_ORGANIZATION = "SOURCE_ORGANIZATION" + SOURCE_PROJECT = "SOURCE_PROJECT" + SOURCE_APP = "SOURCE_APP" + SOURCE_USER = "SOURCE_USER" diff --git a/zitadel_client/models/beta_instance_service_add_custom_domain_request.py b/zitadel_client/models/beta_instance_service_add_custom_domain_request.py index 9618b5fe..39dd660d 100644 --- a/zitadel_client/models/beta_instance_service_add_custom_domain_request.py +++ b/zitadel_client/models/beta_instance_service_add_custom_domain_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceAddCustomDomainRequest(BaseModel): """ BetaInstanceServiceAddCustomDomainRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["instanceId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaInstanceServiceAddCustomDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddCustomDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddCustomDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaInstanceServiceAddCustomDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_add_custom_domain_response.py b/zitadel_client/models/beta_instance_service_add_custom_domain_response.py index b7ccd79a..a96b979d 100644 --- a/zitadel_client/models/beta_instance_service_add_custom_domain_response.py +++ b/zitadel_client/models/beta_instance_service_add_custom_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceAddCustomDomainResponse(BaseModel): """ BetaInstanceServiceAddCustomDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceAddCustomDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddCustomDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddCustomDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceAddCustomDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_add_trusted_domain_request.py b/zitadel_client/models/beta_instance_service_add_trusted_domain_request.py index 72c84e36..4981a60c 100644 --- a/zitadel_client/models/beta_instance_service_add_trusted_domain_request.py +++ b/zitadel_client/models/beta_instance_service_add_trusted_domain_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceAddTrustedDomainRequest(BaseModel): """ BetaInstanceServiceAddTrustedDomainRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["instanceId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaInstanceServiceAddTrustedDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddTrustedDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddTrustedDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaInstanceServiceAddTrustedDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_add_trusted_domain_response.py b/zitadel_client/models/beta_instance_service_add_trusted_domain_response.py index 8a754150..62229e4b 100644 --- a/zitadel_client/models/beta_instance_service_add_trusted_domain_response.py +++ b/zitadel_client/models/beta_instance_service_add_trusted_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceAddTrustedDomainResponse(BaseModel): """ BetaInstanceServiceAddTrustedDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceAddTrustedDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddTrustedDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAddTrustedDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceAddTrustedDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_any.py b/zitadel_client/models/beta_instance_service_any.py index debf25a6..a9227414 100644 --- a/zitadel_client/models/beta_instance_service_any.py +++ b/zitadel_client/models/beta_instance_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaInstanceServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaInstanceServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_connect_error.py b/zitadel_client/models/beta_instance_service_connect_error.py index 92b7cbe3..f2afce10 100644 --- a/zitadel_client/models/beta_instance_service_connect_error.py +++ b/zitadel_client/models/beta_instance_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_any import BetaInstanceServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaInstanceServiceConnectErrorCodeEnum(str, Enum): + """BetaInstanceServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaInstanceServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaInstanceServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaInstanceServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaInstanceServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaInstanceServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_instance_service_any import BetaInstanceServiceAny +BetaInstanceServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_delete_instance_request.py b/zitadel_client/models/beta_instance_service_delete_instance_request.py index 01fc55cb..10bed38e 100644 --- a/zitadel_client/models/beta_instance_service_delete_instance_request.py +++ b/zitadel_client/models/beta_instance_service_delete_instance_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceDeleteInstanceRequest(BaseModel): """ BetaInstanceServiceDeleteInstanceRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - __properties: ClassVar[List[str]] = ["instanceId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceDeleteInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDeleteInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDeleteInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId") - }) - return _obj - - +BetaInstanceServiceDeleteInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_delete_instance_response.py b/zitadel_client/models/beta_instance_service_delete_instance_response.py index 1b363ad7..ca83ee7f 100644 --- a/zitadel_client/models/beta_instance_service_delete_instance_response.py +++ b/zitadel_client/models/beta_instance_service_delete_instance_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceDeleteInstanceResponse(BaseModel): """ BetaInstanceServiceDeleteInstanceResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceDeleteInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDeleteInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDeleteInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceDeleteInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domain.py b/zitadel_client/models/beta_instance_service_domain.py index 843f3cb5..e2af5f83 100644 --- a/zitadel_client/models/beta_instance_service_domain.py +++ b/zitadel_client/models/beta_instance_service_domain.py @@ -1,39 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaInstanceServiceDomain(BaseModel): """ BetaInstanceServiceDomain - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - domain: Optional[StrictStr] = None - primary: Optional[StrictBool] = None - generated: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["instanceId", "creationDate", "domain", "primary", "generated"] + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + domain: Optional[StrictStr] = Field(default=None, alias="domain") + primary: Optional[StrictBool] = Field(default=None, alias="primary") + generated: Optional[StrictBool] = Field(default=None, alias="generated") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +38,6 @@ class BetaInstanceServiceDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "creationDate": obj.get("creationDate"), - "domain": obj.get("domain"), - "primary": obj.get("primary"), - "generated": obj.get("generated") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domain_field_name.py b/zitadel_client/models/beta_instance_service_domain_field_name.py index 29266180..78ab57ca 100644 --- a/zitadel_client/models/beta_instance_service_domain_field_name.py +++ b/zitadel_client/models/beta_instance_service_domain_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInstanceServiceDomainFieldName(str, Enum): @@ -23,18 +13,8 @@ class BetaInstanceServiceDomainFieldName(str, Enum): BetaInstanceServiceDomainFieldName """ - """ - allowed enum values - """ - DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' - DOMAIN_FIELD_NAME_DOMAIN = 'DOMAIN_FIELD_NAME_DOMAIN' - DOMAIN_FIELD_NAME_PRIMARY = 'DOMAIN_FIELD_NAME_PRIMARY' - DOMAIN_FIELD_NAME_GENERATED = 'DOMAIN_FIELD_NAME_GENERATED' - DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInstanceServiceDomainFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED" + DOMAIN_FIELD_NAME_DOMAIN = "DOMAIN_FIELD_NAME_DOMAIN" + DOMAIN_FIELD_NAME_PRIMARY = "DOMAIN_FIELD_NAME_PRIMARY" + DOMAIN_FIELD_NAME_GENERATED = "DOMAIN_FIELD_NAME_GENERATED" + DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_instance_service_domain_generated_query.py b/zitadel_client/models/beta_instance_service_domain_generated_query.py index 7dbcc5bd..9533e92c 100644 --- a/zitadel_client/models/beta_instance_service_domain_generated_query.py +++ b/zitadel_client/models/beta_instance_service_domain_generated_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaInstanceServiceDomainGeneratedQuery(BaseModel): """ BetaInstanceServiceDomainGeneratedQuery - """ # noqa: E501 - generated: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["generated"] + """ + + generated: Optional[StrictBool] = Field(default=None, alias="generated") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceDomainGeneratedQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainGeneratedQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainGeneratedQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "generated": obj.get("generated") - }) - return _obj - - +BetaInstanceServiceDomainGeneratedQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domain_primary_query.py b/zitadel_client/models/beta_instance_service_domain_primary_query.py index 34c6dd09..28efba70 100644 --- a/zitadel_client/models/beta_instance_service_domain_primary_query.py +++ b/zitadel_client/models/beta_instance_service_domain_primary_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaInstanceServiceDomainPrimaryQuery(BaseModel): """ BetaInstanceServiceDomainPrimaryQuery - """ # noqa: E501 - primary: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["primary"] + """ + + primary: Optional[StrictBool] = Field(default=None, alias="primary") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceDomainPrimaryQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainPrimaryQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainPrimaryQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "primary": obj.get("primary") - }) - return _obj - - +BetaInstanceServiceDomainPrimaryQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domain_query.py b/zitadel_client/models/beta_instance_service_domain_query.py index 616d7628..c4d9f283 100644 --- a/zitadel_client/models/beta_instance_service_domain_query.py +++ b/zitadel_client/models/beta_instance_service_domain_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_instance_service_text_query_method import BetaInstanceServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceDomainQuery(BaseModel): """ BetaInstanceServiceDomainQuery - """ # noqa: E501 - domain: Optional[StrictStr] = None - method: Optional[BetaInstanceServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["domain", "method"] + """ + domain: Optional[StrictStr] = Field(default=None, alias="domain") + method: Optional[BetaInstanceServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaInstanceServiceDomainQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_instance_service_text_query_method import ( + BetaInstanceServiceTextQueryMethod, +) +BetaInstanceServiceDomainQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domain_search_query.py b/zitadel_client/models/beta_instance_service_domain_search_query.py index 0842e17f..d66a7d6c 100644 --- a/zitadel_client/models/beta_instance_service_domain_search_query.py +++ b/zitadel_client/models/beta_instance_service_domain_search_query.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_instance_service_domain_generated_query import BetaInstanceServiceDomainGeneratedQuery -from zitadel_client.models.beta_instance_service_domain_primary_query import BetaInstanceServiceDomainPrimaryQuery -from zitadel_client.models.beta_instance_service_domain_query import BetaInstanceServiceDomainQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceDomainSearchQuery(BaseModel): """ BetaInstanceServiceDomainSearchQuery - """ # noqa: E501 - domain_query: Optional[BetaInstanceServiceDomainQuery] = Field(default=None, alias="domainQuery") - generated_query: Optional[BetaInstanceServiceDomainGeneratedQuery] = Field(default=None, alias="generatedQuery") - primary_query: Optional[BetaInstanceServiceDomainPrimaryQuery] = Field(default=None, alias="primaryQuery") - __properties: ClassVar[List[str]] = ["domainQuery", "generatedQuery", "primaryQuery"] + """ + + domain_query: Optional[BetaInstanceServiceDomainQuery] = Field( + default=None, alias="domainQuery" + ) + generated_query: Optional[BetaInstanceServiceDomainGeneratedQuery] = Field( + default=None, alias="generatedQuery" + ) + primary_query: Optional[BetaInstanceServiceDomainPrimaryQuery] = Field( + default=None, alias="primaryQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,14 @@ class BetaInstanceServiceDomainSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_query - if self.domain_query: - _dict['domainQuery'] = self.domain_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of generated_query - if self.generated_query: - _dict['generatedQuery'] = self.generated_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of primary_query - if self.primary_query: - _dict['primaryQuery'] = self.primary_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainQuery": BetaInstanceServiceDomainQuery.from_dict(obj["domainQuery"]) if obj.get("domainQuery") is not None else None, - "generatedQuery": BetaInstanceServiceDomainGeneratedQuery.from_dict(obj["generatedQuery"]) if obj.get("generatedQuery") is not None else None, - "primaryQuery": BetaInstanceServiceDomainPrimaryQuery.from_dict(obj["primaryQuery"]) if obj.get("primaryQuery") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_domain_generated_query import ( + BetaInstanceServiceDomainGeneratedQuery, +) +from zitadel_client.models.beta_instance_service_domain_primary_query import ( + BetaInstanceServiceDomainPrimaryQuery, +) +from zitadel_client.models.beta_instance_service_domain_query import ( + BetaInstanceServiceDomainQuery, +) +BetaInstanceServiceDomainSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_domains_query.py b/zitadel_client/models/beta_instance_service_domains_query.py index 1b29cf34..fa109d0a 100644 --- a/zitadel_client/models/beta_instance_service_domains_query.py +++ b/zitadel_client/models/beta_instance_service_domains_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInstanceServiceDomainsQuery(BaseModel): """ BetaInstanceServiceDomainsQuery - """ # noqa: E501 - domains: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["domains"] + """ + + domains: Optional[List[StrictStr]] = Field(default=None, alias="domains") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceDomainsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceDomainsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domains": obj.get("domains") - }) - return _obj - - +BetaInstanceServiceDomainsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_field_name.py b/zitadel_client/models/beta_instance_service_field_name.py index e5a19f49..67fc9b67 100644 --- a/zitadel_client/models/beta_instance_service_field_name.py +++ b/zitadel_client/models/beta_instance_service_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInstanceServiceFieldName(str, Enum): @@ -23,17 +13,7 @@ class BetaInstanceServiceFieldName(str, Enum): BetaInstanceServiceFieldName """ - """ - allowed enum values - """ - FIELD_NAME_UNSPECIFIED = 'FIELD_NAME_UNSPECIFIED' - FIELD_NAME_ID = 'FIELD_NAME_ID' - FIELD_NAME_NAME = 'FIELD_NAME_NAME' - FIELD_NAME_CREATION_DATE = 'FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInstanceServiceFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + FIELD_NAME_UNSPECIFIED = "FIELD_NAME_UNSPECIFIED" + FIELD_NAME_ID = "FIELD_NAME_ID" + FIELD_NAME_NAME = "FIELD_NAME_NAME" + FIELD_NAME_CREATION_DATE = "FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_instance_service_get_instance_request.py b/zitadel_client/models/beta_instance_service_get_instance_request.py index 60287c2d..7fd47ef5 100644 --- a/zitadel_client/models/beta_instance_service_get_instance_request.py +++ b/zitadel_client/models/beta_instance_service_get_instance_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceGetInstanceRequest(BaseModel): """ BetaInstanceServiceGetInstanceRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - __properties: ClassVar[List[str]] = ["instanceId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceGetInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceGetInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceGetInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId") - }) - return _obj - - +BetaInstanceServiceGetInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_get_instance_response.py b/zitadel_client/models/beta_instance_service_get_instance_response.py index 9bc46e5e..e7dfa743 100644 --- a/zitadel_client/models/beta_instance_service_get_instance_response.py +++ b/zitadel_client/models/beta_instance_service_get_instance_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_instance_service_instance import BetaInstanceServiceInstance -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaInstanceServiceGetInstanceResponse(BaseModel): """ BetaInstanceServiceGetInstanceResponse - """ # noqa: E501 - instance: Optional[BetaInstanceServiceInstance] = None - __properties: ClassVar[List[str]] = ["instance"] + """ + instance: Optional[BetaInstanceServiceInstance] = Field( + default=None, alias="instance" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class BetaInstanceServiceGetInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceGetInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of instance - if self.instance: - _dict['instance'] = self.instance.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceGetInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": BetaInstanceServiceInstance.from_dict(obj["instance"]) if obj.get("instance") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_instance import ( + BetaInstanceServiceInstance, +) +BetaInstanceServiceGetInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_ids_query.py b/zitadel_client/models/beta_instance_service_ids_query.py index 25fd0f2a..8bf96c05 100644 --- a/zitadel_client/models/beta_instance_service_ids_query.py +++ b/zitadel_client/models/beta_instance_service_ids_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInstanceServiceIdsQuery(BaseModel): """ BetaInstanceServiceIdsQuery - """ # noqa: E501 - ids: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["ids"] + """ + + ids: Optional[List[StrictStr]] = Field(default=None, alias="ids") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaInstanceServiceIdsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceIdsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceIdsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +BetaInstanceServiceIdsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_instance.py b/zitadel_client/models/beta_instance_service_instance.py index 97bcf0cc..b4359fc3 100644 --- a/zitadel_client/models/beta_instance_service_instance.py +++ b/zitadel_client/models/beta_instance_service_instance.py @@ -1,43 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_domain import BetaInstanceServiceDomain -from zitadel_client.models.beta_instance_service_state import BetaInstanceServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInstanceServiceInstance(BaseModel): """ BetaInstanceServiceInstance - """ # noqa: E501 - id: Optional[StrictStr] = None - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - state: Optional[BetaInstanceServiceState] = None - name: Optional[StrictStr] = None - version: Optional[StrictStr] = None - domains: Optional[List[BetaInstanceServiceDomain]] = None - __properties: ClassVar[List[str]] = ["id", "changeDate", "creationDate", "state", "name", "version", "domains"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[BetaInstanceServiceState] = Field(default=None, alias="state") + name: Optional[StrictStr] = Field(default=None, alias="name") + version: Optional[StrictStr] = Field(default=None, alias="version") + domains: Optional[List[BetaInstanceServiceDomain]] = Field( + default=None, alias="domains" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,65 +46,8 @@ class BetaInstanceServiceInstance(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceInstance from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in domains (list) - _items = [] - if self.domains: - for _item_domains in self.domains: - if _item_domains: - _items.append(_item_domains.to_dict()) - _dict['domains'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceInstance from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "changeDate": obj.get("changeDate"), - "creationDate": obj.get("creationDate"), - "state": obj.get("state"), - "name": obj.get("name"), - "version": obj.get("version"), - "domains": [BetaInstanceServiceDomain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_instance_service_domain import BetaInstanceServiceDomain +from zitadel_client.models.beta_instance_service_state import BetaInstanceServiceState +BetaInstanceServiceInstance.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_custom_domains_request.py b/zitadel_client/models/beta_instance_service_list_custom_domains_request.py index aaa2d443..f34f0b0e 100644 --- a/zitadel_client/models/beta_instance_service_list_custom_domains_request.py +++ b/zitadel_client/models/beta_instance_service_list_custom_domains_request.py @@ -1,40 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_domain_field_name import BetaInstanceServiceDomainFieldName -from zitadel_client.models.beta_instance_service_domain_search_query import BetaInstanceServiceDomainSearchQuery -from zitadel_client.models.beta_instance_service_pagination_request import BetaInstanceServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInstanceServiceListCustomDomainsRequest(BaseModel): """ BetaInstanceServiceListCustomDomainsRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - pagination: Optional[BetaInstanceServicePaginationRequest] = None - sorting_column: Optional[BetaInstanceServiceDomainFieldName] = Field(default=None, alias="sortingColumn") - queries: Optional[List[BetaInstanceServiceDomainSearchQuery]] = Field(default=None, description="Criterias the client is looking for.") - __properties: ClassVar[List[str]] = ["instanceId", "pagination", "sortingColumn", "queries"] + pagination: Optional[BetaInstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaInstanceServiceDomainFieldName] = Field( + default=None, alias="sortingColumn" + ) + queries: Optional[List[BetaInstanceServiceDomainSearchQuery]] = Field( + default=None, + alias="queries", + description="Criterias the client is looking for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +41,14 @@ class BetaInstanceServiceListCustomDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListCustomDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListCustomDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "pagination": BetaInstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "queries": [BetaInstanceServiceDomainSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_domain_field_name import ( + BetaInstanceServiceDomainFieldName, +) +from zitadel_client.models.beta_instance_service_domain_search_query import ( + BetaInstanceServiceDomainSearchQuery, +) +from zitadel_client.models.beta_instance_service_pagination_request import ( + BetaInstanceServicePaginationRequest, +) +BetaInstanceServiceListCustomDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_custom_domains_response.py b/zitadel_client/models/beta_instance_service_list_custom_domains_response.py index 1ca807ce..57ba8f77 100644 --- a/zitadel_client/models/beta_instance_service_list_custom_domains_response.py +++ b/zitadel_client/models/beta_instance_service_list_custom_domains_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_domain import BetaInstanceServiceDomain -from zitadel_client.models.beta_instance_service_pagination_response import BetaInstanceServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaInstanceServiceListCustomDomainsResponse(BaseModel): """ BetaInstanceServiceListCustomDomainsResponse - """ # noqa: E501 - domains: Optional[List[BetaInstanceServiceDomain]] = None - pagination: Optional[BetaInstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["domains", "pagination"] + """ + + domains: Optional[List[BetaInstanceServiceDomain]] = Field( + default=None, alias="domains" + ) + pagination: Optional[BetaInstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class BetaInstanceServiceListCustomDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListCustomDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in domains (list) - _items = [] - if self.domains: - for _item_domains in self.domains: - if _item_domains: - _items.append(_item_domains.to_dict()) - _dict['domains'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListCustomDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domains": [BetaInstanceServiceDomain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None, - "pagination": BetaInstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_domain import BetaInstanceServiceDomain +from zitadel_client.models.beta_instance_service_pagination_response import ( + BetaInstanceServicePaginationResponse, +) +BetaInstanceServiceListCustomDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_instances_request.py b/zitadel_client/models/beta_instance_service_list_instances_request.py index dbb5538e..42a824b5 100644 --- a/zitadel_client/models/beta_instance_service_list_instances_request.py +++ b/zitadel_client/models/beta_instance_service_list_instances_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_field_name import BetaInstanceServiceFieldName -from zitadel_client.models.beta_instance_service_pagination_request import BetaInstanceServicePaginationRequest -from zitadel_client.models.beta_instance_service_query import BetaInstanceServiceQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaInstanceServiceListInstancesRequest(BaseModel): """ BetaInstanceServiceListInstancesRequest - """ # noqa: E501 - queries: Optional[List[BetaInstanceServiceQuery]] = Field(default=None, description="Criterias the client is looking for.") - pagination: Optional[BetaInstanceServicePaginationRequest] = None - sorting_column: Optional[BetaInstanceServiceFieldName] = Field(default=None, alias="sortingColumn") - __properties: ClassVar[List[str]] = ["queries", "pagination", "sortingColumn"] + """ + + queries: Optional[List[BetaInstanceServiceQuery]] = Field( + default=None, + alias="queries", + description="Criterias the client is looking for.", + ) + pagination: Optional[BetaInstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaInstanceServiceFieldName] = Field( + default=None, alias="sortingColumn" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,12 @@ class BetaInstanceServiceListInstancesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListInstancesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListInstancesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [BetaInstanceServiceQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None, - "pagination": BetaInstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn") - }) - return _obj - +from zitadel_client.models.beta_instance_service_field_name import ( + BetaInstanceServiceFieldName, +) +from zitadel_client.models.beta_instance_service_pagination_request import ( + BetaInstanceServicePaginationRequest, +) +from zitadel_client.models.beta_instance_service_query import BetaInstanceServiceQuery +BetaInstanceServiceListInstancesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_instances_response.py b/zitadel_client/models/beta_instance_service_list_instances_response.py index 34fc5d13..e51c6b36 100644 --- a/zitadel_client/models/beta_instance_service_list_instances_response.py +++ b/zitadel_client/models/beta_instance_service_list_instances_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_instance import BetaInstanceServiceInstance -from zitadel_client.models.beta_instance_service_pagination_response import BetaInstanceServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaInstanceServiceListInstancesResponse(BaseModel): """ BetaInstanceServiceListInstancesResponse - """ # noqa: E501 - instances: Optional[List[BetaInstanceServiceInstance]] = Field(default=None, description="The list of instances.") - pagination: Optional[BetaInstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["instances", "pagination"] + """ + + instances: Optional[List[BetaInstanceServiceInstance]] = Field( + default=None, alias="instances", description="The list of instances." + ) + pagination: Optional[BetaInstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaInstanceServiceListInstancesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListInstancesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in instances (list) - _items = [] - if self.instances: - for _item_instances in self.instances: - if _item_instances: - _items.append(_item_instances.to_dict()) - _dict['instances'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListInstancesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instances": [BetaInstanceServiceInstance.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, - "pagination": BetaInstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_instance import ( + BetaInstanceServiceInstance, +) +from zitadel_client.models.beta_instance_service_pagination_response import ( + BetaInstanceServicePaginationResponse, +) +BetaInstanceServiceListInstancesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_trusted_domains_request.py b/zitadel_client/models/beta_instance_service_list_trusted_domains_request.py index 51072849..619e767f 100644 --- a/zitadel_client/models/beta_instance_service_list_trusted_domains_request.py +++ b/zitadel_client/models/beta_instance_service_list_trusted_domains_request.py @@ -1,40 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_pagination_request import BetaInstanceServicePaginationRequest -from zitadel_client.models.beta_instance_service_trusted_domain_field_name import BetaInstanceServiceTrustedDomainFieldName -from zitadel_client.models.beta_instance_service_trusted_domain_search_query import BetaInstanceServiceTrustedDomainSearchQuery -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInstanceServiceListTrustedDomainsRequest(BaseModel): """ BetaInstanceServiceListTrustedDomainsRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - pagination: Optional[BetaInstanceServicePaginationRequest] = None - sorting_column: Optional[BetaInstanceServiceTrustedDomainFieldName] = Field(default=None, alias="sortingColumn") - queries: Optional[List[BetaInstanceServiceTrustedDomainSearchQuery]] = Field(default=None, description="Criterias the client is looking for.") - __properties: ClassVar[List[str]] = ["instanceId", "pagination", "sortingColumn", "queries"] + pagination: Optional[BetaInstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaInstanceServiceTrustedDomainFieldName] = Field( + default=None, alias="sortingColumn" + ) + queries: Optional[List[BetaInstanceServiceTrustedDomainSearchQuery]] = Field( + default=None, + alias="queries", + description="Criterias the client is looking for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +41,14 @@ class BetaInstanceServiceListTrustedDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListTrustedDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListTrustedDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "pagination": BetaInstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "queries": [BetaInstanceServiceTrustedDomainSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_pagination_request import ( + BetaInstanceServicePaginationRequest, +) +from zitadel_client.models.beta_instance_service_trusted_domain_field_name import ( + BetaInstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.beta_instance_service_trusted_domain_search_query import ( + BetaInstanceServiceTrustedDomainSearchQuery, +) +BetaInstanceServiceListTrustedDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_list_trusted_domains_response.py b/zitadel_client/models/beta_instance_service_list_trusted_domains_response.py index 28b55106..74e48360 100644 --- a/zitadel_client/models/beta_instance_service_list_trusted_domains_response.py +++ b/zitadel_client/models/beta_instance_service_list_trusted_domains_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_instance_service_pagination_response import BetaInstanceServicePaginationResponse -from zitadel_client.models.beta_instance_service_trusted_domain import BetaInstanceServiceTrustedDomain -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaInstanceServiceListTrustedDomainsResponse(BaseModel): """ BetaInstanceServiceListTrustedDomainsResponse - """ # noqa: E501 - trusted_domain: Optional[List[BetaInstanceServiceTrustedDomain]] = Field(default=None, alias="trustedDomain") - pagination: Optional[BetaInstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["trustedDomain", "pagination"] + """ + + trusted_domain: Optional[List[BetaInstanceServiceTrustedDomain]] = Field( + default=None, alias="trustedDomain" + ) + pagination: Optional[BetaInstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaInstanceServiceListTrustedDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListTrustedDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in trusted_domain (list) - _items = [] - if self.trusted_domain: - for _item_trusted_domain in self.trusted_domain: - if _item_trusted_domain: - _items.append(_item_trusted_domain.to_dict()) - _dict['trustedDomain'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceListTrustedDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "trustedDomain": [BetaInstanceServiceTrustedDomain.from_dict(_item) for _item in obj["trustedDomain"]] if obj.get("trustedDomain") is not None else None, - "pagination": BetaInstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_pagination_response import ( + BetaInstanceServicePaginationResponse, +) +from zitadel_client.models.beta_instance_service_trusted_domain import ( + BetaInstanceServiceTrustedDomain, +) +BetaInstanceServiceListTrustedDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_pagination_request.py b/zitadel_client/models/beta_instance_service_pagination_request.py index a1b3721a..295b806d 100644 --- a/zitadel_client/models/beta_instance_service_pagination_request.py +++ b/zitadel_client/models/beta_instance_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaInstanceServicePaginationRequest(BaseModel): """ BetaInstanceServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaInstanceServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaInstanceServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_pagination_response.py b/zitadel_client/models/beta_instance_service_pagination_response.py index c2c853db..2e6e163a 100644 --- a/zitadel_client/models/beta_instance_service_pagination_response.py +++ b/zitadel_client/models/beta_instance_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServicePaginationResponse(BaseModel): """ BetaInstanceServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaInstanceServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaInstanceServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_query.py b/zitadel_client/models/beta_instance_service_query.py index 39ae8120..bb22a4fe 100644 --- a/zitadel_client/models/beta_instance_service_query.py +++ b/zitadel_client/models/beta_instance_service_query.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_instance_service_domains_query import BetaInstanceServiceDomainsQuery -from zitadel_client.models.beta_instance_service_ids_query import BetaInstanceServiceIdsQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceQuery(BaseModel): """ BetaInstanceServiceQuery - """ # noqa: E501 - domain_query: Optional[BetaInstanceServiceDomainsQuery] = Field(default=None, alias="domainQuery") - id_query: Optional[BetaInstanceServiceIdsQuery] = Field(default=None, alias="idQuery") - __properties: ClassVar[List[str]] = ["domainQuery", "idQuery"] + """ + + domain_query: Optional[BetaInstanceServiceDomainsQuery] = Field( + default=None, alias="domainQuery" + ) + id_query: Optional[BetaInstanceServiceIdsQuery] = Field( + default=None, alias="idQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class BetaInstanceServiceQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_query - if self.domain_query: - _dict['domainQuery'] = self.domain_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of id_query - if self.id_query: - _dict['idQuery'] = self.id_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainQuery": BetaInstanceServiceDomainsQuery.from_dict(obj["domainQuery"]) if obj.get("domainQuery") is not None else None, - "idQuery": BetaInstanceServiceIdsQuery.from_dict(obj["idQuery"]) if obj.get("idQuery") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_domains_query import ( + BetaInstanceServiceDomainsQuery, +) +from zitadel_client.models.beta_instance_service_ids_query import ( + BetaInstanceServiceIdsQuery, +) +BetaInstanceServiceQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_remove_custom_domain_request.py b/zitadel_client/models/beta_instance_service_remove_custom_domain_request.py index a5e11c11..8e208f76 100644 --- a/zitadel_client/models/beta_instance_service_remove_custom_domain_request.py +++ b/zitadel_client/models/beta_instance_service_remove_custom_domain_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceRemoveCustomDomainRequest(BaseModel): """ BetaInstanceServiceRemoveCustomDomainRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["instanceId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaInstanceServiceRemoveCustomDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveCustomDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveCustomDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaInstanceServiceRemoveCustomDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_remove_custom_domain_response.py b/zitadel_client/models/beta_instance_service_remove_custom_domain_response.py index 954ae20a..21d43c41 100644 --- a/zitadel_client/models/beta_instance_service_remove_custom_domain_response.py +++ b/zitadel_client/models/beta_instance_service_remove_custom_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceRemoveCustomDomainResponse(BaseModel): """ BetaInstanceServiceRemoveCustomDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceRemoveCustomDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveCustomDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveCustomDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceRemoveCustomDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_remove_trusted_domain_request.py b/zitadel_client/models/beta_instance_service_remove_trusted_domain_request.py index 6f398365..5fa551d8 100644 --- a/zitadel_client/models/beta_instance_service_remove_trusted_domain_request.py +++ b/zitadel_client/models/beta_instance_service_remove_trusted_domain_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceRemoveTrustedDomainRequest(BaseModel): """ BetaInstanceServiceRemoveTrustedDomainRequest - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["instanceId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaInstanceServiceRemoveTrustedDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveTrustedDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveTrustedDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaInstanceServiceRemoveTrustedDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_remove_trusted_domain_response.py b/zitadel_client/models/beta_instance_service_remove_trusted_domain_response.py index 86a76bde..5dbb4950 100644 --- a/zitadel_client/models/beta_instance_service_remove_trusted_domain_response.py +++ b/zitadel_client/models/beta_instance_service_remove_trusted_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceRemoveTrustedDomainResponse(BaseModel): """ BetaInstanceServiceRemoveTrustedDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceRemoveTrustedDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveTrustedDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceRemoveTrustedDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceRemoveTrustedDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_state.py b/zitadel_client/models/beta_instance_service_state.py index 0b5af3a6..c3efada1 100644 --- a/zitadel_client/models/beta_instance_service_state.py +++ b/zitadel_client/models/beta_instance_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInstanceServiceState(str, Enum): @@ -23,18 +13,8 @@ class BetaInstanceServiceState(str, Enum): BetaInstanceServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_CREATING = 'STATE_CREATING' - STATE_RUNNING = 'STATE_RUNNING' - STATE_STOPPING = 'STATE_STOPPING' - STATE_STOPPED = 'STATE_STOPPED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInstanceServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_CREATING = "STATE_CREATING" + STATE_RUNNING = "STATE_RUNNING" + STATE_STOPPING = "STATE_STOPPING" + STATE_STOPPED = "STATE_STOPPED" diff --git a/zitadel_client/models/beta_instance_service_text_query_method.py b/zitadel_client/models/beta_instance_service_text_query_method.py index cfd69eda..4fb90237 100644 --- a/zitadel_client/models/beta_instance_service_text_query_method.py +++ b/zitadel_client/models/beta_instance_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInstanceServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class BetaInstanceServiceTextQueryMethod(str, Enum): BetaInstanceServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInstanceServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/beta_instance_service_trusted_domain.py b/zitadel_client/models/beta_instance_service_trusted_domain.py index c45ecbaa..19312185 100644 --- a/zitadel_client/models/beta_instance_service_trusted_domain.py +++ b/zitadel_client/models/beta_instance_service_trusted_domain.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceTrustedDomain(BaseModel): """ BetaInstanceServiceTrustedDomain - """ # noqa: E501 + """ + instance_id: Optional[StrictStr] = Field(default=None, alias="instanceId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["instanceId", "creationDate", "domain"] + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +36,6 @@ class BetaInstanceServiceTrustedDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceTrustedDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceTrustedDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "creationDate": obj.get("creationDate"), - "domain": obj.get("domain") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceTrustedDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_trusted_domain_field_name.py b/zitadel_client/models/beta_instance_service_trusted_domain_field_name.py index 1b394341..58c859b6 100644 --- a/zitadel_client/models/beta_instance_service_trusted_domain_field_name.py +++ b/zitadel_client/models/beta_instance_service_trusted_domain_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInstanceServiceTrustedDomainFieldName(str, Enum): @@ -23,16 +13,6 @@ class BetaInstanceServiceTrustedDomainFieldName(str, Enum): BetaInstanceServiceTrustedDomainFieldName """ - """ - allowed enum values - """ - TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = 'TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED' - TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = 'TRUSTED_DOMAIN_FIELD_NAME_DOMAIN' - TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = 'TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInstanceServiceTrustedDomainFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = "TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED" + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = "TRUSTED_DOMAIN_FIELD_NAME_DOMAIN" + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = "TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_instance_service_trusted_domain_search_query.py b/zitadel_client/models/beta_instance_service_trusted_domain_search_query.py index 64347576..e556f6c7 100644 --- a/zitadel_client/models/beta_instance_service_trusted_domain_search_query.py +++ b/zitadel_client/models/beta_instance_service_trusted_domain_search_query.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_instance_service_domain_query import BetaInstanceServiceDomainQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceTrustedDomainSearchQuery(BaseModel): """ BetaInstanceServiceTrustedDomainSearchQuery - """ # noqa: E501 - domain_query: Optional[BetaInstanceServiceDomainQuery] = Field(default=None, alias="domainQuery") - __properties: ClassVar[List[str]] = ["domainQuery"] + """ + domain_query: Optional[BetaInstanceServiceDomainQuery] = Field( + default=None, alias="domainQuery" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class BetaInstanceServiceTrustedDomainSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceTrustedDomainSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_query - if self.domain_query: - _dict['domainQuery'] = self.domain_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceTrustedDomainSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainQuery": BetaInstanceServiceDomainQuery.from_dict(obj["domainQuery"]) if obj.get("domainQuery") is not None else None - }) - return _obj - +from zitadel_client.models.beta_instance_service_domain_query import ( + BetaInstanceServiceDomainQuery, +) +BetaInstanceServiceTrustedDomainSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_update_instance_request.py b/zitadel_client/models/beta_instance_service_update_instance_request.py index 104d5c4d..08a86465 100644 --- a/zitadel_client/models/beta_instance_service_update_instance_request.py +++ b/zitadel_client/models/beta_instance_service_update_instance_request.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInstanceServiceUpdateInstanceRequest(BaseModel): """ BetaInstanceServiceUpdateInstanceRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="used only to identify the instance to change.", alias="instanceId") + """ + + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="used only to identify the instance to change.", + ) instance_name: Optional[StrictStr] = Field(default=None, alias="instanceName") - __properties: ClassVar[List[str]] = ["instanceId", "instanceName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,4 @@ class BetaInstanceServiceUpdateInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceUpdateInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceUpdateInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "instanceName": obj.get("instanceName") - }) - return _obj - - +BetaInstanceServiceUpdateInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_instance_service_update_instance_response.py b/zitadel_client/models/beta_instance_service_update_instance_response.py index a9c0fb85..23369015 100644 --- a/zitadel_client/models/beta_instance_service_update_instance_response.py +++ b/zitadel_client/models/beta_instance_service_update_instance_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInstanceServiceUpdateInstanceResponse(BaseModel): """ BetaInstanceServiceUpdateInstanceResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaInstanceServiceUpdateInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInstanceServiceUpdateInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInstanceServiceUpdateInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInstanceServiceUpdateInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_administrator.py b/zitadel_client/models/beta_internal_permission_service_administrator.py index d333be46..4c7f5001 100644 --- a/zitadel_client/models/beta_internal_permission_service_administrator.py +++ b/zitadel_client/models/beta_internal_permission_service_administrator.py @@ -1,46 +1,59 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_organization import BetaInternalPermissionServiceOrganization -from zitadel_client.models.beta_internal_permission_service_project import BetaInternalPermissionServiceProject -from zitadel_client.models.beta_internal_permission_service_project_grant import BetaInternalPermissionServiceProjectGrant -from zitadel_client.models.beta_internal_permission_service_user import BetaInternalPermissionServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaInternalPermissionServiceAdministrator(BaseModel): """ BetaInternalPermissionServiceAdministrator - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - user: Optional[BetaInternalPermissionServiceUser] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that were granted to the user for the specified resource.") - instance: Optional[StrictBool] = Field(default=None, description="Instance is returned if the administrator roles were granted on the instance level.") - organization: Optional[BetaInternalPermissionServiceOrganization] = None - project: Optional[BetaInternalPermissionServiceProject] = None - project_grant: Optional[BetaInternalPermissionServiceProjectGrant] = Field(default=None, alias="projectGrant") - __properties: ClassVar[List[str]] = ["creationDate", "changeDate", "user", "roles", "instance", "organization", "project", "projectGrant"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + user: Optional[BetaInternalPermissionServiceUser] = Field( + default=None, alias="user" + ) + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that were granted to the user for the specified resource.", + ) + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Instance is returned if the administrator roles were granted on the instance level.", + ) + organization: Optional[BetaInternalPermissionServiceOrganization] = Field( + default=None, alias="organization" + ) + project: Optional[BetaInternalPermissionServiceProject] = Field( + default=None, alias="project" + ) + project_grant: Optional[BetaInternalPermissionServiceProjectGrant] = Field( + default=None, alias="projectGrant" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,71 +61,18 @@ class BetaInternalPermissionServiceAdministrator(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAdministrator from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of project - if self.project: - _dict['project'] = self.project.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant - if self.project_grant: - _dict['projectGrant'] = self.project_grant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAdministrator from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "user": BetaInternalPermissionServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "roles": obj.get("roles"), - "instance": obj.get("instance"), - "organization": BetaInternalPermissionServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "project": BetaInternalPermissionServiceProject.from_dict(obj["project"]) if obj.get("project") is not None else None, - "projectGrant": BetaInternalPermissionServiceProjectGrant.from_dict(obj["projectGrant"]) if obj.get("projectGrant") is not None else None - }) - return _obj - - +from pydantic import AwareDatetime +from zitadel_client.models.beta_internal_permission_service_organization import ( + BetaInternalPermissionServiceOrganization, +) +from zitadel_client.models.beta_internal_permission_service_project import ( + BetaInternalPermissionServiceProject, +) +from zitadel_client.models.beta_internal_permission_service_project_grant import ( + BetaInternalPermissionServiceProjectGrant, +) +from zitadel_client.models.beta_internal_permission_service_user import ( + BetaInternalPermissionServiceUser, +) + +BetaInternalPermissionServiceAdministrator.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_administrator_field_name.py b/zitadel_client/models/beta_internal_permission_service_administrator_field_name.py index 464df942..284ca8c5 100644 --- a/zitadel_client/models/beta_internal_permission_service_administrator_field_name.py +++ b/zitadel_client/models/beta_internal_permission_service_administrator_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInternalPermissionServiceAdministratorFieldName(str, Enum): @@ -23,17 +13,7 @@ class BetaInternalPermissionServiceAdministratorFieldName(str, Enum): BetaInternalPermissionServiceAdministratorFieldName """ - """ - allowed enum values - """ - ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = 'ADMINISTRATOR_FIELD_NAME_UNSPECIFIED' - ADMINISTRATOR_FIELD_NAME_USER_ID = 'ADMINISTRATOR_FIELD_NAME_USER_ID' - ADMINISTRATOR_FIELD_NAME_CREATION_DATE = 'ADMINISTRATOR_FIELD_NAME_CREATION_DATE' - ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = 'ADMINISTRATOR_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInternalPermissionServiceAdministratorFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = "ADMINISTRATOR_FIELD_NAME_UNSPECIFIED" + ADMINISTRATOR_FIELD_NAME_USER_ID = "ADMINISTRATOR_FIELD_NAME_USER_ID" + ADMINISTRATOR_FIELD_NAME_CREATION_DATE = "ADMINISTRATOR_FIELD_NAME_CREATION_DATE" + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = "ADMINISTRATOR_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/beta_internal_permission_service_administrator_search_filter.py b/zitadel_client/models/beta_internal_permission_service_administrator_search_filter.py index 3e1ac899..14c54934 100644 --- a/zitadel_client/models/beta_internal_permission_service_administrator_search_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_administrator_search_filter.py @@ -1,51 +1,59 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_id_filter import BetaInternalPermissionServiceIDFilter -from zitadel_client.models.beta_internal_permission_service_in_ids_filter import BetaInternalPermissionServiceInIDsFilter -from zitadel_client.models.beta_internal_permission_service_resource_filter import BetaInternalPermissionServiceResourceFilter -from zitadel_client.models.beta_internal_permission_service_role_filter import BetaInternalPermissionServiceRoleFilter -from zitadel_client.models.beta_internal_permission_service_timestamp_filter import BetaInternalPermissionServiceTimestampFilter -from zitadel_client.models.beta_internal_permission_service_user_display_name_filter import BetaInternalPermissionServiceUserDisplayNameFilter -from zitadel_client.models.beta_internal_permission_service_user_preferred_login_name_filter import BetaInternalPermissionServiceUserPreferredLoginNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServiceAdministratorSearchFilter(BaseModel): """ BetaInternalPermissionServiceAdministratorSearchFilter - """ # noqa: E501 - var_and: Optional[BetaInternalPermissionServiceAndFilter] = Field(default=None, alias="and") - change_date: Optional[BetaInternalPermissionServiceTimestampFilter] = Field(default=None, alias="changeDate") - creation_date: Optional[BetaInternalPermissionServiceTimestampFilter] = Field(default=None, alias="creationDate") - in_user_ids_filter: Optional[BetaInternalPermissionServiceInIDsFilter] = Field(default=None, alias="inUserIdsFilter") - var_not: Optional[BetaInternalPermissionServiceNotFilter] = Field(default=None, alias="not") - var_or: Optional[BetaInternalPermissionServiceOrFilter] = Field(default=None, alias="or") - resource: Optional[BetaInternalPermissionServiceResourceFilter] = None - role: Optional[BetaInternalPermissionServiceRoleFilter] = None - user_display_name: Optional[BetaInternalPermissionServiceUserDisplayNameFilter] = Field(default=None, alias="userDisplayName") - user_organization_id: Optional[BetaInternalPermissionServiceIDFilter] = Field(default=None, alias="userOrganizationId") - user_preferred_login_name: Optional[BetaInternalPermissionServiceUserPreferredLoginNameFilter] = Field(default=None, alias="userPreferredLoginName") - __properties: ClassVar[List[str]] = ["and", "changeDate", "creationDate", "inUserIdsFilter", "not", "or", "resource", "role", "userDisplayName", "userOrganizationId", "userPreferredLoginName"] + """ + and_: Optional[BetaInternalPermissionServiceAndFilter] = Field( + default=None, alias="and" + ) + change_date: Optional[BetaInternalPermissionServiceTimestampFilter] = Field( + default=None, alias="changeDate" + ) + creation_date: Optional[BetaInternalPermissionServiceTimestampFilter] = Field( + default=None, alias="creationDate" + ) + in_user_ids_filter: Optional[BetaInternalPermissionServiceInIDsFilter] = Field( + default=None, alias="inUserIdsFilter" + ) + not_: Optional[BetaInternalPermissionServiceNotFilter] = Field( + default=None, alias="not" + ) + or_: Optional[BetaInternalPermissionServiceOrFilter] = Field( + default=None, alias="or" + ) + resource: Optional[BetaInternalPermissionServiceResourceFilter] = Field( + default=None, alias="resource" + ) + role: Optional[BetaInternalPermissionServiceRoleFilter] = Field( + default=None, alias="role" + ) + user_display_name: Optional[BetaInternalPermissionServiceUserDisplayNameFilter] = ( + Field(default=None, alias="userDisplayName") + ) + user_organization_id: Optional[BetaInternalPermissionServiceIDFilter] = Field( + default=None, alias="userOrganizationId" + ) + user_preferred_login_name: Optional[ + BetaInternalPermissionServiceUserPreferredLoginNameFilter + ] = Field(default=None, alias="userPreferredLoginName") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -53,100 +61,35 @@ class BetaInternalPermissionServiceAdministratorSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAdministratorSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: +from zitadel_client.models.beta_internal_permission_service_and_filter import ( + BetaInternalPermissionServiceAndFilter, +) +from zitadel_client.models.beta_internal_permission_service_id_filter import ( + BetaInternalPermissionServiceIDFilter, +) +from zitadel_client.models.beta_internal_permission_service_in_ids_filter import ( + BetaInternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.beta_internal_permission_service_not_filter import ( + BetaInternalPermissionServiceNotFilter, +) +from zitadel_client.models.beta_internal_permission_service_or_filter import ( + BetaInternalPermissionServiceOrFilter, +) +from zitadel_client.models.beta_internal_permission_service_resource_filter import ( + BetaInternalPermissionServiceResourceFilter, +) +from zitadel_client.models.beta_internal_permission_service_role_filter import ( + BetaInternalPermissionServiceRoleFilter, +) +from zitadel_client.models.beta_internal_permission_service_timestamp_filter import ( + BetaInternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.beta_internal_permission_service_user_display_name_filter import ( + BetaInternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.beta_internal_permission_service_user_preferred_login_name_filter import ( + BetaInternalPermissionServiceUserPreferredLoginNameFilter, +) - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of var_and - if self.var_and: - _dict['and'] = self.var_and.to_dict() - # override the default output from pydantic by calling `to_dict()` of change_date - if self.change_date: - _dict['changeDate'] = self.change_date.to_dict() - # override the default output from pydantic by calling `to_dict()` of creation_date - if self.creation_date: - _dict['creationDate'] = self.creation_date.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids_filter - if self.in_user_ids_filter: - _dict['inUserIdsFilter'] = self.in_user_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of var_not - if self.var_not: - _dict['not'] = self.var_not.to_dict() - # override the default output from pydantic by calling `to_dict()` of var_or - if self.var_or: - _dict['or'] = self.var_or.to_dict() - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - # override the default output from pydantic by calling `to_dict()` of role - if self.role: - _dict['role'] = self.role.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_display_name - if self.user_display_name: - _dict['userDisplayName'] = self.user_display_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_organization_id - if self.user_organization_id: - _dict['userOrganizationId'] = self.user_organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_preferred_login_name - if self.user_preferred_login_name: - _dict['userPreferredLoginName'] = self.user_preferred_login_name.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAdministratorSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "and": BetaInternalPermissionServiceAndFilter.from_dict(obj["and"]) if obj.get("and") is not None else None, - "changeDate": BetaInternalPermissionServiceTimestampFilter.from_dict(obj["changeDate"]) if obj.get("changeDate") is not None else None, - "creationDate": BetaInternalPermissionServiceTimestampFilter.from_dict(obj["creationDate"]) if obj.get("creationDate") is not None else None, - "inUserIdsFilter": BetaInternalPermissionServiceInIDsFilter.from_dict(obj["inUserIdsFilter"]) if obj.get("inUserIdsFilter") is not None else None, - "not": BetaInternalPermissionServiceNotFilter.from_dict(obj["not"]) if obj.get("not") is not None else None, - "or": BetaInternalPermissionServiceOrFilter.from_dict(obj["or"]) if obj.get("or") is not None else None, - "resource": BetaInternalPermissionServiceResourceFilter.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "role": BetaInternalPermissionServiceRoleFilter.from_dict(obj["role"]) if obj.get("role") is not None else None, - "userDisplayName": BetaInternalPermissionServiceUserDisplayNameFilter.from_dict(obj["userDisplayName"]) if obj.get("userDisplayName") is not None else None, - "userOrganizationId": BetaInternalPermissionServiceIDFilter.from_dict(obj["userOrganizationId"]) if obj.get("userOrganizationId") is not None else None, - "userPreferredLoginName": BetaInternalPermissionServiceUserPreferredLoginNameFilter.from_dict(obj["userPreferredLoginName"]) if obj.get("userPreferredLoginName") is not None else None - }) - return _obj - -from zitadel_client.models.beta_internal_permission_service_and_filter import BetaInternalPermissionServiceAndFilter -from zitadel_client.models.beta_internal_permission_service_not_filter import BetaInternalPermissionServiceNotFilter -from zitadel_client.models.beta_internal_permission_service_or_filter import BetaInternalPermissionServiceOrFilter -# TODO: Rewrite to not use raise_errors BetaInternalPermissionServiceAdministratorSearchFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_internal_permission_service_and_filter.py b/zitadel_client/models/beta_internal_permission_service_and_filter.py index ed158c17..509eda89 100644 --- a/zitadel_client/models/beta_internal_permission_service_and_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_and_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaInternalPermissionServiceAndFilter(BaseModel): """ BetaInternalPermissionServiceAndFilter - """ # noqa: E501 - queries: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = ( + Field(default=None, alias="queries") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class BetaInternalPermissionServiceAndFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAndFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAndFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [BetaInternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import BetaInternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors BetaInternalPermissionServiceAndFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_internal_permission_service_any.py b/zitadel_client/models/beta_internal_permission_service_any.py index 14462a0c..2fd2e87d 100644 --- a/zitadel_client/models/beta_internal_permission_service_any.py +++ b/zitadel_client/models/beta_internal_permission_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaInternalPermissionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaInternalPermissionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_connect_error.py b/zitadel_client/models/beta_internal_permission_service_connect_error.py index f4ee8b57..b0a4f922 100644 --- a/zitadel_client/models/beta_internal_permission_service_connect_error.py +++ b/zitadel_client/models/beta_internal_permission_service_connect_error.py @@ -1,122 +1,171 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_any import BetaInternalPermissionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaInternalPermissionServiceConnectErrorCodeEnum(str, Enum): + """BetaInternalPermissionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaInternalPermissionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaInternalPermissionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaInternalPermissionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaInternalPermissionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaInternalPermissionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_internal_permission_service_any import ( + BetaInternalPermissionServiceAny, +) +BetaInternalPermissionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_create_administrator_request.py b/zitadel_client/models/beta_internal_permission_service_create_administrator_request.py index 28baee74..ff7f5dbd 100644 --- a/zitadel_client/models/beta_internal_permission_service_create_administrator_request.py +++ b/zitadel_client/models/beta_internal_permission_service_create_administrator_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_resource_type import BetaInternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInternalPermissionServiceCreateAdministratorRequest(BaseModel): """ BetaInternalPermissionServiceCreateAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should be granted the administrator role.", alias="userId") - resource: Optional[BetaInternalPermissionServiceResourceType] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles.") - __properties: ClassVar[List[str]] = ["userId", "resource", "roles"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should be granted the administrator role.", + ) + resource: Optional[BetaInternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,10 @@ class BetaInternalPermissionServiceCreateAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceCreateAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceCreateAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": BetaInternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "roles": obj.get("roles") - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_resource_type import ( + BetaInternalPermissionServiceResourceType, +) +BetaInternalPermissionServiceCreateAdministratorRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_create_administrator_response.py b/zitadel_client/models/beta_internal_permission_service_create_administrator_response.py index 3ec780f2..5b34778d 100644 --- a/zitadel_client/models/beta_internal_permission_service_create_administrator_response.py +++ b/zitadel_client/models/beta_internal_permission_service_create_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServiceCreateAdministratorResponse(BaseModel): """ BetaInternalPermissionServiceCreateAdministratorResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaInternalPermissionServiceCreateAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceCreateAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceCreateAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInternalPermissionServiceCreateAdministratorResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_delete_administrator_request.py b/zitadel_client/models/beta_internal_permission_service_delete_administrator_request.py index e6dd06c3..82d06fc5 100644 --- a/zitadel_client/models/beta_internal_permission_service_delete_administrator_request.py +++ b/zitadel_client/models/beta_internal_permission_service_delete_administrator_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_resource_type import BetaInternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceDeleteAdministratorRequest(BaseModel): """ BetaInternalPermissionServiceDeleteAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should have his administrator roles removed.", alias="userId") - resource: Optional[BetaInternalPermissionServiceResourceType] = None - __properties: ClassVar[List[str]] = ["userId", "resource"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should have his administrator roles removed.", + ) + resource: Optional[BetaInternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +37,10 @@ class BetaInternalPermissionServiceDeleteAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceDeleteAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceDeleteAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": BetaInternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_resource_type import ( + BetaInternalPermissionServiceResourceType, +) +BetaInternalPermissionServiceDeleteAdministratorRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_delete_administrator_response.py b/zitadel_client/models/beta_internal_permission_service_delete_administrator_response.py index d82b7a5f..c46311d9 100644 --- a/zitadel_client/models/beta_internal_permission_service_delete_administrator_response.py +++ b/zitadel_client/models/beta_internal_permission_service_delete_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServiceDeleteAdministratorResponse(BaseModel): """ BetaInternalPermissionServiceDeleteAdministratorResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaInternalPermissionServiceDeleteAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceDeleteAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceDeleteAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInternalPermissionServiceDeleteAdministratorResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_id_filter.py b/zitadel_client/models/beta_internal_permission_service_id_filter.py index e401d2a3..e3f7ad0b 100644 --- a/zitadel_client/models/beta_internal_permission_service_id_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceIDFilter(BaseModel): """ BetaInternalPermissionServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaInternalPermissionServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaInternalPermissionServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_in_ids_filter.py b/zitadel_client/models/beta_internal_permission_service_in_ids_filter.py index af856b00..19d6a959 100644 --- a/zitadel_client/models/beta_internal_permission_service_in_ids_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInternalPermissionServiceInIDsFilter(BaseModel): """ BetaInternalPermissionServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaInternalPermissionServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +BetaInternalPermissionServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_list_administrators_request.py b/zitadel_client/models/beta_internal_permission_service_list_administrators_request.py index ff6f8cd3..ea01fb3a 100644 --- a/zitadel_client/models/beta_internal_permission_service_list_administrators_request.py +++ b/zitadel_client/models/beta_internal_permission_service_list_administrators_request.py @@ -1,39 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_administrator_field_name import BetaInternalPermissionServiceAdministratorFieldName -from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import BetaInternalPermissionServiceAdministratorSearchFilter -from zitadel_client.models.beta_internal_permission_service_pagination_request import BetaInternalPermissionServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaInternalPermissionServiceListAdministratorsRequest(BaseModel): """ BetaInternalPermissionServiceListAdministratorsRequest - """ # noqa: E501 - pagination: Optional[BetaInternalPermissionServicePaginationRequest] = None - sorting_column: Optional[BetaInternalPermissionServiceAdministratorFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = Field(default=None, description="Filter the administrator roles to be returned.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaInternalPermissionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaInternalPermissionServiceAdministratorFieldName] = ( + Field(default=None, alias="sortingColumn") + ) + filters: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = ( + Field( + default=None, + alias="filters", + description="Filter the administrator roles to be returned.", + ) + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +41,14 @@ class BetaInternalPermissionServiceListAdministratorsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceListAdministratorsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceListAdministratorsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaInternalPermissionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaInternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_administrator_field_name import ( + BetaInternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.beta_internal_permission_service_pagination_request import ( + BetaInternalPermissionServicePaginationRequest, +) +BetaInternalPermissionServiceListAdministratorsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_list_administrators_response.py b/zitadel_client/models/beta_internal_permission_service_list_administrators_response.py index 07388c0d..47b39cd0 100644 --- a/zitadel_client/models/beta_internal_permission_service_list_administrators_response.py +++ b/zitadel_client/models/beta_internal_permission_service_list_administrators_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_administrator import BetaInternalPermissionServiceAdministrator -from zitadel_client.models.beta_internal_permission_service_pagination_response import BetaInternalPermissionServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaInternalPermissionServiceListAdministratorsResponse(BaseModel): """ BetaInternalPermissionServiceListAdministratorsResponse - """ # noqa: E501 - pagination: Optional[BetaInternalPermissionServicePaginationResponse] = None - administrators: Optional[List[BetaInternalPermissionServiceAdministrator]] = None - __properties: ClassVar[List[str]] = ["pagination", "administrators"] + """ + + pagination: Optional[BetaInternalPermissionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + administrators: Optional[List[BetaInternalPermissionServiceAdministrator]] = Field( + default=None, alias="administrators" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,13 @@ class BetaInternalPermissionServiceListAdministratorsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceListAdministratorsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in administrators (list) - _items = [] - if self.administrators: - for _item_administrators in self.administrators: - if _item_administrators: - _items.append(_item_administrators.to_dict()) - _dict['administrators'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceListAdministratorsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaInternalPermissionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "administrators": [BetaInternalPermissionServiceAdministrator.from_dict(_item) for _item in obj["administrators"]] if obj.get("administrators") is not None else None - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_administrator import ( + BetaInternalPermissionServiceAdministrator, +) +from zitadel_client.models.beta_internal_permission_service_pagination_response import ( + BetaInternalPermissionServicePaginationResponse, +) +BetaInternalPermissionServiceListAdministratorsResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_not_filter.py b/zitadel_client/models/beta_internal_permission_service_not_filter.py index 278162fc..2e690b9f 100644 --- a/zitadel_client/models/beta_internal_permission_service_not_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_not_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaInternalPermissionServiceNotFilter(BaseModel): """ BetaInternalPermissionServiceNotFilter - """ # noqa: E501 - query: Optional[BetaInternalPermissionServiceAdministratorSearchFilter] = None - __properties: ClassVar[List[str]] = ["query"] + """ + query: Optional[BetaInternalPermissionServiceAdministratorSearchFilter] = Field( + default=None, alias="query" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,58 +31,8 @@ class BetaInternalPermissionServiceNotFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceNotFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceNotFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": BetaInternalPermissionServiceAdministratorSearchFilter.from_dict(obj["query"]) if obj.get("query") is not None else None - }) - return _obj - -from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import BetaInternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors BetaInternalPermissionServiceNotFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_internal_permission_service_or_filter.py b/zitadel_client/models/beta_internal_permission_service_or_filter.py index bef1dd68..896ec3db 100644 --- a/zitadel_client/models/beta_internal_permission_service_or_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_or_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaInternalPermissionServiceOrFilter(BaseModel): """ BetaInternalPermissionServiceOrFilter - """ # noqa: E501 - queries: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[BetaInternalPermissionServiceAdministratorSearchFilter]] = ( + Field(default=None, alias="queries") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class BetaInternalPermissionServiceOrFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import ( + BetaInternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceOrFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceOrFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [BetaInternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.beta_internal_permission_service_administrator_search_filter import BetaInternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors BetaInternalPermissionServiceOrFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_internal_permission_service_organization.py b/zitadel_client/models/beta_internal_permission_service_organization.py index 4794878b..8984c9dc 100644 --- a/zitadel_client/models/beta_internal_permission_service_organization.py +++ b/zitadel_client/models/beta_internal_permission_service_organization.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceOrganization(BaseModel): """ BetaInternalPermissionServiceOrganization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the organization the user was granted the administrator role for.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the organization the user was granted the administrator role for.") - __properties: ClassVar[List[str]] = ["id", "name"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the organization the user was granted the administrator role for.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the name of the organization the user was granted the administrator role for.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaInternalPermissionServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - return _obj - - +BetaInternalPermissionServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_pagination_request.py b/zitadel_client/models/beta_internal_permission_service_pagination_request.py index e41873a2..a12c0314 100644 --- a/zitadel_client/models/beta_internal_permission_service_pagination_request.py +++ b/zitadel_client/models/beta_internal_permission_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaInternalPermissionServicePaginationRequest(BaseModel): """ BetaInternalPermissionServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaInternalPermissionServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaInternalPermissionServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_pagination_response.py b/zitadel_client/models/beta_internal_permission_service_pagination_response.py index 87b42474..958dc7bc 100644 --- a/zitadel_client/models/beta_internal_permission_service_pagination_response.py +++ b/zitadel_client/models/beta_internal_permission_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServicePaginationResponse(BaseModel): """ BetaInternalPermissionServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaInternalPermissionServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaInternalPermissionServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_project.py b/zitadel_client/models/beta_internal_permission_service_project.py index 2d1eb50b..08d681ba 100644 --- a/zitadel_client/models/beta_internal_permission_service_project.py +++ b/zitadel_client/models/beta_internal_permission_service_project.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceProject(BaseModel): """ BetaInternalPermissionServiceProject - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the project the user was granted the administrator role for.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the project the user was granted the administrator role for.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization the project belongs to.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "name", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the project the user was granted the administrator role for.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the name of the project the user was granted the administrator role for.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the ID of the organization the project belongs to.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class BetaInternalPermissionServiceProject(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceProject from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceProject from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaInternalPermissionServiceProject.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_project_grant.py b/zitadel_client/models/beta_internal_permission_service_project_grant.py index 57eed2c5..a34a6aed 100644 --- a/zitadel_client/models/beta_internal_permission_service_project_grant.py +++ b/zitadel_client/models/beta_internal_permission_service_project_grant.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceProjectGrant(BaseModel): """ BetaInternalPermissionServiceProjectGrant - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is required to grant administrator privileges for a specific project.", alias="projectId") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is required to grant administrator privileges for a specific project grant.", alias="organizationId") - __properties: ClassVar[List[str]] = ["projectId", "organizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is required to grant administrator privileges for a specific project.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is required to grant administrator privileges for a specific project grant.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaInternalPermissionServiceProjectGrant(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceProjectGrant from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceProjectGrant from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaInternalPermissionServiceProjectGrant.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_resource_filter.py b/zitadel_client/models/beta_internal_permission_service_resource_filter.py index d5b3b736..e694be5c 100644 --- a/zitadel_client/models/beta_internal_permission_service_resource_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_resource_filter.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaInternalPermissionServiceResourceFilter(BaseModel): """ BetaInternalPermissionServiceResourceFilter - """ # noqa: E501 - instance: Optional[StrictBool] = Field(default=None, description="Search for administrators granted on the instance level.") - organization_id: Optional[StrictStr] = Field(default=None, description="Search for administrators granted on a specific organization.", alias="organizationId") - project_grant_id: Optional[StrictStr] = Field(default=None, description="Search for administrators granted on a specific project grant.", alias="projectGrantId") - project_id: Optional[StrictStr] = Field(default=None, description="Search for administrators granted on a specific project.", alias="projectId") - __properties: ClassVar[List[str]] = ["instance", "organizationId", "projectGrantId", "projectId"] + """ + + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Search for administrators granted on the instance level.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Search for administrators granted on a specific organization.", + ) + project_grant_id: Optional[StrictStr] = Field( + default=None, + alias="projectGrantId", + description="Search for administrators granted on a specific project grant.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Search for administrators granted on a specific project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +49,4 @@ class BetaInternalPermissionServiceResourceFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceResourceFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceResourceFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId"), - "projectGrantId": obj.get("projectGrantId"), - "projectId": obj.get("projectId") - }) - return _obj - - +BetaInternalPermissionServiceResourceFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_resource_type.py b/zitadel_client/models/beta_internal_permission_service_resource_type.py index 2beedbc5..efef75df 100644 --- a/zitadel_client/models/beta_internal_permission_service_resource_type.py +++ b/zitadel_client/models/beta_internal_permission_service_resource_type.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_project_grant import BetaInternalPermissionServiceProjectGrant -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaInternalPermissionServiceResourceType(BaseModel): """ BetaInternalPermissionServiceResourceType - """ # noqa: E501 - instance: Optional[StrictBool] = Field(default=None, description="Instance is the resource type for granting administrator privileges on the instance level.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is required to grant administrator privileges for a specific organization.", alias="organizationId") - project_grant: Optional[BetaInternalPermissionServiceProjectGrant] = Field(default=None, alias="projectGrant") - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is required to grant administrator privileges for a specific project.", alias="projectId") - __properties: ClassVar[List[str]] = ["instance", "organizationId", "projectGrant", "projectId"] + """ + + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Instance is the resource type for granting administrator privileges on the instance level.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is required to grant administrator privileges for a specific organization.", + ) + project_grant: Optional[BetaInternalPermissionServiceProjectGrant] = Field( + default=None, alias="projectGrant" + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is required to grant administrator privileges for a specific project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +47,8 @@ class BetaInternalPermissionServiceResourceType(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceResourceType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project_grant - if self.project_grant: - _dict['projectGrant'] = self.project_grant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceResourceType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId"), - "projectGrant": BetaInternalPermissionServiceProjectGrant.from_dict(obj["projectGrant"]) if obj.get("projectGrant") is not None else None, - "projectId": obj.get("projectId") - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_project_grant import ( + BetaInternalPermissionServiceProjectGrant, +) +BetaInternalPermissionServiceResourceType.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_role_filter.py b/zitadel_client/models/beta_internal_permission_service_role_filter.py index 48fcd7f8..2d4fa893 100644 --- a/zitadel_client/models/beta_internal_permission_service_role_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_role_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceRoleFilter(BaseModel): """ BetaInternalPermissionServiceRoleFilter - """ # noqa: E501 - role_key: Optional[StrictStr] = Field(default=None, description="Search for administrators by the granted role.", alias="roleKey") - __properties: ClassVar[List[str]] = ["roleKey"] + """ + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="Search for administrators by the granted role.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaInternalPermissionServiceRoleFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceRoleFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceRoleFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "roleKey": obj.get("roleKey") - }) - return _obj - - +BetaInternalPermissionServiceRoleFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_text_filter_method.py b/zitadel_client/models/beta_internal_permission_service_text_filter_method.py index aacf473e..82342d70 100644 --- a/zitadel_client/models/beta_internal_permission_service_text_filter_method.py +++ b/zitadel_client/models/beta_internal_permission_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInternalPermissionServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class BetaInternalPermissionServiceTextFilterMethod(str, Enum): BetaInternalPermissionServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInternalPermissionServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/beta_internal_permission_service_timestamp_filter.py b/zitadel_client/models/beta_internal_permission_service_timestamp_filter.py index 61c399d3..43c52c2b 100644 --- a/zitadel_client/models/beta_internal_permission_service_timestamp_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_timestamp_filter.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_timestamp_filter_method import BetaInternalPermissionServiceTimestampFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServiceTimestampFilter(BaseModel): """ BetaInternalPermissionServiceTimestampFilter - """ # noqa: E501 - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - method: Optional[BetaInternalPermissionServiceTimestampFilterMethod] = None - __properties: ClassVar[List[str]] = ["timestamp", "method"] + """ + + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[BetaInternalPermissionServiceTimestampFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class BetaInternalPermissionServiceTimestampFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceTimestampFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceTimestampFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_internal_permission_service_timestamp_filter_method import ( + BetaInternalPermissionServiceTimestampFilterMethod, +) +BetaInternalPermissionServiceTimestampFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_timestamp_filter_method.py b/zitadel_client/models/beta_internal_permission_service_timestamp_filter_method.py index d7e401f2..55113589 100644 --- a/zitadel_client/models/beta_internal_permission_service_timestamp_filter_method.py +++ b/zitadel_client/models/beta_internal_permission_service_timestamp_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaInternalPermissionServiceTimestampFilterMethod(str, Enum): @@ -23,18 +13,10 @@ class BetaInternalPermissionServiceTimestampFilterMethod(str, Enum): BetaInternalPermissionServiceTimestampFilterMethod """ - """ - allowed enum values - """ - TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' - TIMESTAMP_FILTER_METHOD_GREATER = 'TIMESTAMP_FILTER_METHOD_GREATER' - TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS' - TIMESTAMP_FILTER_METHOD_LESS = 'TIMESTAMP_FILTER_METHOD_LESS' - TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaInternalPermissionServiceTimestampFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS" + TIMESTAMP_FILTER_METHOD_GREATER = "TIMESTAMP_FILTER_METHOD_GREATER" + TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS = ( + "TIMESTAMP_FILTER_METHOD_GREATER_OR_EQUALS" + ) + TIMESTAMP_FILTER_METHOD_LESS = "TIMESTAMP_FILTER_METHOD_LESS" + TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_LESS_OR_EQUALS" diff --git a/zitadel_client/models/beta_internal_permission_service_update_administrator_request.py b/zitadel_client/models/beta_internal_permission_service_update_administrator_request.py index a46c6cef..b49440d1 100644 --- a/zitadel_client/models/beta_internal_permission_service_update_administrator_request.py +++ b/zitadel_client/models/beta_internal_permission_service_update_administrator_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_internal_permission_service_resource_type import BetaInternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaInternalPermissionServiceUpdateAdministratorRequest(BaseModel): """ BetaInternalPermissionServiceUpdateAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should have his administrator roles update.", alias="userId") - resource: Optional[BetaInternalPermissionServiceResourceType] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked.") - __properties: ClassVar[List[str]] = ["userId", "resource", "roles"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should have his administrator roles update.", + ) + resource: Optional[BetaInternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,10 @@ class BetaInternalPermissionServiceUpdateAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUpdateAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUpdateAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": BetaInternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "roles": obj.get("roles") - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_resource_type import ( + BetaInternalPermissionServiceResourceType, +) +BetaInternalPermissionServiceUpdateAdministratorRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_update_administrator_response.py b/zitadel_client/models/beta_internal_permission_service_update_administrator_response.py index 81e23a6f..5d0c2c00 100644 --- a/zitadel_client/models/beta_internal_permission_service_update_administrator_response.py +++ b/zitadel_client/models/beta_internal_permission_service_update_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaInternalPermissionServiceUpdateAdministratorResponse(BaseModel): """ BetaInternalPermissionServiceUpdateAdministratorResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaInternalPermissionServiceUpdateAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUpdateAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUpdateAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaInternalPermissionServiceUpdateAdministratorResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_internal_permission_service_user.py b/zitadel_client/models/beta_internal_permission_service_user.py index f4559b09..d100880e 100644 --- a/zitadel_client/models/beta_internal_permission_service_user.py +++ b/zitadel_client/models/beta_internal_permission_service_user.py @@ -1,37 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceUser(BaseModel): """ BetaInternalPermissionServiceUser - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the user.") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance.", alias="preferredLoginName") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address.", alias="displayName") - organization_id: Optional[StrictStr] = Field(default=None, description="The organization the user belong to.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "preferredLoginName", "displayName", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="ID is the unique identifier of the user." + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The organization the user belong to.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +47,4 @@ class BetaInternalPermissionServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "preferredLoginName": obj.get("preferredLoginName"), - "displayName": obj.get("displayName"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaInternalPermissionServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_user_display_name_filter.py b/zitadel_client/models/beta_internal_permission_service_user_display_name_filter.py index 7645cc94..231c1666 100644 --- a/zitadel_client/models/beta_internal_permission_service_user_display_name_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_user_display_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_text_filter_method import BetaInternalPermissionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceUserDisplayNameFilter(BaseModel): """ BetaInternalPermissionServiceUserDisplayNameFilter - """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Search for administrators by the display name of the user.", alias="displayName") - method: Optional[BetaInternalPermissionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + """ + + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Search for administrators by the display name of the user.", + ) + method: Optional[BetaInternalPermissionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaInternalPermissionServiceUserDisplayNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUserDisplayNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUserDisplayNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_text_filter_method import ( + BetaInternalPermissionServiceTextFilterMethod, +) +BetaInternalPermissionServiceUserDisplayNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_internal_permission_service_user_preferred_login_name_filter.py b/zitadel_client/models/beta_internal_permission_service_user_preferred_login_name_filter.py index 96e8bb3f..a24243d6 100644 --- a/zitadel_client/models/beta_internal_permission_service_user_preferred_login_name_filter.py +++ b/zitadel_client/models/beta_internal_permission_service_user_preferred_login_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_internal_permission_service_text_filter_method import BetaInternalPermissionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaInternalPermissionServiceUserPreferredLoginNameFilter(BaseModel): """ BetaInternalPermissionServiceUserPreferredLoginNameFilter - """ # noqa: E501 - preferred_login_name: Optional[StrictStr] = Field(default=None, description="Search for administrators by the preferred login name of the user.", alias="preferredLoginName") - method: Optional[BetaInternalPermissionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["preferredLoginName", "method"] + """ + + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="Search for administrators by the preferred login name of the user.", + ) + method: Optional[BetaInternalPermissionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,10 @@ class BetaInternalPermissionServiceUserPreferredLoginNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUserPreferredLoginNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaInternalPermissionServiceUserPreferredLoginNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "preferredLoginName": obj.get("preferredLoginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_internal_permission_service_text_filter_method import ( + BetaInternalPermissionServiceTextFilterMethod, +) +BetaInternalPermissionServiceUserPreferredLoginNameFilter.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_oidc_service_any.py b/zitadel_client/models/beta_oidc_service_any.py index 93cde67e..ec3f238c 100644 --- a/zitadel_client/models/beta_oidc_service_any.py +++ b/zitadel_client/models/beta_oidc_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaOIDCServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaOIDCServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_auth_request.py b/zitadel_client/models/beta_oidc_service_auth_request.py index b7efe66e..8a4e866b 100644 --- a/zitadel_client/models/beta_oidc_service_auth_request.py +++ b/zitadel_client/models/beta_oidc_service_auth_request.py @@ -1,45 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_oidc_service_prompt import BetaOIDCServicePrompt -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOIDCServiceAuthRequest(BaseModel): """ BetaOIDCServiceAuthRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) client_id: Optional[StrictStr] = Field(default=None, alias="clientId") - scope: Optional[List[StrictStr]] = None + scope: Optional[List[StrictStr]] = Field(default=None, alias="scope") redirect_uri: Optional[StrictStr] = Field(default=None, alias="redirectUri") - prompt: Optional[List[BetaOIDCServicePrompt]] = None + prompt: Optional[List[BetaOIDCServicePrompt]] = Field(default=None, alias="prompt") ui_locales: Optional[List[StrictStr]] = Field(default=None, alias="uiLocales") login_hint: Optional[StrictStr] = Field(default=None, alias="loginHint") - max_age: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="maxAge") + max_age: Optional[ProtobufDuration] = Field( + default=None, + alias="maxAge", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) hint_user_id: Optional[StrictStr] = Field(default=None, alias="hintUserId") - __properties: ClassVar[List[str]] = ["id", "creationDate", "clientId", "scope", "redirectUri", "prompt", "uiLocales", "loginHint", "maxAge", "hintUserId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,71 +47,8 @@ class BetaOIDCServiceAuthRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAuthRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if login_hint (nullable) is None - # and model_fields_set contains the field - if self.login_hint is None and "login_hint" in self.model_fields_set: - _dict['loginHint'] = None - - # set to None if hint_user_id (nullable) is None - # and model_fields_set contains the field - if self.hint_user_id is None and "hint_user_id" in self.model_fields_set: - _dict['hintUserId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAuthRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "clientId": obj.get("clientId"), - "scope": obj.get("scope"), - "redirectUri": obj.get("redirectUri"), - "prompt": obj.get("prompt"), - "uiLocales": obj.get("uiLocales"), - "loginHint": obj.get("loginHint"), - "maxAge": obj.get("maxAge"), - "hintUserId": obj.get("hintUserId") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_oidc_service_prompt import BetaOIDCServicePrompt +BetaOIDCServiceAuthRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_authorization_error.py b/zitadel_client/models/beta_oidc_service_authorization_error.py index 6c7f3005..3840bf9c 100644 --- a/zitadel_client/models/beta_oidc_service_authorization_error.py +++ b/zitadel_client/models/beta_oidc_service_authorization_error.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_oidc_service_error_reason import BetaOIDCServiceErrorReason -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceAuthorizationError(BaseModel): """ BetaOIDCServiceAuthorizationError - """ # noqa: E501 - error: Optional[BetaOIDCServiceErrorReason] = None - error_description: Optional[StrictStr] = Field(default=None, alias="errorDescription") + """ + + error: Optional[BetaOIDCServiceErrorReason] = Field(default=None, alias="error") + error_description: Optional[StrictStr] = Field( + default=None, alias="errorDescription" + ) error_uri: Optional[StrictStr] = Field(default=None, alias="errorUri") - __properties: ClassVar[List[str]] = ["error", "errorDescription", "errorUri"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +34,8 @@ class BetaOIDCServiceAuthorizationError(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAuthorizationError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if error_description (nullable) is None - # and model_fields_set contains the field - if self.error_description is None and "error_description" in self.model_fields_set: - _dict['errorDescription'] = None - - # set to None if error_uri (nullable) is None - # and model_fields_set contains the field - if self.error_uri is None and "error_uri" in self.model_fields_set: - _dict['errorUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceAuthorizationError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "error": obj.get("error"), - "errorDescription": obj.get("errorDescription"), - "errorUri": obj.get("errorUri") - }) - return _obj - +from zitadel_client.models.beta_oidc_service_error_reason import ( + BetaOIDCServiceErrorReason, +) +BetaOIDCServiceAuthorizationError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_connect_error.py b/zitadel_client/models/beta_oidc_service_connect_error.py index 33bffff6..5fb08d7d 100644 --- a/zitadel_client/models/beta_oidc_service_connect_error.py +++ b/zitadel_client/models/beta_oidc_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_oidc_service_any import BetaOIDCServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaOIDCServiceConnectErrorCodeEnum(str, Enum): + """BetaOIDCServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaOIDCServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaOIDCServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaOIDCServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaOIDCServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaOIDCServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_oidc_service_any import BetaOIDCServiceAny +BetaOIDCServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_create_callback_request.py b/zitadel_client/models/beta_oidc_service_create_callback_request.py index b2f71404..06ee19ce 100644 --- a/zitadel_client/models/beta_oidc_service_create_callback_request.py +++ b/zitadel_client/models/beta_oidc_service_create_callback_request.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_oidc_service_authorization_error import BetaOIDCServiceAuthorizationError -from zitadel_client.models.beta_oidc_service_session import BetaOIDCServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceCreateCallbackRequest(BaseModel): """ BetaOIDCServiceCreateCallbackRequest - """ # noqa: E501 + """ + auth_request_id: Optional[StrictStr] = Field(default=None, alias="authRequestId") - error: Optional[BetaOIDCServiceAuthorizationError] = None - session: Optional[BetaOIDCServiceSession] = None - __properties: ClassVar[List[str]] = ["authRequestId", "error", "session"] + error: Optional[BetaOIDCServiceAuthorizationError] = Field( + default=None, alias="error" + ) + session: Optional[BetaOIDCServiceSession] = Field(default=None, alias="session") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +34,9 @@ class BetaOIDCServiceCreateCallbackRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceCreateCallbackRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of error - if self.error: - _dict['error'] = self.error.to_dict() - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceCreateCallbackRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequestId": obj.get("authRequestId"), - "error": BetaOIDCServiceAuthorizationError.from_dict(obj["error"]) if obj.get("error") is not None else None, - "session": BetaOIDCServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.beta_oidc_service_authorization_error import ( + BetaOIDCServiceAuthorizationError, +) +from zitadel_client.models.beta_oidc_service_session import BetaOIDCServiceSession +BetaOIDCServiceCreateCallbackRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_create_callback_response.py b/zitadel_client/models/beta_oidc_service_create_callback_response.py index 958c88c5..1b751673 100644 --- a/zitadel_client/models/beta_oidc_service_create_callback_response.py +++ b/zitadel_client/models/beta_oidc_service_create_callback_response.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_oidc_service_details import BetaOIDCServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceCreateCallbackResponse(BaseModel): """ BetaOIDCServiceCreateCallbackResponse - """ # noqa: E501 - details: Optional[BetaOIDCServiceDetails] = None + """ + + details: Optional[BetaOIDCServiceDetails] = Field(default=None, alias="details") callback_url: Optional[StrictStr] = Field(default=None, alias="callbackUrl") - __properties: ClassVar[List[str]] = ["details", "callbackUrl"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +31,6 @@ class BetaOIDCServiceCreateCallbackResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceCreateCallbackResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceCreateCallbackResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaOIDCServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "callbackUrl": obj.get("callbackUrl") - }) - return _obj - +from zitadel_client.models.beta_oidc_service_details import BetaOIDCServiceDetails +BetaOIDCServiceCreateCallbackResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_details.py b/zitadel_client/models/beta_oidc_service_details.py index cc4b4b68..432aabc0 100644 --- a/zitadel_client/models/beta_oidc_service_details.py +++ b/zitadel_client/models/beta_oidc_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceDetails(BaseModel): """ BetaOIDCServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class BetaOIDCServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOIDCServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_error_reason.py b/zitadel_client/models/beta_oidc_service_error_reason.py index 255eaa12..4004d96b 100644 --- a/zitadel_client/models/beta_oidc_service_error_reason.py +++ b/zitadel_client/models/beta_oidc_service_error_reason.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOIDCServiceErrorReason(str, Enum): @@ -23,30 +13,20 @@ class BetaOIDCServiceErrorReason(str, Enum): BetaOIDCServiceErrorReason """ - """ - allowed enum values - """ - ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' - ERROR_REASON_INVALID_REQUEST = 'ERROR_REASON_INVALID_REQUEST' - ERROR_REASON_UNAUTHORIZED_CLIENT = 'ERROR_REASON_UNAUTHORIZED_CLIENT' - ERROR_REASON_ACCESS_DENIED = 'ERROR_REASON_ACCESS_DENIED' - ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = 'ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE' - ERROR_REASON_INVALID_SCOPE = 'ERROR_REASON_INVALID_SCOPE' - ERROR_REASON_SERVER_ERROR = 'ERROR_REASON_SERVER_ERROR' - ERROR_REASON_TEMPORARY_UNAVAILABLE = 'ERROR_REASON_TEMPORARY_UNAVAILABLE' - ERROR_REASON_INTERACTION_REQUIRED = 'ERROR_REASON_INTERACTION_REQUIRED' - ERROR_REASON_LOGIN_REQUIRED = 'ERROR_REASON_LOGIN_REQUIRED' - ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = 'ERROR_REASON_ACCOUNT_SELECTION_REQUIRED' - ERROR_REASON_CONSENT_REQUIRED = 'ERROR_REASON_CONSENT_REQUIRED' - ERROR_REASON_INVALID_REQUEST_URI = 'ERROR_REASON_INVALID_REQUEST_URI' - ERROR_REASON_INVALID_REQUEST_OBJECT = 'ERROR_REASON_INVALID_REQUEST_OBJECT' - ERROR_REASON_REQUEST_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_NOT_SUPPORTED' - ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_URI_NOT_SUPPORTED' - ERROR_REASON_REGISTRATION_NOT_SUPPORTED = 'ERROR_REASON_REGISTRATION_NOT_SUPPORTED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOIDCServiceErrorReason from a JSON string""" - return cls(json.loads(json_str)) - - + ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED" + ERROR_REASON_INVALID_REQUEST = "ERROR_REASON_INVALID_REQUEST" + ERROR_REASON_UNAUTHORIZED_CLIENT = "ERROR_REASON_UNAUTHORIZED_CLIENT" + ERROR_REASON_ACCESS_DENIED = "ERROR_REASON_ACCESS_DENIED" + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = "ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE" + ERROR_REASON_INVALID_SCOPE = "ERROR_REASON_INVALID_SCOPE" + ERROR_REASON_SERVER_ERROR = "ERROR_REASON_SERVER_ERROR" + ERROR_REASON_TEMPORARY_UNAVAILABLE = "ERROR_REASON_TEMPORARY_UNAVAILABLE" + ERROR_REASON_INTERACTION_REQUIRED = "ERROR_REASON_INTERACTION_REQUIRED" + ERROR_REASON_LOGIN_REQUIRED = "ERROR_REASON_LOGIN_REQUIRED" + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = "ERROR_REASON_ACCOUNT_SELECTION_REQUIRED" + ERROR_REASON_CONSENT_REQUIRED = "ERROR_REASON_CONSENT_REQUIRED" + ERROR_REASON_INVALID_REQUEST_URI = "ERROR_REASON_INVALID_REQUEST_URI" + ERROR_REASON_INVALID_REQUEST_OBJECT = "ERROR_REASON_INVALID_REQUEST_OBJECT" + ERROR_REASON_REQUEST_NOT_SUPPORTED = "ERROR_REASON_REQUEST_NOT_SUPPORTED" + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = "ERROR_REASON_REQUEST_URI_NOT_SUPPORTED" + ERROR_REASON_REGISTRATION_NOT_SUPPORTED = "ERROR_REASON_REGISTRATION_NOT_SUPPORTED" diff --git a/zitadel_client/models/beta_oidc_service_get_auth_request_request.py b/zitadel_client/models/beta_oidc_service_get_auth_request_request.py index 3bad227b..c87ca921 100644 --- a/zitadel_client/models/beta_oidc_service_get_auth_request_request.py +++ b/zitadel_client/models/beta_oidc_service_get_auth_request_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceGetAuthRequestRequest(BaseModel): """ BetaOIDCServiceGetAuthRequestRequest - """ # noqa: E501 + """ + auth_request_id: Optional[StrictStr] = Field(default=None, alias="authRequestId") - __properties: ClassVar[List[str]] = ["authRequestId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaOIDCServiceGetAuthRequestRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceGetAuthRequestRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceGetAuthRequestRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequestId": obj.get("authRequestId") - }) - return _obj - - +BetaOIDCServiceGetAuthRequestRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_get_auth_request_response.py b/zitadel_client/models/beta_oidc_service_get_auth_request_response.py index fa3b81b6..3a53deb2 100644 --- a/zitadel_client/models/beta_oidc_service_get_auth_request_response.py +++ b/zitadel_client/models/beta_oidc_service_get_auth_request_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_oidc_service_auth_request import BetaOIDCServiceAuthRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOIDCServiceGetAuthRequestResponse(BaseModel): """ BetaOIDCServiceGetAuthRequestResponse - """ # noqa: E501 - auth_request: Optional[BetaOIDCServiceAuthRequest] = Field(default=None, alias="authRequest") - __properties: ClassVar[List[str]] = ["authRequest"] + """ + auth_request: Optional[BetaOIDCServiceAuthRequest] = Field( + default=None, alias="authRequest" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class BetaOIDCServiceGetAuthRequestResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceGetAuthRequestResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of auth_request - if self.auth_request: - _dict['authRequest'] = self.auth_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceGetAuthRequestResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequest": BetaOIDCServiceAuthRequest.from_dict(obj["authRequest"]) if obj.get("authRequest") is not None else None - }) - return _obj - +from zitadel_client.models.beta_oidc_service_auth_request import ( + BetaOIDCServiceAuthRequest, +) +BetaOIDCServiceGetAuthRequestResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_oidc_service_prompt.py b/zitadel_client/models/beta_oidc_service_prompt.py index 62841f86..296e6549 100644 --- a/zitadel_client/models/beta_oidc_service_prompt.py +++ b/zitadel_client/models/beta_oidc_service_prompt.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOIDCServicePrompt(str, Enum): @@ -23,19 +13,9 @@ class BetaOIDCServicePrompt(str, Enum): BetaOIDCServicePrompt """ - """ - allowed enum values - """ - PROMPT_UNSPECIFIED = 'PROMPT_UNSPECIFIED' - PROMPT_NONE = 'PROMPT_NONE' - PROMPT_LOGIN = 'PROMPT_LOGIN' - PROMPT_CONSENT = 'PROMPT_CONSENT' - PROMPT_SELECT_ACCOUNT = 'PROMPT_SELECT_ACCOUNT' - PROMPT_CREATE = 'PROMPT_CREATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOIDCServicePrompt from a JSON string""" - return cls(json.loads(json_str)) - - + PROMPT_UNSPECIFIED = "PROMPT_UNSPECIFIED" + PROMPT_NONE = "PROMPT_NONE" + PROMPT_LOGIN = "PROMPT_LOGIN" + PROMPT_CONSENT = "PROMPT_CONSENT" + PROMPT_SELECT_ACCOUNT = "PROMPT_SELECT_ACCOUNT" + PROMPT_CREATE = "PROMPT_CREATE" diff --git a/zitadel_client/models/beta_oidc_service_session.py b/zitadel_client/models/beta_oidc_service_session.py index f64934c5..cd7db5d8 100644 --- a/zitadel_client/models/beta_oidc_service_session.py +++ b/zitadel_client/models/beta_oidc_service_session.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOIDCServiceSession(BaseModel): """ BetaOIDCServiceSession - """ # noqa: E501 + """ + session_id: Optional[StrictStr] = Field(default=None, alias="sessionId") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaOIDCServiceSession(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOIDCServiceSession from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOIDCServiceSession from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +BetaOIDCServiceSession.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_activate_organization_request.py b/zitadel_client/models/beta_organization_service_activate_organization_request.py index 6460154d..23bcfea8 100644 --- a/zitadel_client/models/beta_organization_service_activate_organization_request.py +++ b/zitadel_client/models/beta_organization_service_activate_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceActivateOrganizationRequest(BaseModel): """ BetaOrganizationServiceActivateOrganizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization to be activated") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Organization Id for the Organization to be activated", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaOrganizationServiceActivateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceActivateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceActivateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaOrganizationServiceActivateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_activate_organization_response.py b/zitadel_client/models/beta_organization_service_activate_organization_response.py index 99451a45..89faba71 100644 --- a/zitadel_client/models/beta_organization_service_activate_organization_response.py +++ b/zitadel_client/models/beta_organization_service_activate_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceActivateOrganizationResponse(BaseModel): """ BetaOrganizationServiceActivateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceActivateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceActivateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceActivateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceActivateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_add_human_user_request.py b/zitadel_client/models/beta_organization_service_add_human_user_request.py index 81ba7b88..a6927940 100644 --- a/zitadel_client/models/beta_organization_service_add_human_user_request.py +++ b/zitadel_client/models/beta_organization_service_add_human_user_request.py @@ -1,52 +1,66 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_hashed_password import BetaOrganizationServiceHashedPassword -from zitadel_client.models.beta_organization_service_idp_link import BetaOrganizationServiceIDPLink -from zitadel_client.models.beta_organization_service_organization import BetaOrganizationServiceOrganization -from zitadel_client.models.beta_organization_service_password import BetaOrganizationServicePassword -from zitadel_client.models.beta_organization_service_set_human_email import BetaOrganizationServiceSetHumanEmail -from zitadel_client.models.beta_organization_service_set_human_phone import BetaOrganizationServiceSetHumanPhone -from zitadel_client.models.beta_organization_service_set_human_profile import BetaOrganizationServiceSetHumanProfile -from zitadel_client.models.beta_organization_service_set_metadata_entry import BetaOrganizationServiceSetMetadataEntry -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceAddHumanUserRequest(BaseModel): """ BetaOrganizationServiceAddHumanUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="optionally set your own id unique for the user.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="optionally set a unique username, if none is provided the email will be used.") - organization: Optional[BetaOrganizationServiceOrganization] = None - profile: Optional[BetaOrganizationServiceSetHumanProfile] = None - email: Optional[BetaOrganizationServiceSetHumanEmail] = None - phone: Optional[BetaOrganizationServiceSetHumanPhone] = None - metadata: Optional[List[BetaOrganizationServiceSetMetadataEntry]] = None - idp_links: Optional[List[BetaOrganizationServiceIDPLink]] = Field(default=None, alias="idpLinks") - totp_secret: Optional[StrictStr] = Field(default=None, description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", alias="totpSecret") - hashed_password: Optional[BetaOrganizationServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[BetaOrganizationServicePassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "organization", "profile", "email", "phone", "metadata", "idpLinks", "totpSecret", "hashedPassword", "password"] + """ + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="optionally set your own id unique for the user.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="optionally set a unique username, if none is provided the email will be used.", + ) + organization: Optional[BetaOrganizationServiceOrganization] = Field( + default=None, alias="organization" + ) + profile: Optional[BetaOrganizationServiceSetHumanProfile] = Field( + default=None, alias="profile" + ) + email: Optional[BetaOrganizationServiceSetHumanEmail] = Field( + default=None, alias="email" + ) + phone: Optional[BetaOrganizationServiceSetHumanPhone] = Field( + default=None, alias="phone" + ) + metadata: Optional[List[BetaOrganizationServiceSetMetadataEntry]] = Field( + default=None, alias="metadata" + ) + idp_links: Optional[List[BetaOrganizationServiceIDPLink]] = Field( + default=None, alias="idpLinks" + ) + totp_secret: Optional[StrictStr] = Field( + default=None, + alias="totpSecret", + description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", + ) + hashed_password: Optional[BetaOrganizationServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[BetaOrganizationServicePassword] = Field( + default=None, alias="password" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -54,109 +68,29 @@ class BetaOrganizationServiceAddHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in idp_links (list) - _items = [] - if self.idp_links: - for _item_idp_links in self.idp_links: - if _item_idp_links: - _items.append(_item_idp_links.to_dict()) - _dict['idpLinks'] = _items - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if user_id (nullable) is None - # and model_fields_set contains the field - if self.user_id is None and "user_id" in self.model_fields_set: - _dict['userId'] = None - - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - # set to None if totp_secret (nullable) is None - # and model_fields_set contains the field - if self.totp_secret is None and "totp_secret" in self.model_fields_set: - _dict['totpSecret'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "organization": BetaOrganizationServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "profile": BetaOrganizationServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": BetaOrganizationServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": BetaOrganizationServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "metadata": [BetaOrganizationServiceSetMetadataEntry.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None, - "idpLinks": [BetaOrganizationServiceIDPLink.from_dict(_item) for _item in obj["idpLinks"]] if obj.get("idpLinks") is not None else None, - "totpSecret": obj.get("totpSecret"), - "hashedPassword": BetaOrganizationServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": BetaOrganizationServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_organization_service_hashed_password import ( + BetaOrganizationServiceHashedPassword, +) +from zitadel_client.models.beta_organization_service_idp_link import ( + BetaOrganizationServiceIDPLink, +) +from zitadel_client.models.beta_organization_service_organization import ( + BetaOrganizationServiceOrganization, +) +from zitadel_client.models.beta_organization_service_password import ( + BetaOrganizationServicePassword, +) +from zitadel_client.models.beta_organization_service_set_human_email import ( + BetaOrganizationServiceSetHumanEmail, +) +from zitadel_client.models.beta_organization_service_set_human_phone import ( + BetaOrganizationServiceSetHumanPhone, +) +from zitadel_client.models.beta_organization_service_set_human_profile import ( + BetaOrganizationServiceSetHumanProfile, +) +from zitadel_client.models.beta_organization_service_set_metadata_entry import ( + BetaOrganizationServiceSetMetadataEntry, +) + +BetaOrganizationServiceAddHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_add_organization_domain_request.py b/zitadel_client/models/beta_organization_service_add_organization_domain_request.py index e16de8ec..5bcab047 100644 --- a/zitadel_client/models/beta_organization_service_add_organization_domain_request.py +++ b/zitadel_client/models/beta_organization_service_add_organization_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceAddOrganizationDomainRequest(BaseModel): """ BetaOrganizationServiceAddOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization for which the domain is to be added to.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="The domain you want to add to the organization.") - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization for which the domain is to be added to.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="The domain you want to add to the organization.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaOrganizationServiceAddOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaOrganizationServiceAddOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_add_organization_domain_response.py b/zitadel_client/models/beta_organization_service_add_organization_domain_response.py index 28108240..415b3894 100644 --- a/zitadel_client/models/beta_organization_service_add_organization_domain_response.py +++ b/zitadel_client/models/beta_organization_service_add_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceAddOrganizationDomainResponse(BaseModel): """ BetaOrganizationServiceAddOrganizationDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceAddOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAddOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceAddOrganizationDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_admin.py b/zitadel_client/models/beta_organization_service_admin.py index 5c96b776..f34b8d66 100644 --- a/zitadel_client/models/beta_organization_service_admin.py +++ b/zitadel_client/models/beta_organization_service_admin.py @@ -1,37 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_add_human_user_request import BetaOrganizationServiceAddHumanUserRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceAdmin(BaseModel): """ The Admin for the newly created Organization. - """ # noqa: E501 - roles: Optional[List[StrictStr]] = Field(default=None, description="specify Organization Member Roles for the provided user (default is ORG_OWNER if roles are empty)") - human: Optional[BetaOrganizationServiceAddHumanUserRequest] = None + """ + + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="specify Organization Member Roles for the provided user (default is ORG_OWNER if roles are empty)", + ) + human: Optional[BetaOrganizationServiceAddHumanUserRequest] = Field( + default=None, alias="human" + ) user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["roles", "human", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +38,8 @@ class BetaOrganizationServiceAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "roles": obj.get("roles"), - "human": BetaOrganizationServiceAddHumanUserRequest.from_dict(obj["human"]) if obj.get("human") is not None else None, - "userId": obj.get("userId") - }) - return _obj - +from zitadel_client.models.beta_organization_service_add_human_user_request import ( + BetaOrganizationServiceAddHumanUserRequest, +) +BetaOrganizationServiceAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_any.py b/zitadel_client/models/beta_organization_service_any.py index 5215081b..e05ceccd 100644 --- a/zitadel_client/models/beta_organization_service_any.py +++ b/zitadel_client/models/beta_organization_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaOrganizationServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaOrganizationServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_assigned_admin.py b/zitadel_client/models/beta_organization_service_assigned_admin.py index 05f54d82..01f83704 100644 --- a/zitadel_client/models/beta_organization_service_assigned_admin.py +++ b/zitadel_client/models/beta_organization_service_assigned_admin.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceAssignedAdmin(BaseModel): """ BetaOrganizationServiceAssignedAdmin - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaOrganizationServiceAssignedAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAssignedAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceAssignedAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaOrganizationServiceAssignedAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_connect_error.py b/zitadel_client/models/beta_organization_service_connect_error.py index aad55cf6..ac2997da 100644 --- a/zitadel_client/models/beta_organization_service_connect_error.py +++ b/zitadel_client/models/beta_organization_service_connect_error.py @@ -1,122 +1,171 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_any import BetaOrganizationServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaOrganizationServiceConnectErrorCodeEnum(str, Enum): + """BetaOrganizationServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaOrganizationServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaOrganizationServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaOrganizationServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaOrganizationServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaOrganizationServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_organization_service_any import ( + BetaOrganizationServiceAny, +) +BetaOrganizationServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_create_organization_request.py b/zitadel_client/models/beta_organization_service_create_organization_request.py index 784db7ad..101e737e 100644 --- a/zitadel_client/models/beta_organization_service_create_organization_request.py +++ b/zitadel_client/models/beta_organization_service_create_organization_request.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_admin import BetaOrganizationServiceAdmin -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceCreateOrganizationRequest(BaseModel): """ BetaOrganizationServiceCreateOrganizationRequest - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="name of the Organization to be created.") - id: Optional[StrictStr] = Field(default=None, description="Optionally set your own id unique for the organization.") - admins: Optional[List[BetaOrganizationServiceAdmin]] = Field(default=None, description="Additional Admins for the Organization.") - __properties: ClassVar[List[str]] = ["name", "id", "admins"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="name of the Organization to be created.", + ) + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Optionally set your own id unique for the organization.", + ) + admins: Optional[List[BetaOrganizationServiceAdmin]] = Field( + default=None, + alias="admins", + description="Additional Admins for the Organization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,66 +44,8 @@ class BetaOrganizationServiceCreateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in admins (list) - _items = [] - if self.admins: - for _item_admins in self.admins: - if _item_admins: - _items.append(_item_admins.to_dict()) - _dict['admins'] = _items - # set to None if id (nullable) is None - # and model_fields_set contains the field - if self.id is None and "id" in self.model_fields_set: - _dict['id'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "id": obj.get("id"), - "admins": [BetaOrganizationServiceAdmin.from_dict(_item) for _item in obj["admins"]] if obj.get("admins") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_admin import ( + BetaOrganizationServiceAdmin, +) +BetaOrganizationServiceCreateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_create_organization_response.py b/zitadel_client/models/beta_organization_service_create_organization_response.py index 2225a21b..82362038 100644 --- a/zitadel_client/models/beta_organization_service_create_organization_response.py +++ b/zitadel_client/models/beta_organization_service_create_organization_response.py @@ -1,38 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_organization_admin import BetaOrganizationServiceOrganizationAdmin -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceCreateOrganizationResponse(BaseModel): """ BetaOrganizationServiceCreateOrganizationResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - id: Optional[StrictStr] = Field(default=None, description="Organization ID of the newly created organization.") - organization_admins: Optional[List[BetaOrganizationServiceOrganizationAdmin]] = Field(default=None, description="The admins created/assigned for the Organization", alias="organizationAdmins") - __properties: ClassVar[List[str]] = ["creationDate", "id", "organizationAdmins"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Organization ID of the newly created organization.", + ) + organization_admins: Optional[List[BetaOrganizationServiceOrganizationAdmin]] = ( + Field( + default=None, + alias="organizationAdmins", + description="The admins created/assigned for the Organization", + ) + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,61 +46,9 @@ class BetaOrganizationServiceCreateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in organization_admins (list) - _items = [] - if self.organization_admins: - for _item_organization_admins in self.organization_admins: - if _item_organization_admins: - _items.append(_item_organization_admins.to_dict()) - _dict['organizationAdmins'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "id": obj.get("id"), - "organizationAdmins": [BetaOrganizationServiceOrganizationAdmin.from_dict(_item) for _item in obj["organizationAdmins"]] if obj.get("organizationAdmins") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_organization_service_organization_admin import ( + BetaOrganizationServiceOrganizationAdmin, +) +BetaOrganizationServiceCreateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_created_admin.py b/zitadel_client/models/beta_organization_service_created_admin.py index 38fb3f5e..7ada42c7 100644 --- a/zitadel_client/models/beta_organization_service_created_admin.py +++ b/zitadel_client/models/beta_organization_service_created_admin.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceCreatedAdmin(BaseModel): """ BetaOrganizationServiceCreatedAdmin - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["userId", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,64 +32,4 @@ class BetaOrganizationServiceCreatedAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreatedAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceCreatedAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - - +BetaOrganizationServiceCreatedAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_deactivate_organization_request.py b/zitadel_client/models/beta_organization_service_deactivate_organization_request.py index 54ba535e..7e746dd9 100644 --- a/zitadel_client/models/beta_organization_service_deactivate_organization_request.py +++ b/zitadel_client/models/beta_organization_service_deactivate_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceDeactivateOrganizationRequest(BaseModel): """ BetaOrganizationServiceDeactivateOrganizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization to be deactivated") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Organization Id for the Organization to be deactivated", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaOrganizationServiceDeactivateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeactivateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeactivateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaOrganizationServiceDeactivateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_deactivate_organization_response.py b/zitadel_client/models/beta_organization_service_deactivate_organization_response.py index 841ea36d..f09a2c0f 100644 --- a/zitadel_client/models/beta_organization_service_deactivate_organization_response.py +++ b/zitadel_client/models/beta_organization_service_deactivate_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceDeactivateOrganizationResponse(BaseModel): """ BetaOrganizationServiceDeactivateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceDeactivateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeactivateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeactivateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceDeactivateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_domain_request.py b/zitadel_client/models/beta_organization_service_delete_organization_domain_request.py index fe2beb30..1bd49abe 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_domain_request.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_domain_request.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceDeleteOrganizationDomainRequest(BaseModel): """ BetaOrganizationServiceDeleteOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization which domain is to be deleted.", alias="organizationId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization which domain is to be deleted.", + ) + domain: Optional[StrictStr] = Field(default=None, alias="domain") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,4 @@ class BetaOrganizationServiceDeleteOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaOrganizationServiceDeleteOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_domain_response.py b/zitadel_client/models/beta_organization_service_delete_organization_domain_response.py index a0feec4f..238ba7c2 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_domain_response.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceDeleteOrganizationDomainResponse(BaseModel): """ BetaOrganizationServiceDeleteOrganizationDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaOrganizationServiceDeleteOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceDeleteOrganizationDomainResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_metadata_request.py b/zitadel_client/models/beta_organization_service_delete_organization_metadata_request.py index a98006d0..aa47cde8 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_metadata_request.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_metadata_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceDeleteOrganizationMetadataRequest(BaseModel): """ BetaOrganizationServiceDeleteOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID of Orgalization which metadata is to be deleted is stored on.", alias="organizationId") - keys: Optional[List[StrictStr]] = Field(default=None, description="The keys for the Organization metadata to be deleted.") - __properties: ClassVar[List[str]] = ["organizationId", "keys"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID of Orgalization which metadata is to be deleted is stored on.", + ) + keys: Optional[List[StrictStr]] = Field( + default=None, + alias="keys", + description="The keys for the Organization metadata to be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,6 @@ class BetaOrganizationServiceDeleteOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "keys": obj.get("keys") - }) - return _obj - - +BetaOrganizationServiceDeleteOrganizationMetadataRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_metadata_response.py b/zitadel_client/models/beta_organization_service_delete_organization_metadata_response.py index 41bb2f0c..ef087b3b 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_metadata_response.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceDeleteOrganizationMetadataResponse(BaseModel): """ BetaOrganizationServiceDeleteOrganizationMetadataResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaOrganizationServiceDeleteOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceDeleteOrganizationMetadataResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_request.py b/zitadel_client/models/beta_organization_service_delete_organization_request.py index fa2cd3c8..92a61656 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_request.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceDeleteOrganizationRequest(BaseModel): """ BetaOrganizationServiceDeleteOrganizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization to be deleted") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Organization Id for the Organization to be deleted", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaOrganizationServiceDeleteOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaOrganizationServiceDeleteOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_delete_organization_response.py b/zitadel_client/models/beta_organization_service_delete_organization_response.py index 644309bc..7c30816b 100644 --- a/zitadel_client/models/beta_organization_service_delete_organization_response.py +++ b/zitadel_client/models/beta_organization_service_delete_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceDeleteOrganizationResponse(BaseModel): """ BetaOrganizationServiceDeleteOrganizationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceDeleteOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDeleteOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceDeleteOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_domain.py b/zitadel_client/models/beta_organization_service_domain.py index a80f6596..2501bdb8 100644 --- a/zitadel_client/models/beta_organization_service_domain.py +++ b/zitadel_client/models/beta_organization_service_domain.py @@ -1,39 +1,46 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_domain_validation_type import BetaOrganizationServiceDomainValidationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaOrganizationServiceDomain(BaseModel): """ from proto/zitadel/org.proto - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="The Organization id.", alias="organizationId") - domain_name: Optional[StrictStr] = Field(default=None, description="The domain name.", alias="domainName") - is_verified: Optional[StrictBool] = Field(default=None, description="Defines if the domain is verified.", alias="isVerified") - is_primary: Optional[StrictBool] = Field(default=None, description="Defines if the domain is the primary domain.", alias="isPrimary") - validation_type: Optional[BetaOrganizationServiceDomainValidationType] = Field(default=None, alias="validationType") - __properties: ClassVar[List[str]] = ["organizationId", "domainName", "isVerified", "isPrimary", "validationType"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, alias="organizationId", description="The Organization id." + ) + domain_name: Optional[StrictStr] = Field( + default=None, alias="domainName", description="The domain name." + ) + is_verified: Optional[StrictBool] = Field( + default=None, + alias="isVerified", + description="Defines if the domain is verified.", + ) + is_primary: Optional[StrictBool] = Field( + default=None, + alias="isPrimary", + description="Defines if the domain is the primary domain.", + ) + validation_type: Optional[BetaOrganizationServiceDomainValidationType] = Field( + default=None, alias="validationType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +48,8 @@ class BetaOrganizationServiceDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domainName": obj.get("domainName"), - "isVerified": obj.get("isVerified"), - "isPrimary": obj.get("isPrimary"), - "validationType": obj.get("validationType") - }) - return _obj - +from zitadel_client.models.beta_organization_service_domain_validation_type import ( + BetaOrganizationServiceDomainValidationType, +) +BetaOrganizationServiceDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_domain_name_filter.py b/zitadel_client/models/beta_organization_service_domain_name_filter.py index 909afdf7..b2c03bf5 100644 --- a/zitadel_client/models/beta_organization_service_domain_name_filter.py +++ b/zitadel_client/models/beta_organization_service_domain_name_filter.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_text_query_method import BetaOrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceDomainNameFilter(BaseModel): """ from proto/zitadel/org.proto - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The domain.") - method: Optional[BetaOrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, alias="name", description="The domain." + ) + method: Optional[BetaOrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,8 @@ class BetaOrganizationServiceDomainNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomainNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomainNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod, +) +BetaOrganizationServiceDomainNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_domain_search_filter.py b/zitadel_client/models/beta_organization_service_domain_search_filter.py index c6581bf4..8ca9fd24 100644 --- a/zitadel_client/models/beta_organization_service_domain_search_filter.py +++ b/zitadel_client/models/beta_organization_service_domain_search_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_domain_name_filter import BetaOrganizationServiceDomainNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceDomainSearchFilter(BaseModel): """ from proto/zitadel/org.proto - """ # noqa: E501 - domain_name_filter: Optional[BetaOrganizationServiceDomainNameFilter] = Field(default=None, alias="domainNameFilter") - __properties: ClassVar[List[str]] = ["domainNameFilter"] + """ + domain_name_filter: Optional[BetaOrganizationServiceDomainNameFilter] = Field( + default=None, alias="domainNameFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class BetaOrganizationServiceDomainSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomainSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_name_filter - if self.domain_name_filter: - _dict['domainNameFilter'] = self.domain_name_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceDomainSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainNameFilter": BetaOrganizationServiceDomainNameFilter.from_dict(obj["domainNameFilter"]) if obj.get("domainNameFilter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_domain_name_filter import ( + BetaOrganizationServiceDomainNameFilter, +) +BetaOrganizationServiceDomainSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_domain_validation_type.py b/zitadel_client/models/beta_organization_service_domain_validation_type.py index 0024cd91..45e9f07f 100644 --- a/zitadel_client/models/beta_organization_service_domain_validation_type.py +++ b/zitadel_client/models/beta_organization_service_domain_validation_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOrganizationServiceDomainValidationType(str, Enum): @@ -23,16 +13,6 @@ class BetaOrganizationServiceDomainValidationType(str, Enum): from proto/zitadel/org.proto """ - """ - allowed enum values - """ - DOMAIN_VALIDATION_TYPE_UNSPECIFIED = 'DOMAIN_VALIDATION_TYPE_UNSPECIFIED' - DOMAIN_VALIDATION_TYPE_HTTP = 'DOMAIN_VALIDATION_TYPE_HTTP' - DOMAIN_VALIDATION_TYPE_DNS = 'DOMAIN_VALIDATION_TYPE_DNS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOrganizationServiceDomainValidationType from a JSON string""" - return cls(json.loads(json_str)) - - + DOMAIN_VALIDATION_TYPE_UNSPECIFIED = "DOMAIN_VALIDATION_TYPE_UNSPECIFIED" + DOMAIN_VALIDATION_TYPE_HTTP = "DOMAIN_VALIDATION_TYPE_HTTP" + DOMAIN_VALIDATION_TYPE_DNS = "DOMAIN_VALIDATION_TYPE_DNS" diff --git a/zitadel_client/models/beta_organization_service_gender.py b/zitadel_client/models/beta_organization_service_gender.py index 32d9fa4e..f02c59b0 100644 --- a/zitadel_client/models/beta_organization_service_gender.py +++ b/zitadel_client/models/beta_organization_service_gender.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOrganizationServiceGender(str, Enum): @@ -23,17 +13,7 @@ class BetaOrganizationServiceGender(str, Enum): BetaOrganizationServiceGender """ - """ - allowed enum values - """ - GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' - GENDER_FEMALE = 'GENDER_FEMALE' - GENDER_MALE = 'GENDER_MALE' - GENDER_DIVERSE = 'GENDER_DIVERSE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOrganizationServiceGender from a JSON string""" - return cls(json.loads(json_str)) - - + GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED" + GENDER_FEMALE = "GENDER_FEMALE" + GENDER_MALE = "GENDER_MALE" + GENDER_DIVERSE = "GENDER_DIVERSE" diff --git a/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_request.py b/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_request.py index 650c169a..bf2131e6 100644 --- a/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_request.py +++ b/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_request.py @@ -1,37 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_domain_validation_type import BetaOrganizationServiceDomainValidationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceGenerateOrganizationDomainValidationRequest(BaseModel): """ BetaOrganizationServiceGenerateOrganizationDomainValidationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization which doman to be validated.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="The domain which to be deleted.") - type: Optional[BetaOrganizationServiceDomainValidationType] = None - __properties: ClassVar[List[str]] = ["organizationId", "domain", "type"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization which doman to be validated.", + ) + domain: Optional[StrictStr] = Field( + default=None, alias="domain", description="The domain which to be deleted." + ) + type: Optional[BetaOrganizationServiceDomainValidationType] = Field( + default=None, alias="type" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +40,10 @@ class BetaOrganizationServiceGenerateOrganizationDomainValidationRequest(BaseMod ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceGenerateOrganizationDomainValidationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceGenerateOrganizationDomainValidationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain"), - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.beta_organization_service_domain_validation_type import ( + BetaOrganizationServiceDomainValidationType, +) +BetaOrganizationServiceGenerateOrganizationDomainValidationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_response.py b/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_response.py index 1376a6c4..63002c89 100644 --- a/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_response.py +++ b/zitadel_client/models/beta_organization_service_generate_organization_domain_validation_response.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceGenerateOrganizationDomainValidationResponse(BaseModel): """ BetaOrganizationServiceGenerateOrganizationDomainValidationResponse - """ # noqa: E501 - token: Optional[StrictStr] = Field(default=None, description="The token verify domain.") - url: Optional[StrictStr] = Field(default=None, description="URL used to verify the domain.") - __properties: ClassVar[List[str]] = ["token", "url"] + """ + token: Optional[StrictStr] = Field( + default=None, alias="token", description="The token verify domain." + ) + url: Optional[StrictStr] = Field( + default=None, alias="url", description="URL used to verify the domain." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,6 @@ class BetaOrganizationServiceGenerateOrganizationDomainValidationResponse(BaseMo ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceGenerateOrganizationDomainValidationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceGenerateOrganizationDomainValidationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "token": obj.get("token"), - "url": obj.get("url") - }) - return _obj - - +BetaOrganizationServiceGenerateOrganizationDomainValidationResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_hashed_password.py b/zitadel_client/models/beta_organization_service_hashed_password.py index 32ddefcf..f9bf8609 100644 --- a/zitadel_client/models/beta_organization_service_hashed_password.py +++ b/zitadel_client/models/beta_organization_service_hashed_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaOrganizationServiceHashedPassword(BaseModel): """ BetaOrganizationServiceHashedPassword - """ # noqa: E501 - hash: Optional[StrictStr] = None + """ + + hash: Optional[StrictStr] = Field(default=None, alias="hash") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["hash", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaOrganizationServiceHashedPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceHashedPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceHashedPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +BetaOrganizationServiceHashedPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_idp_link.py b/zitadel_client/models/beta_organization_service_idp_link.py index f6efadfa..3695dac9 100644 --- a/zitadel_client/models/beta_organization_service_idp_link.py +++ b/zitadel_client/models/beta_organization_service_idp_link.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceIDPLink(BaseModel): """ BetaOrganizationServiceIDPLink - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class BetaOrganizationServiceIDPLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceIDPLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceIDPLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName") - }) - return _obj - - +BetaOrganizationServiceIDPLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_list_organization_domains_request.py b/zitadel_client/models/beta_organization_service_list_organization_domains_request.py index e4e987a0..aa608e90 100644 --- a/zitadel_client/models/beta_organization_service_list_organization_domains_request.py +++ b/zitadel_client/models/beta_organization_service_list_organization_domains_request.py @@ -1,38 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_domain_search_filter import BetaOrganizationServiceDomainSearchFilter -from zitadel_client.models.beta_organization_service_pagination_request import BetaOrganizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceListOrganizationDomainsRequest(BaseModel): """ BetaOrganizationServiceListOrganizationDomainsRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization which domains are to be listed.", alias="organizationId") - pagination: Optional[BetaOrganizationServicePaginationRequest] = None - filters: Optional[List[BetaOrganizationServiceDomainSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["organizationId", "pagination", "filters"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization which domains are to be listed.", + ) + pagination: Optional[BetaOrganizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filters: Optional[List[BetaOrganizationServiceDomainSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,64 +40,11 @@ class BetaOrganizationServiceListOrganizationDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "pagination": BetaOrganizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filters": [BetaOrganizationServiceDomainSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_domain_search_filter import ( + BetaOrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.beta_organization_service_pagination_request import ( + BetaOrganizationServicePaginationRequest, +) +BetaOrganizationServiceListOrganizationDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_list_organization_domains_response.py b/zitadel_client/models/beta_organization_service_list_organization_domains_response.py index 53f3677e..c9fd582d 100644 --- a/zitadel_client/models/beta_organization_service_list_organization_domains_response.py +++ b/zitadel_client/models/beta_organization_service_list_organization_domains_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_domain import BetaOrganizationServiceDomain -from zitadel_client.models.beta_organization_service_pagination_response import BetaOrganizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaOrganizationServiceListOrganizationDomainsResponse(BaseModel): """ BetaOrganizationServiceListOrganizationDomainsResponse - """ # noqa: E501 - pagination: Optional[BetaOrganizationServicePaginationResponse] = None - domains: Optional[List[BetaOrganizationServiceDomain]] = Field(default=None, description="The domains requested.") - __properties: ClassVar[List[str]] = ["pagination", "domains"] + """ + + pagination: Optional[BetaOrganizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + domains: Optional[List[BetaOrganizationServiceDomain]] = Field( + default=None, alias="domains", description="The domains requested." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaOrganizationServiceListOrganizationDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in domains (list) - _items = [] - if self.domains: - for _item_domains in self.domains: - if _item_domains: - _items.append(_item_domains.to_dict()) - _dict['domains'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaOrganizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "domains": [BetaOrganizationServiceDomain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_domain import ( + BetaOrganizationServiceDomain, +) +from zitadel_client.models.beta_organization_service_pagination_response import ( + BetaOrganizationServicePaginationResponse, +) +BetaOrganizationServiceListOrganizationDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_list_organization_metadata_request.py b/zitadel_client/models/beta_organization_service_list_organization_metadata_request.py index 4b49d137..bfcb86de 100644 --- a/zitadel_client/models/beta_organization_service_list_organization_metadata_request.py +++ b/zitadel_client/models/beta_organization_service_list_organization_metadata_request.py @@ -1,38 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_metadata_query import BetaOrganizationServiceMetadataQuery -from zitadel_client.models.beta_organization_service_pagination_request import BetaOrganizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceListOrganizationMetadataRequest(BaseModel): """ BetaOrganizationServiceListOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID of Orgalization which metadata is to be listed.", alias="organizationId") - pagination: Optional[BetaOrganizationServicePaginationRequest] = None - filter: Optional[List[BetaOrganizationServiceMetadataQuery]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["organizationId", "pagination", "filter"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID of Orgalization which metadata is to be listed.", + ) + pagination: Optional[BetaOrganizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filter: Optional[List[BetaOrganizationServiceMetadataQuery]] = Field( + default=None, alias="filter", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,64 +40,11 @@ class BetaOrganizationServiceListOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filter (list) - _items = [] - if self.filter: - for _item_filter in self.filter: - if _item_filter: - _items.append(_item_filter.to_dict()) - _dict['filter'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "pagination": BetaOrganizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filter": [BetaOrganizationServiceMetadataQuery.from_dict(_item) for _item in obj["filter"]] if obj.get("filter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_metadata_query import ( + BetaOrganizationServiceMetadataQuery, +) +from zitadel_client.models.beta_organization_service_pagination_request import ( + BetaOrganizationServicePaginationRequest, +) +BetaOrganizationServiceListOrganizationMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_list_organization_metadata_response.py b/zitadel_client/models/beta_organization_service_list_organization_metadata_response.py index 23eb3215..168fad2c 100644 --- a/zitadel_client/models/beta_organization_service_list_organization_metadata_response.py +++ b/zitadel_client/models/beta_organization_service_list_organization_metadata_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_metadata import BetaOrganizationServiceMetadata -from zitadel_client.models.beta_organization_service_pagination_response import BetaOrganizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaOrganizationServiceListOrganizationMetadataResponse(BaseModel): """ BetaOrganizationServiceListOrganizationMetadataResponse - """ # noqa: E501 - pagination: Optional[BetaOrganizationServicePaginationResponse] = None - metadata: Optional[List[BetaOrganizationServiceMetadata]] = Field(default=None, description="The Organization metadata requested.") - __properties: ClassVar[List[str]] = ["pagination", "metadata"] + """ + + pagination: Optional[BetaOrganizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + metadata: Optional[List[BetaOrganizationServiceMetadata]] = Field( + default=None, + alias="metadata", + description="The Organization metadata requested.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,13 @@ class BetaOrganizationServiceListOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaOrganizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "metadata": [BetaOrganizationServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_metadata import ( + BetaOrganizationServiceMetadata, +) +from zitadel_client.models.beta_organization_service_pagination_response import ( + BetaOrganizationServicePaginationResponse, +) +BetaOrganizationServiceListOrganizationMetadataResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_organization_service_list_organizations_request.py b/zitadel_client/models/beta_organization_service_list_organizations_request.py index 6458072f..d8857c68 100644 --- a/zitadel_client/models/beta_organization_service_list_organizations_request.py +++ b/zitadel_client/models/beta_organization_service_list_organizations_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_org_field_name import BetaOrganizationServiceOrgFieldName -from zitadel_client.models.beta_organization_service_organization_search_filter import BetaOrganizationServiceOrganizationSearchFilter -from zitadel_client.models.beta_organization_service_pagination_request import BetaOrganizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaOrganizationServiceListOrganizationsRequest(BaseModel): """ BetaOrganizationServiceListOrganizationsRequest - """ # noqa: E501 - pagination: Optional[BetaOrganizationServicePaginationRequest] = None - sorting_column: Optional[BetaOrganizationServiceOrgFieldName] = Field(default=None, alias="sortingColumn") - filter: Optional[List[BetaOrganizationServiceOrganizationSearchFilter]] = Field(default=None, description="Define the criteria to query for. repeated ProjectRoleQuery filters = 4;") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filter"] + """ + + pagination: Optional[BetaOrganizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaOrganizationServiceOrgFieldName] = Field( + default=None, alias="sortingColumn" + ) + filter: Optional[List[BetaOrganizationServiceOrganizationSearchFilter]] = Field( + default=None, + alias="filter", + description="Define the criteria to query for. repeated ProjectRoleQuery filters = 4;", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class BetaOrganizationServiceListOrganizationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filter (list) - _items = [] - if self.filter: - for _item_filter in self.filter: - if _item_filter: - _items.append(_item_filter.to_dict()) - _dict['filter'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaOrganizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filter": [BetaOrganizationServiceOrganizationSearchFilter.from_dict(_item) for _item in obj["filter"]] if obj.get("filter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_org_field_name import ( + BetaOrganizationServiceOrgFieldName, +) +from zitadel_client.models.beta_organization_service_organization_search_filter import ( + BetaOrganizationServiceOrganizationSearchFilter, +) +from zitadel_client.models.beta_organization_service_pagination_request import ( + BetaOrganizationServicePaginationRequest, +) +BetaOrganizationServiceListOrganizationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_list_organizations_response.py b/zitadel_client/models/beta_organization_service_list_organizations_response.py index 31d869e6..3062da81 100644 --- a/zitadel_client/models/beta_organization_service_list_organizations_response.py +++ b/zitadel_client/models/beta_organization_service_list_organizations_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_organization import BetaOrganizationServiceOrganization -from zitadel_client.models.beta_organization_service_pagination_response import BetaOrganizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaOrganizationServiceListOrganizationsResponse(BaseModel): """ BetaOrganizationServiceListOrganizationsResponse - """ # noqa: E501 - pagination: Optional[BetaOrganizationServicePaginationResponse] = None - organizations: Optional[List[BetaOrganizationServiceOrganization]] = Field(default=None, description="The Organizations requested") - __properties: ClassVar[List[str]] = ["pagination", "organizations"] + """ + + pagination: Optional[BetaOrganizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + organizations: Optional[List[BetaOrganizationServiceOrganization]] = Field( + default=None, alias="organizations", description="The Organizations requested" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaOrganizationServiceListOrganizationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in organizations (list) - _items = [] - if self.organizations: - for _item_organizations in self.organizations: - if _item_organizations: - _items.append(_item_organizations.to_dict()) - _dict['organizations'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceListOrganizationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaOrganizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "organizations": [BetaOrganizationServiceOrganization.from_dict(_item) for _item in obj["organizations"]] if obj.get("organizations") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_organization import ( + BetaOrganizationServiceOrganization, +) +from zitadel_client.models.beta_organization_service_pagination_response import ( + BetaOrganizationServicePaginationResponse, +) +BetaOrganizationServiceListOrganizationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_metadata.py b/zitadel_client/models/beta_organization_service_metadata.py index ff4bd56e..9a4153f5 100644 --- a/zitadel_client/models/beta_organization_service_metadata.py +++ b/zitadel_client/models/beta_organization_service_metadata.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceMetadata(BaseModel): """ BetaOrganizationServiceMetadata - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Key in the metadata key/value pair.") - value: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Value in the metadata key/value pair.") - __properties: ClassVar[List[str]] = ["key", "value"] + """ + + key: Optional[StrictStr] = Field( + default=None, alias="key", description="Key in the metadata key/value pair." + ) + value: Optional[Base64Bytes] = Field( + default=None, alias="value", description="Value in the metadata key/value pair." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,6 @@ class BetaOrganizationServiceMetadata(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadata from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +BetaOrganizationServiceMetadata.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_metadata_key_query.py b/zitadel_client/models/beta_organization_service_metadata_key_query.py index 6b5e500c..9d18ee83 100644 --- a/zitadel_client/models/beta_organization_service_metadata_key_query.py +++ b/zitadel_client/models/beta_organization_service_metadata_key_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_text_query_method import BetaOrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceMetadataKeyQuery(BaseModel): """ BetaOrganizationServiceMetadataKeyQuery - """ # noqa: E501 - key: Optional[StrictStr] = None - method: Optional[BetaOrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + method: Optional[BetaOrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaOrganizationServiceMetadataKeyQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadataKeyQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadataKeyQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod, +) +BetaOrganizationServiceMetadataKeyQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_metadata_query.py b/zitadel_client/models/beta_organization_service_metadata_query.py index 2b914246..db9c520a 100644 --- a/zitadel_client/models/beta_organization_service_metadata_query.py +++ b/zitadel_client/models/beta_organization_service_metadata_query.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_metadata_key_query import BetaOrganizationServiceMetadataKeyQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceMetadataQuery(BaseModel): """ BetaOrganizationServiceMetadataQuery - """ # noqa: E501 - key_query: Optional[BetaOrganizationServiceMetadataKeyQuery] = Field(default=None, alias="keyQuery") - __properties: ClassVar[List[str]] = ["keyQuery"] + """ + key_query: Optional[BetaOrganizationServiceMetadataKeyQuery] = Field( + default=None, alias="keyQuery" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class BetaOrganizationServiceMetadataQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadataQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of key_query - if self.key_query: - _dict['keyQuery'] = self.key_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceMetadataQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyQuery": BetaOrganizationServiceMetadataKeyQuery.from_dict(obj["keyQuery"]) if obj.get("keyQuery") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_metadata_key_query import ( + BetaOrganizationServiceMetadataKeyQuery, +) +BetaOrganizationServiceMetadataQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_org_domain_filter.py b/zitadel_client/models/beta_organization_service_org_domain_filter.py index eb782457..53d0f26b 100644 --- a/zitadel_client/models/beta_organization_service_org_domain_filter.py +++ b/zitadel_client/models/beta_organization_service_org_domain_filter.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_text_query_method import BetaOrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceOrgDomainFilter(BaseModel): """ BetaOrganizationServiceOrgDomainFilter - """ # noqa: E501 - domain: Optional[StrictStr] = Field(default=None, description="The domain.") - method: Optional[BetaOrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["domain", "method"] + """ + + domain: Optional[StrictStr] = Field( + default=None, alias="domain", description="The domain." + ) + method: Optional[BetaOrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,8 @@ class BetaOrganizationServiceOrgDomainFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgDomainFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgDomainFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod, +) +BetaOrganizationServiceOrgDomainFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_org_field_name.py b/zitadel_client/models/beta_organization_service_org_field_name.py index 4530059c..b0515d69 100644 --- a/zitadel_client/models/beta_organization_service_org_field_name.py +++ b/zitadel_client/models/beta_organization_service_org_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOrganizationServiceOrgFieldName(str, Enum): @@ -23,16 +13,6 @@ class BetaOrganizationServiceOrgFieldName(str, Enum): BetaOrganizationServiceOrgFieldName """ - """ - allowed enum values - """ - ORG_FIELD_NAME_UNSPECIFIED = 'ORG_FIELD_NAME_UNSPECIFIED' - ORG_FIELD_NAME_NAME = 'ORG_FIELD_NAME_NAME' - ORG_FIELD_NAME_CREATION_DATE = 'ORG_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOrganizationServiceOrgFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + ORG_FIELD_NAME_UNSPECIFIED = "ORG_FIELD_NAME_UNSPECIFIED" + ORG_FIELD_NAME_NAME = "ORG_FIELD_NAME_NAME" + ORG_FIELD_NAME_CREATION_DATE = "ORG_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_organization_service_org_id_filter.py b/zitadel_client/models/beta_organization_service_org_id_filter.py index d727a455..c39367e3 100644 --- a/zitadel_client/models/beta_organization_service_org_id_filter.py +++ b/zitadel_client/models/beta_organization_service_org_id_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceOrgIDFilter(BaseModel): """ BetaOrganizationServiceOrgIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The Organization id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The Organization id." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaOrganizationServiceOrgIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaOrganizationServiceOrgIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_org_name_filter.py b/zitadel_client/models/beta_organization_service_org_name_filter.py index d8ee78e1..84504bed 100644 --- a/zitadel_client/models/beta_organization_service_org_name_filter.py +++ b/zitadel_client/models/beta_organization_service_org_name_filter.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_text_query_method import BetaOrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceOrgNameFilter(BaseModel): """ BetaOrganizationServiceOrgNameFilter - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Organization name.") - method: Optional[BetaOrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Organization name." + ) + method: Optional[BetaOrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,8 @@ class BetaOrganizationServiceOrgNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_organization_service_text_query_method import ( + BetaOrganizationServiceTextQueryMethod, +) +BetaOrganizationServiceOrgNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_org_state.py b/zitadel_client/models/beta_organization_service_org_state.py index e14936fc..9aa39cbd 100644 --- a/zitadel_client/models/beta_organization_service_org_state.py +++ b/zitadel_client/models/beta_organization_service_org_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOrganizationServiceOrgState(str, Enum): @@ -23,17 +13,7 @@ class BetaOrganizationServiceOrgState(str, Enum): BetaOrganizationServiceOrgState """ - """ - allowed enum values - """ - ORG_STATE_UNSPECIFIED = 'ORG_STATE_UNSPECIFIED' - ORG_STATE_ACTIVE = 'ORG_STATE_ACTIVE' - ORG_STATE_INACTIVE = 'ORG_STATE_INACTIVE' - ORG_STATE_REMOVED = 'ORG_STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOrganizationServiceOrgState from a JSON string""" - return cls(json.loads(json_str)) - - + ORG_STATE_UNSPECIFIED = "ORG_STATE_UNSPECIFIED" + ORG_STATE_ACTIVE = "ORG_STATE_ACTIVE" + ORG_STATE_INACTIVE = "ORG_STATE_INACTIVE" + ORG_STATE_REMOVED = "ORG_STATE_REMOVED" diff --git a/zitadel_client/models/beta_organization_service_org_state_filter.py b/zitadel_client/models/beta_organization_service_org_state_filter.py index eeb0f9cb..8949b3d9 100644 --- a/zitadel_client/models/beta_organization_service_org_state_filter.py +++ b/zitadel_client/models/beta_organization_service_org_state_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_org_state import BetaOrganizationServiceOrgState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaOrganizationServiceOrgStateFilter(BaseModel): """ BetaOrganizationServiceOrgStateFilter - """ # noqa: E501 - state: Optional[BetaOrganizationServiceOrgState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[BetaOrganizationServiceOrgState] = Field( + default=None, alias="state" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class BetaOrganizationServiceOrgStateFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgStateFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrgStateFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.beta_organization_service_org_state import ( + BetaOrganizationServiceOrgState, +) +BetaOrganizationServiceOrgStateFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_organization.py b/zitadel_client/models/beta_organization_service_organization.py index 5d4ff9de..d323ecd7 100644 --- a/zitadel_client/models/beta_organization_service_organization.py +++ b/zitadel_client/models/beta_organization_service_organization.py @@ -1,41 +1,51 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_org_state import BetaOrganizationServiceOrgState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceOrganization(BaseModel): """ BetaOrganizationServiceOrganization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the organization.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - changed_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changedDate") - state: Optional[BetaOrganizationServiceOrgState] = None - name: Optional[StrictStr] = Field(default=None, description="Name of the organization.") - primary_domain: Optional[StrictStr] = Field(default=None, description="Primary domain used in the organization.", alias="primaryDomain") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changedDate", "state", "name", "primaryDomain"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="Unique identifier of the organization." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + changed_date: Optional[AwareDatetime] = Field( + default=None, + alias="changedDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[BetaOrganizationServiceOrgState] = Field( + default=None, alias="state" + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name of the organization." + ) + primary_domain: Optional[StrictStr] = Field( + default=None, + alias="primaryDomain", + description="Primary domain used in the organization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,57 +53,9 @@ class BetaOrganizationServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changedDate": obj.get("changedDate"), - "state": obj.get("state"), - "name": obj.get("name"), - "primaryDomain": obj.get("primaryDomain") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_organization_service_org_state import ( + BetaOrganizationServiceOrgState, +) +BetaOrganizationServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_organization_admin.py b/zitadel_client/models/beta_organization_service_organization_admin.py index 4bfb3b47..7accdda7 100644 --- a/zitadel_client/models/beta_organization_service_organization_admin.py +++ b/zitadel_client/models/beta_organization_service_organization_admin.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_assigned_admin import BetaOrganizationServiceAssignedAdmin -from zitadel_client.models.beta_organization_service_created_admin import BetaOrganizationServiceCreatedAdmin -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceOrganizationAdmin(BaseModel): """ BetaOrganizationServiceOrganizationAdmin - """ # noqa: E501 - assigned_admin: Optional[BetaOrganizationServiceAssignedAdmin] = Field(default=None, alias="assignedAdmin") - created_admin: Optional[BetaOrganizationServiceCreatedAdmin] = Field(default=None, alias="createdAdmin") - __properties: ClassVar[List[str]] = ["assignedAdmin", "createdAdmin"] + """ + + assigned_admin: Optional[BetaOrganizationServiceAssignedAdmin] = Field( + default=None, alias="assignedAdmin" + ) + created_admin: Optional[BetaOrganizationServiceCreatedAdmin] = Field( + default=None, alias="createdAdmin" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class BetaOrganizationServiceOrganizationAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganizationAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of assigned_admin - if self.assigned_admin: - _dict['assignedAdmin'] = self.assigned_admin.to_dict() - # override the default output from pydantic by calling `to_dict()` of created_admin - if self.created_admin: - _dict['createdAdmin'] = self.created_admin.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganizationAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "assignedAdmin": BetaOrganizationServiceAssignedAdmin.from_dict(obj["assignedAdmin"]) if obj.get("assignedAdmin") is not None else None, - "createdAdmin": BetaOrganizationServiceCreatedAdmin.from_dict(obj["createdAdmin"]) if obj.get("createdAdmin") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_assigned_admin import ( + BetaOrganizationServiceAssignedAdmin, +) +from zitadel_client.models.beta_organization_service_created_admin import ( + BetaOrganizationServiceCreatedAdmin, +) +BetaOrganizationServiceOrganizationAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_organization_search_filter.py b/zitadel_client/models/beta_organization_service_organization_search_filter.py index 0986780d..363744c7 100644 --- a/zitadel_client/models/beta_organization_service_organization_search_filter.py +++ b/zitadel_client/models/beta_organization_service_organization_search_filter.py @@ -1,41 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_org_domain_filter import BetaOrganizationServiceOrgDomainFilter -from zitadel_client.models.beta_organization_service_org_id_filter import BetaOrganizationServiceOrgIDFilter -from zitadel_client.models.beta_organization_service_org_name_filter import BetaOrganizationServiceOrgNameFilter -from zitadel_client.models.beta_organization_service_org_state_filter import BetaOrganizationServiceOrgStateFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceOrganizationSearchFilter(BaseModel): """ BetaOrganizationServiceOrganizationSearchFilter - """ # noqa: E501 - domain_filter: Optional[BetaOrganizationServiceOrgDomainFilter] = Field(default=None, alias="domainFilter") - id_filter: Optional[BetaOrganizationServiceOrgIDFilter] = Field(default=None, alias="idFilter") - name_filter: Optional[BetaOrganizationServiceOrgNameFilter] = Field(default=None, alias="nameFilter") - state_filter: Optional[BetaOrganizationServiceOrgStateFilter] = Field(default=None, alias="stateFilter") - __properties: ClassVar[List[str]] = ["domainFilter", "idFilter", "nameFilter", "stateFilter"] + """ + + domain_filter: Optional[BetaOrganizationServiceOrgDomainFilter] = Field( + default=None, alias="domainFilter" + ) + id_filter: Optional[BetaOrganizationServiceOrgIDFilter] = Field( + default=None, alias="idFilter" + ) + name_filter: Optional[BetaOrganizationServiceOrgNameFilter] = Field( + default=None, alias="nameFilter" + ) + state_filter: Optional[BetaOrganizationServiceOrgStateFilter] = Field( + default=None, alias="stateFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,67 +40,17 @@ class BetaOrganizationServiceOrganizationSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganizationSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_filter - if self.domain_filter: - _dict['domainFilter'] = self.domain_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of id_filter - if self.id_filter: - _dict['idFilter'] = self.id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of name_filter - if self.name_filter: - _dict['nameFilter'] = self.name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of state_filter - if self.state_filter: - _dict['stateFilter'] = self.state_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceOrganizationSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainFilter": BetaOrganizationServiceOrgDomainFilter.from_dict(obj["domainFilter"]) if obj.get("domainFilter") is not None else None, - "idFilter": BetaOrganizationServiceOrgIDFilter.from_dict(obj["idFilter"]) if obj.get("idFilter") is not None else None, - "nameFilter": BetaOrganizationServiceOrgNameFilter.from_dict(obj["nameFilter"]) if obj.get("nameFilter") is not None else None, - "stateFilter": BetaOrganizationServiceOrgStateFilter.from_dict(obj["stateFilter"]) if obj.get("stateFilter") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_organization_service_org_domain_filter import ( + BetaOrganizationServiceOrgDomainFilter, +) +from zitadel_client.models.beta_organization_service_org_id_filter import ( + BetaOrganizationServiceOrgIDFilter, +) +from zitadel_client.models.beta_organization_service_org_name_filter import ( + BetaOrganizationServiceOrgNameFilter, +) +from zitadel_client.models.beta_organization_service_org_state_filter import ( + BetaOrganizationServiceOrgStateFilter, +) + +BetaOrganizationServiceOrganizationSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_pagination_request.py b/zitadel_client/models/beta_organization_service_pagination_request.py index 612b73b0..59d0579a 100644 --- a/zitadel_client/models/beta_organization_service_pagination_request.py +++ b/zitadel_client/models/beta_organization_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaOrganizationServicePaginationRequest(BaseModel): """ BetaOrganizationServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaOrganizationServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaOrganizationServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_pagination_response.py b/zitadel_client/models/beta_organization_service_pagination_response.py index b098b950..8258850d 100644 --- a/zitadel_client/models/beta_organization_service_pagination_response.py +++ b/zitadel_client/models/beta_organization_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServicePaginationResponse(BaseModel): """ BetaOrganizationServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaOrganizationServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaOrganizationServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_password.py b/zitadel_client/models/beta_organization_service_password.py index ed86bfc1..2ec8d065 100644 --- a/zitadel_client/models/beta_organization_service_password.py +++ b/zitadel_client/models/beta_organization_service_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaOrganizationServicePassword(BaseModel): """ BetaOrganizationServicePassword - """ # noqa: E501 - password: Optional[StrictStr] = None + """ + + password: Optional[StrictStr] = Field(default=None, alias="password") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["password", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaOrganizationServicePassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServicePassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +BetaOrganizationServicePassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_send_email_verification_code.py b/zitadel_client/models/beta_organization_service_send_email_verification_code.py index 36498ace..5022743f 100644 --- a/zitadel_client/models/beta_organization_service_send_email_verification_code.py +++ b/zitadel_client/models/beta_organization_service_send_email_verification_code.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceSendEmailVerificationCode(BaseModel): """ BetaOrganizationServiceSendEmailVerificationCode - """ # noqa: E501 + """ + url_template: Optional[StrictStr] = Field(default=None, alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +30,4 @@ class BetaOrganizationServiceSendEmailVerificationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSendEmailVerificationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSendEmailVerificationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +BetaOrganizationServiceSendEmailVerificationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_human_email.py b/zitadel_client/models/beta_organization_service_set_human_email.py index 9d6ca72f..4d5eeaba 100644 --- a/zitadel_client/models/beta_organization_service_set_human_email.py +++ b/zitadel_client/models/beta_organization_service_set_human_email.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_send_email_verification_code import BetaOrganizationServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaOrganizationServiceSetHumanEmail(BaseModel): """ BetaOrganizationServiceSetHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[BetaOrganizationServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[BetaOrganizationServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +35,8 @@ class BetaOrganizationServiceSetHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": BetaOrganizationServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_send_email_verification_code import ( + BetaOrganizationServiceSendEmailVerificationCode, +) +BetaOrganizationServiceSetHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_human_phone.py b/zitadel_client/models/beta_organization_service_set_human_phone.py index 1a6ebcaf..0b6a8f9e 100644 --- a/zitadel_client/models/beta_organization_service_set_human_phone.py +++ b/zitadel_client/models/beta_organization_service_set_human_phone.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaOrganizationServiceSetHumanPhone(BaseModel): """ BetaOrganizationServiceSetHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class BetaOrganizationServiceSetHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +BetaOrganizationServiceSetHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_human_profile.py b/zitadel_client/models/beta_organization_service_set_human_profile.py index 99658d6d..9d992785 100644 --- a/zitadel_client/models/beta_organization_service_set_human_profile.py +++ b/zitadel_client/models/beta_organization_service_set_human_profile.py @@ -1,40 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_organization_service_gender import BetaOrganizationServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceSetHumanProfile(BaseModel): """ BetaOrganizationServiceSetHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[BetaOrganizationServiceGender] = None - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender"] + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[BetaOrganizationServiceGender] = Field( + default=None, alias="gender" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,72 +39,8 @@ class BetaOrganizationServiceSetHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender") - }) - return _obj - +from zitadel_client.models.beta_organization_service_gender import ( + BetaOrganizationServiceGender, +) +BetaOrganizationServiceSetHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_metadata_entry.py b/zitadel_client/models/beta_organization_service_set_metadata_entry.py index 19d4e8c5..cdf38aca 100644 --- a/zitadel_client/models/beta_organization_service_set_metadata_entry.py +++ b/zitadel_client/models/beta_organization_service_set_metadata_entry.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceSetMetadataEntry(BaseModel): """ BetaOrganizationServiceSetMetadataEntry - """ # noqa: E501 - key: Optional[StrictStr] = None - value: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["key", "value"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + value: Optional[Base64Bytes] = Field(default=None, alias="value") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,6 @@ class BetaOrganizationServiceSetMetadataEntry(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetMetadataEntry from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetMetadataEntry from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +BetaOrganizationServiceSetMetadataEntry.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_organization_metadata_request.py b/zitadel_client/models/beta_organization_service_set_organization_metadata_request.py index df77795f..780ec101 100644 --- a/zitadel_client/models/beta_organization_service_set_organization_metadata_request.py +++ b/zitadel_client/models/beta_organization_service_set_organization_metadata_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_organization_service_metadata import BetaOrganizationServiceMetadata -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaOrganizationServiceSetOrganizationMetadataRequest(BaseModel): """ BetaOrganizationServiceSetOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization doman to be verified.", alias="organizationId") - metadata: Optional[List[BetaOrganizationServiceMetadata]] = Field(default=None, description="Metadata to set.") - __properties: ClassVar[List[str]] = ["organizationId", "metadata"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization doman to be verified.", + ) + metadata: Optional[List[BetaOrganizationServiceMetadata]] = Field( + default=None, alias="metadata", description="Metadata to set." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,60 +37,8 @@ class BetaOrganizationServiceSetOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "metadata": [BetaOrganizationServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.beta_organization_service_metadata import ( + BetaOrganizationServiceMetadata, +) +BetaOrganizationServiceSetOrganizationMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_set_organization_metadata_response.py b/zitadel_client/models/beta_organization_service_set_organization_metadata_response.py index c3fe561b..a101d036 100644 --- a/zitadel_client/models/beta_organization_service_set_organization_metadata_response.py +++ b/zitadel_client/models/beta_organization_service_set_organization_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceSetOrganizationMetadataResponse(BaseModel): """ BetaOrganizationServiceSetOrganizationMetadataResponse - """ # noqa: E501 - set_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="setDate") - __properties: ClassVar[List[str]] = ["setDate"] + """ + set_date: Optional[AwareDatetime] = Field( + default=None, + alias="setDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceSetOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceSetOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "setDate": obj.get("setDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceSetOrganizationMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_text_query_method.py b/zitadel_client/models/beta_organization_service_text_query_method.py index b91d314f..29c1b7f9 100644 --- a/zitadel_client/models/beta_organization_service_text_query_method.py +++ b/zitadel_client/models/beta_organization_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaOrganizationServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class BetaOrganizationServiceTextQueryMethod(str, Enum): BetaOrganizationServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaOrganizationServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/beta_organization_service_update_organization_request.py b/zitadel_client/models/beta_organization_service_update_organization_request.py index 7f1917c8..d608c1ed 100644 --- a/zitadel_client/models/beta_organization_service_update_organization_request.py +++ b/zitadel_client/models/beta_organization_service_update_organization_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceUpdateOrganizationRequest(BaseModel): """ BetaOrganizationServiceUpdateOrganizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization to be updated") - name: Optional[StrictStr] = Field(default=None, description="New Name for the Organization to be updated") - __properties: ClassVar[List[str]] = ["id", "name"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Organization Id for the Organization to be updated", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="New Name for the Organization to be updated", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaOrganizationServiceUpdateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceUpdateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceUpdateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - return _obj - - +BetaOrganizationServiceUpdateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_update_organization_response.py b/zitadel_client/models/beta_organization_service_update_organization_response.py index 40fd17d4..6a7e93d2 100644 --- a/zitadel_client/models/beta_organization_service_update_organization_response.py +++ b/zitadel_client/models/beta_organization_service_update_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceUpdateOrganizationResponse(BaseModel): """ BetaOrganizationServiceUpdateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaOrganizationServiceUpdateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceUpdateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceUpdateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceUpdateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_verify_organization_domain_request.py b/zitadel_client/models/beta_organization_service_verify_organization_domain_request.py index d3a46ef8..5435d413 100644 --- a/zitadel_client/models/beta_organization_service_verify_organization_domain_request.py +++ b/zitadel_client/models/beta_organization_service_verify_organization_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaOrganizationServiceVerifyOrganizationDomainRequest(BaseModel): """ BetaOrganizationServiceVerifyOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization doman to be verified.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Organization Id for the Organization doman to be verified.") - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization Id for the Organization doman to be verified.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Organization Id for the Organization doman to be verified.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaOrganizationServiceVerifyOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceVerifyOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceVerifyOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaOrganizationServiceVerifyOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_organization_service_verify_organization_domain_response.py b/zitadel_client/models/beta_organization_service_verify_organization_domain_response.py index f38ef5f2..2019ae55 100644 --- a/zitadel_client/models/beta_organization_service_verify_organization_domain_response.py +++ b/zitadel_client/models/beta_organization_service_verify_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaOrganizationServiceVerifyOrganizationDomainResponse(BaseModel): """ BetaOrganizationServiceVerifyOrganizationDomainResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,8 @@ class BetaOrganizationServiceVerifyOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceVerifyOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaOrganizationServiceVerifyOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaOrganizationServiceVerifyOrganizationDomainResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_project_service_activate_project_grant_request.py b/zitadel_client/models/beta_project_service_activate_project_grant_request.py index 2f7d3347..f939b218 100644 --- a/zitadel_client/models/beta_project_service_activate_project_grant_request.py +++ b/zitadel_client/models/beta_project_service_activate_project_grant_request.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceActivateProjectGrantRequest(BaseModel): """ BetaProjectServiceActivateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="Organization the project is granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="Organization the project is granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class BetaProjectServiceActivateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +BetaProjectServiceActivateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_activate_project_grant_response.py b/zitadel_client/models/beta_project_service_activate_project_grant_response.py index 75f4bab9..df608e96 100644 --- a/zitadel_client/models/beta_project_service_activate_project_grant_response.py +++ b/zitadel_client/models/beta_project_service_activate_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceActivateProjectGrantResponse(BaseModel): """ BetaProjectServiceActivateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceActivateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceActivateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_activate_project_request.py b/zitadel_client/models/beta_project_service_activate_project_request.py index af24ae21..b70c451d 100644 --- a/zitadel_client/models/beta_project_service_activate_project_request.py +++ b/zitadel_client/models/beta_project_service_activate_project_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceActivateProjectRequest(BaseModel): """ BetaProjectServiceActivateProjectRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaProjectServiceActivateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaProjectServiceActivateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_activate_project_response.py b/zitadel_client/models/beta_project_service_activate_project_response.py index c29e02ef..a6929468 100644 --- a/zitadel_client/models/beta_project_service_activate_project_response.py +++ b/zitadel_client/models/beta_project_service_activate_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceActivateProjectResponse(BaseModel): """ BetaProjectServiceActivateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceActivateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceActivateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceActivateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_add_project_role_request.py b/zitadel_client/models/beta_project_service_add_project_role_request.py index 4c61b659..721c39a9 100644 --- a/zitadel_client/models/beta_project_service_add_project_role_request.py +++ b/zitadel_client/models/beta_project_service_add_project_role_request.py @@ -1,37 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceAddProjectRoleRequest(BaseModel): """ BetaProjectServiceAddProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", alias="roleKey") - display_name: Optional[StrictStr] = Field(default=None, description="Name displayed for the role.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.") - __properties: ClassVar[List[str]] = ["projectId", "roleKey", "displayName", "group"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", + ) + display_name: Optional[StrictStr] = Field( + default=None, alias="displayName", description="Name displayed for the role." + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,60 +45,4 @@ class BetaProjectServiceAddProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceAddProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if group (nullable) is None - # and model_fields_set contains the field - if self.group is None and "group" in self.model_fields_set: - _dict['group'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceAddProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - - +BetaProjectServiceAddProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_add_project_role_response.py b/zitadel_client/models/beta_project_service_add_project_role_response.py index f273e424..77e984a9 100644 --- a/zitadel_client/models/beta_project_service_add_project_role_response.py +++ b/zitadel_client/models/beta_project_service_add_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceAddProjectRoleResponse(BaseModel): """ BetaProjectServiceAddProjectRoleResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceAddProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceAddProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceAddProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceAddProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_admin.py b/zitadel_client/models/beta_project_service_admin.py index 18c590c4..cbbf9442 100644 --- a/zitadel_client/models/beta_project_service_admin.py +++ b/zitadel_client/models/beta_project_service_admin.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceAdmin(BaseModel): """ BetaProjectServiceAdmin - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - roles: Optional[List[StrictStr]] = Field(default=None, description="specify the Project Member Roles for the provided user (default is PROJECT_OWNER if roles are empty") - __properties: ClassVar[List[str]] = ["userId", "roles"] + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="specify the Project Member Roles for the provided user (default is PROJECT_OWNER if roles are empty", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,4 @@ class BetaProjectServiceAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "roles": obj.get("roles") - }) - return _obj - - +BetaProjectServiceAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_any.py b/zitadel_client/models/beta_project_service_any.py index 1f612960..1c0c8246 100644 --- a/zitadel_client/models/beta_project_service_any.py +++ b/zitadel_client/models/beta_project_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaProjectServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaProjectServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_connect_error.py b/zitadel_client/models/beta_project_service_connect_error.py index c9725520..8ce24dc9 100644 --- a/zitadel_client/models/beta_project_service_connect_error.py +++ b/zitadel_client/models/beta_project_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_any import BetaProjectServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaProjectServiceConnectErrorCodeEnum(str, Enum): + """BetaProjectServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaProjectServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaProjectServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaProjectServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaProjectServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaProjectServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_project_service_any import BetaProjectServiceAny +BetaProjectServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_create_project_grant_request.py b/zitadel_client/models/beta_project_service_create_project_grant_request.py index 7316cf94..588c3779 100644 --- a/zitadel_client/models/beta_project_service_create_project_grant_request.py +++ b/zitadel_client/models/beta_project_service_create_project_grant_request.py @@ -1,36 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceCreateProjectGrantRequest(BaseModel): """ BetaProjectServiceCreateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="Organization the project is granted to.", alias="grantedOrganizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="Keys of the role available for the project grant.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId", "roleKeys"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="Organization the project is granted to.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="Keys of the role available for the project grant.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +42,4 @@ class BetaProjectServiceCreateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +BetaProjectServiceCreateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_create_project_grant_response.py b/zitadel_client/models/beta_project_service_create_project_grant_response.py index 3e786183..48677366 100644 --- a/zitadel_client/models/beta_project_service_create_project_grant_response.py +++ b/zitadel_client/models/beta_project_service_create_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceCreateProjectGrantResponse(BaseModel): """ BetaProjectServiceCreateProjectGrantResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceCreateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceCreateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_create_project_request.py b/zitadel_client/models/beta_project_service_create_project_request.py index e374d580..4006e724 100644 --- a/zitadel_client/models/beta_project_service_create_project_request.py +++ b/zitadel_client/models/beta_project_service_create_project_request.py @@ -1,43 +1,61 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_admin import BetaProjectServiceAdmin -from zitadel_client.models.beta_project_service_private_labeling_setting import BetaProjectServicePrivateLabelingSetting -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaProjectServiceCreateProjectRequest(BaseModel): """ BetaProjectServiceCreateProjectRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the project belongs to.", alias="organizationId") - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - name: Optional[StrictStr] = Field(default=None, description="Name of the project.") - project_role_assertion: Optional[StrictBool] = Field(default=None, description="Enable this setting to provide role information to your application. For OpenID Connect, the roles can be requested from the UserInfo endpoint or sent in the ID or Access Token, based on your application's configuration.", alias="projectRoleAssertion") - authorization_required: Optional[StrictBool] = Field(default=None, description="Deny authentication if the user has no authorization assigned to this project. Authorizations to the project without assigned a specific role to the user are allowed.", alias="authorizationRequired") - project_access_required: Optional[StrictBool] = Field(default=None, description="Before a user can be authenticated, it is verified that their affiliated organization has been granted access to this project. Authentication is not permitted for users from unauthorized organizations.", alias="projectAccessRequired") - private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - admins: Optional[List[BetaProjectServiceAdmin]] = Field(default=None, description="List of users and Project Member roles (PROJECT_OWNER, by default) to be assigned to those users.") - __properties: ClassVar[List[str]] = ["organizationId", "id", "name", "projectRoleAssertion", "authorizationRequired", "projectAccessRequired", "privateLabelingSetting", "admins"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the project belongs to.", + ) + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name of the project." + ) + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="Enable this setting to provide role information to your application. For OpenID Connect, the roles can be requested from the UserInfo endpoint or sent in the ID or Access Token, based on your application's configuration.", + ) + authorization_required: Optional[StrictBool] = Field( + default=None, + alias="authorizationRequired", + description="Deny authentication if the user has no authorization assigned to this project. Authorizations to the project without assigned a specific role to the user are allowed.", + ) + project_access_required: Optional[StrictBool] = Field( + default=None, + alias="projectAccessRequired", + description="Before a user can be authenticated, it is verified that their affiliated organization has been granted access to this project. Authentication is not permitted for users from unauthorized organizations.", + ) + private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = ( + Field(default=None, alias="privateLabelingSetting") + ) + admins: Optional[List[BetaProjectServiceAdmin]] = Field( + default=None, + alias="admins", + description="List of users and Project Member roles (PROJECT_OWNER, by default) to be assigned to those users.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,71 +63,9 @@ class BetaProjectServiceCreateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in admins (list) - _items = [] - if self.admins: - for _item_admins in self.admins: - if _item_admins: - _items.append(_item_admins.to_dict()) - _dict['admins'] = _items - # set to None if id (nullable) is None - # and model_fields_set contains the field - if self.id is None and "id" in self.model_fields_set: - _dict['id'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "id": obj.get("id"), - "name": obj.get("name"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "authorizationRequired": obj.get("authorizationRequired"), - "projectAccessRequired": obj.get("projectAccessRequired"), - "privateLabelingSetting": obj.get("privateLabelingSetting"), - "admins": [BetaProjectServiceAdmin.from_dict(_item) for _item in obj["admins"]] if obj.get("admins") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_admin import BetaProjectServiceAdmin +from zitadel_client.models.beta_project_service_private_labeling_setting import ( + BetaProjectServicePrivateLabelingSetting, +) +BetaProjectServiceCreateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_create_project_response.py b/zitadel_client/models/beta_project_service_create_project_response.py index fc42a4bc..44c9bb11 100644 --- a/zitadel_client/models/beta_project_service_create_project_response.py +++ b/zitadel_client/models/beta_project_service_create_project_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceCreateProjectResponse(BaseModel): """ BetaProjectServiceCreateProjectResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created project.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created project.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class BetaProjectServiceCreateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceCreateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceCreateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_deactivate_project_grant_request.py b/zitadel_client/models/beta_project_service_deactivate_project_grant_request.py index 79968ea3..f23fa8f9 100644 --- a/zitadel_client/models/beta_project_service_deactivate_project_grant_request.py +++ b/zitadel_client/models/beta_project_service_deactivate_project_grant_request.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceDeactivateProjectGrantRequest(BaseModel): """ BetaProjectServiceDeactivateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="Organization the project is granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="Organization the project is granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class BetaProjectServiceDeactivateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +BetaProjectServiceDeactivateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_deactivate_project_grant_response.py b/zitadel_client/models/beta_project_service_deactivate_project_grant_response.py index 79c3011b..32e45eeb 100644 --- a/zitadel_client/models/beta_project_service_deactivate_project_grant_response.py +++ b/zitadel_client/models/beta_project_service_deactivate_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceDeactivateProjectGrantResponse(BaseModel): """ BetaProjectServiceDeactivateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceDeactivateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceDeactivateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_deactivate_project_request.py b/zitadel_client/models/beta_project_service_deactivate_project_request.py index 142993f6..924c06f6 100644 --- a/zitadel_client/models/beta_project_service_deactivate_project_request.py +++ b/zitadel_client/models/beta_project_service_deactivate_project_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceDeactivateProjectRequest(BaseModel): """ BetaProjectServiceDeactivateProjectRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaProjectServiceDeactivateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaProjectServiceDeactivateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_deactivate_project_response.py b/zitadel_client/models/beta_project_service_deactivate_project_response.py index 2ccc5bbc..3aa0f268 100644 --- a/zitadel_client/models/beta_project_service_deactivate_project_response.py +++ b/zitadel_client/models/beta_project_service_deactivate_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceDeactivateProjectResponse(BaseModel): """ BetaProjectServiceDeactivateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceDeactivateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeactivateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceDeactivateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_delete_project_grant_request.py b/zitadel_client/models/beta_project_service_delete_project_grant_request.py index 806b8e53..972f89d9 100644 --- a/zitadel_client/models/beta_project_service_delete_project_grant_request.py +++ b/zitadel_client/models/beta_project_service_delete_project_grant_request.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceDeleteProjectGrantRequest(BaseModel): """ BetaProjectServiceDeleteProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="Organization the project is granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="Organization the project is granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class BetaProjectServiceDeleteProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +BetaProjectServiceDeleteProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_delete_project_grant_response.py b/zitadel_client/models/beta_project_service_delete_project_grant_response.py index 9214120b..fa66c586 100644 --- a/zitadel_client/models/beta_project_service_delete_project_grant_response.py +++ b/zitadel_client/models/beta_project_service_delete_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceDeleteProjectGrantResponse(BaseModel): """ BetaProjectServiceDeleteProjectGrantResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceDeleteProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceDeleteProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_delete_project_request.py b/zitadel_client/models/beta_project_service_delete_project_request.py index 283cf51a..7a4e6e99 100644 --- a/zitadel_client/models/beta_project_service_delete_project_request.py +++ b/zitadel_client/models/beta_project_service_delete_project_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceDeleteProjectRequest(BaseModel): """ BetaProjectServiceDeleteProjectRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaProjectServiceDeleteProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaProjectServiceDeleteProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_delete_project_response.py b/zitadel_client/models/beta_project_service_delete_project_response.py index 9e1c7f44..d8c07e2f 100644 --- a/zitadel_client/models/beta_project_service_delete_project_response.py +++ b/zitadel_client/models/beta_project_service_delete_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceDeleteProjectResponse(BaseModel): """ BetaProjectServiceDeleteProjectResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceDeleteProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceDeleteProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceDeleteProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_get_project_request.py b/zitadel_client/models/beta_project_service_get_project_request.py index 15e27946..56eea851 100644 --- a/zitadel_client/models/beta_project_service_get_project_request.py +++ b/zitadel_client/models/beta_project_service_get_project_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceGetProjectRequest(BaseModel): """ BetaProjectServiceGetProjectRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaProjectServiceGetProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceGetProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceGetProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaProjectServiceGetProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_get_project_response.py b/zitadel_client/models/beta_project_service_get_project_response.py index 8a84a75f..64870f0e 100644 --- a/zitadel_client/models/beta_project_service_get_project_response.py +++ b/zitadel_client/models/beta_project_service_get_project_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_project import BetaProjectServiceProject -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaProjectServiceGetProjectResponse(BaseModel): """ BetaProjectServiceGetProjectResponse - """ # noqa: E501 - project: Optional[BetaProjectServiceProject] = None - __properties: ClassVar[List[str]] = ["project"] + """ + project: Optional[BetaProjectServiceProject] = Field(default=None, alias="project") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaProjectServiceGetProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceGetProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project - if self.project: - _dict['project'] = self.project.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceGetProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "project": BetaProjectServiceProject.from_dict(obj["project"]) if obj.get("project") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_project import BetaProjectServiceProject +BetaProjectServiceGetProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_granted_project_state.py b/zitadel_client/models/beta_project_service_granted_project_state.py index d788b91b..c5803fc0 100644 --- a/zitadel_client/models/beta_project_service_granted_project_state.py +++ b/zitadel_client/models/beta_project_service_granted_project_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceGrantedProjectState(str, Enum): @@ -23,16 +13,6 @@ class BetaProjectServiceGrantedProjectState(str, Enum): BetaProjectServiceGrantedProjectState """ - """ - allowed enum values - """ - GRANTED_PROJECT_STATE_UNSPECIFIED = 'GRANTED_PROJECT_STATE_UNSPECIFIED' - GRANTED_PROJECT_STATE_ACTIVE = 'GRANTED_PROJECT_STATE_ACTIVE' - GRANTED_PROJECT_STATE_INACTIVE = 'GRANTED_PROJECT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceGrantedProjectState from a JSON string""" - return cls(json.loads(json_str)) - - + GRANTED_PROJECT_STATE_UNSPECIFIED = "GRANTED_PROJECT_STATE_UNSPECIFIED" + GRANTED_PROJECT_STATE_ACTIVE = "GRANTED_PROJECT_STATE_ACTIVE" + GRANTED_PROJECT_STATE_INACTIVE = "GRANTED_PROJECT_STATE_INACTIVE" diff --git a/zitadel_client/models/beta_project_service_id_filter.py b/zitadel_client/models/beta_project_service_id_filter.py index ccc07600..5bb8963f 100644 --- a/zitadel_client/models/beta_project_service_id_filter.py +++ b/zitadel_client/models/beta_project_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceIDFilter(BaseModel): """ BetaProjectServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaProjectServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaProjectServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_in_ids_filter.py b/zitadel_client/models/beta_project_service_in_ids_filter.py index ccb5fff2..80a743a4 100644 --- a/zitadel_client/models/beta_project_service_in_ids_filter.py +++ b/zitadel_client/models/beta_project_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceInIDsFilter(BaseModel): """ BetaProjectServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class BetaProjectServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +BetaProjectServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_project_grants_request.py b/zitadel_client/models/beta_project_service_list_project_grants_request.py index 6acccab5..68f65840 100644 --- a/zitadel_client/models/beta_project_service_list_project_grants_request.py +++ b/zitadel_client/models/beta_project_service_list_project_grants_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_request import BetaProjectServicePaginationRequest -from zitadel_client.models.beta_project_service_project_grant_field_name import BetaProjectServiceProjectGrantFieldName -from zitadel_client.models.beta_project_service_project_grant_search_filter import BetaProjectServiceProjectGrantSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaProjectServiceListProjectGrantsRequest(BaseModel): """ BetaProjectServiceListProjectGrantsRequest - """ # noqa: E501 - pagination: Optional[BetaProjectServicePaginationRequest] = None - sorting_column: Optional[BetaProjectServiceProjectGrantFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaProjectServiceProjectGrantSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaProjectServiceProjectGrantFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaProjectServiceProjectGrantSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class BetaProjectServiceListProjectGrantsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectGrantsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectGrantsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaProjectServiceProjectGrantSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_request import ( + BetaProjectServicePaginationRequest, +) +from zitadel_client.models.beta_project_service_project_grant_field_name import ( + BetaProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.beta_project_service_project_grant_search_filter import ( + BetaProjectServiceProjectGrantSearchFilter, +) +BetaProjectServiceListProjectGrantsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_project_grants_response.py b/zitadel_client/models/beta_project_service_list_project_grants_response.py index c9e14d03..d17b8041 100644 --- a/zitadel_client/models/beta_project_service_list_project_grants_response.py +++ b/zitadel_client/models/beta_project_service_list_project_grants_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_response import BetaProjectServicePaginationResponse -from zitadel_client.models.beta_project_service_project_grant import BetaProjectServiceProjectGrant -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaProjectServiceListProjectGrantsResponse(BaseModel): """ BetaProjectServiceListProjectGrantsResponse - """ # noqa: E501 - pagination: Optional[BetaProjectServicePaginationResponse] = None - project_grants: Optional[List[BetaProjectServiceProjectGrant]] = Field(default=None, alias="projectGrants") - __properties: ClassVar[List[str]] = ["pagination", "projectGrants"] + """ + + pagination: Optional[BetaProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + project_grants: Optional[List[BetaProjectServiceProjectGrant]] = Field( + default=None, alias="projectGrants" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaProjectServiceListProjectGrantsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectGrantsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in project_grants (list) - _items = [] - if self.project_grants: - for _item_project_grants in self.project_grants: - if _item_project_grants: - _items.append(_item_project_grants.to_dict()) - _dict['projectGrants'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectGrantsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projectGrants": [BetaProjectServiceProjectGrant.from_dict(_item) for _item in obj["projectGrants"]] if obj.get("projectGrants") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_response import ( + BetaProjectServicePaginationResponse, +) +from zitadel_client.models.beta_project_service_project_grant import ( + BetaProjectServiceProjectGrant, +) +BetaProjectServiceListProjectGrantsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_project_roles_request.py b/zitadel_client/models/beta_project_service_list_project_roles_request.py index f288bddb..85e7a9bd 100644 --- a/zitadel_client/models/beta_project_service_list_project_roles_request.py +++ b/zitadel_client/models/beta_project_service_list_project_roles_request.py @@ -1,40 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_request import BetaProjectServicePaginationRequest -from zitadel_client.models.beta_project_service_project_role_field_name import BetaProjectServiceProjectRoleFieldName -from zitadel_client.models.beta_project_service_project_role_search_filter import BetaProjectServiceProjectRoleSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceListProjectRolesRequest(BaseModel): """ BetaProjectServiceListProjectRolesRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - pagination: Optional[BetaProjectServicePaginationRequest] = None - sorting_column: Optional[BetaProjectServiceProjectRoleFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaProjectServiceProjectRoleSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["projectId", "pagination", "sortingColumn", "filters"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + pagination: Optional[BetaProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaProjectServiceProjectRoleFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaProjectServiceProjectRoleSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +41,14 @@ class BetaProjectServiceListProjectRolesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectRolesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectRolesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "pagination": BetaProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaProjectServiceProjectRoleSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_request import ( + BetaProjectServicePaginationRequest, +) +from zitadel_client.models.beta_project_service_project_role_field_name import ( + BetaProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.beta_project_service_project_role_search_filter import ( + BetaProjectServiceProjectRoleSearchFilter, +) +BetaProjectServiceListProjectRolesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_project_roles_response.py b/zitadel_client/models/beta_project_service_list_project_roles_response.py index 1bc4f7ef..fd639a2a 100644 --- a/zitadel_client/models/beta_project_service_list_project_roles_response.py +++ b/zitadel_client/models/beta_project_service_list_project_roles_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_response import BetaProjectServicePaginationResponse -from zitadel_client.models.beta_project_service_project_role import BetaProjectServiceProjectRole -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaProjectServiceListProjectRolesResponse(BaseModel): """ BetaProjectServiceListProjectRolesResponse - """ # noqa: E501 - pagination: Optional[BetaProjectServicePaginationResponse] = None - project_roles: Optional[List[BetaProjectServiceProjectRole]] = Field(default=None, alias="projectRoles") - __properties: ClassVar[List[str]] = ["pagination", "projectRoles"] + """ + + pagination: Optional[BetaProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + project_roles: Optional[List[BetaProjectServiceProjectRole]] = Field( + default=None, alias="projectRoles" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaProjectServiceListProjectRolesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectRolesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in project_roles (list) - _items = [] - if self.project_roles: - for _item_project_roles in self.project_roles: - if _item_project_roles: - _items.append(_item_project_roles.to_dict()) - _dict['projectRoles'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectRolesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projectRoles": [BetaProjectServiceProjectRole.from_dict(_item) for _item in obj["projectRoles"]] if obj.get("projectRoles") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_response import ( + BetaProjectServicePaginationResponse, +) +from zitadel_client.models.beta_project_service_project_role import ( + BetaProjectServiceProjectRole, +) +BetaProjectServiceListProjectRolesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_projects_request.py b/zitadel_client/models/beta_project_service_list_projects_request.py index c5e923cf..aa2ed441 100644 --- a/zitadel_client/models/beta_project_service_list_projects_request.py +++ b/zitadel_client/models/beta_project_service_list_projects_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_request import BetaProjectServicePaginationRequest -from zitadel_client.models.beta_project_service_project_field_name import BetaProjectServiceProjectFieldName -from zitadel_client.models.beta_project_service_project_search_filter import BetaProjectServiceProjectSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaProjectServiceListProjectsRequest(BaseModel): """ BetaProjectServiceListProjectsRequest - """ # noqa: E501 - pagination: Optional[BetaProjectServicePaginationRequest] = None - sorting_column: Optional[BetaProjectServiceProjectFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[BetaProjectServiceProjectSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[BetaProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[BetaProjectServiceProjectFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[BetaProjectServiceProjectSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class BetaProjectServiceListProjectsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [BetaProjectServiceProjectSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_request import ( + BetaProjectServicePaginationRequest, +) +from zitadel_client.models.beta_project_service_project_field_name import ( + BetaProjectServiceProjectFieldName, +) +from zitadel_client.models.beta_project_service_project_search_filter import ( + BetaProjectServiceProjectSearchFilter, +) +BetaProjectServiceListProjectsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_list_projects_response.py b/zitadel_client/models/beta_project_service_list_projects_response.py index 9ed6f4c6..4f2be363 100644 --- a/zitadel_client/models/beta_project_service_list_projects_response.py +++ b/zitadel_client/models/beta_project_service_list_projects_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_pagination_response import BetaProjectServicePaginationResponse -from zitadel_client.models.beta_project_service_project import BetaProjectServiceProject -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaProjectServiceListProjectsResponse(BaseModel): """ BetaProjectServiceListProjectsResponse - """ # noqa: E501 - pagination: Optional[BetaProjectServicePaginationResponse] = None - projects: Optional[List[BetaProjectServiceProject]] = None - __properties: ClassVar[List[str]] = ["pagination", "projects"] + """ + + pagination: Optional[BetaProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + projects: Optional[List[BetaProjectServiceProject]] = Field( + default=None, alias="projects" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class BetaProjectServiceListProjectsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in projects (list) - _items = [] - if self.projects: - for _item_projects in self.projects: - if _item_projects: - _items.append(_item_projects.to_dict()) - _dict['projects'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceListProjectsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": BetaProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projects": [BetaProjectServiceProject.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_pagination_response import ( + BetaProjectServicePaginationResponse, +) +from zitadel_client.models.beta_project_service_project import BetaProjectServiceProject +BetaProjectServiceListProjectsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_pagination_request.py b/zitadel_client/models/beta_project_service_pagination_request.py index f69c7d24..d1f3c731 100644 --- a/zitadel_client/models/beta_project_service_pagination_request.py +++ b/zitadel_client/models/beta_project_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaProjectServicePaginationRequest(BaseModel): """ BetaProjectServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class BetaProjectServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaProjectServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_pagination_response.py b/zitadel_client/models/beta_project_service_pagination_response.py index 7d8142f4..bcfa8480 100644 --- a/zitadel_client/models/beta_project_service_pagination_response.py +++ b/zitadel_client/models/beta_project_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServicePaginationResponse(BaseModel): """ BetaProjectServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class BetaProjectServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +BetaProjectServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_private_labeling_setting.py b/zitadel_client/models/beta_project_service_private_labeling_setting.py index a4eae95a..49bd43cf 100644 --- a/zitadel_client/models/beta_project_service_private_labeling_setting.py +++ b/zitadel_client/models/beta_project_service_private_labeling_setting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServicePrivateLabelingSetting(str, Enum): @@ -23,16 +13,10 @@ class BetaProjectServicePrivateLabelingSetting(str, Enum): BetaProjectServicePrivateLabelingSetting """ - """ - allowed enum values - """ - PRIVATE_LABELING_SETTING_UNSPECIFIED = 'PRIVATE_LABELING_SETTING_UNSPECIFIED' - PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY' - PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServicePrivateLabelingSetting from a JSON string""" - return cls(json.loads(json_str)) - - + PRIVATE_LABELING_SETTING_UNSPECIFIED = "PRIVATE_LABELING_SETTING_UNSPECIFIED" + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = ( + "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY" + ) + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = ( + "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY" + ) diff --git a/zitadel_client/models/beta_project_service_project.py b/zitadel_client/models/beta_project_service_project.py index e813c7f7..307a29f1 100644 --- a/zitadel_client/models/beta_project_service_project.py +++ b/zitadel_client/models/beta_project_service_project.py @@ -1,50 +1,80 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_granted_project_state import BetaProjectServiceGrantedProjectState -from zitadel_client.models.beta_project_service_private_labeling_setting import BetaProjectServicePrivateLabelingSetting -from zitadel_client.models.beta_project_service_project_state import BetaProjectServiceProjectState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaProjectServiceProject(BaseModel): """ BetaProjectServiceProject - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the project.") - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the project belongs to.", alias="organizationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - name: Optional[StrictStr] = Field(default=None, description="The name of the project.") - state: Optional[BetaProjectServiceProjectState] = None - project_role_assertion: Optional[StrictBool] = Field(default=None, description="Describes if the roles of the user should be added to the token.", alias="projectRoleAssertion") - authorization_required: Optional[StrictBool] = Field(default=None, description="When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project.", alias="authorizationRequired") - project_access_required: Optional[StrictBool] = Field(default=None, description="When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", alias="projectAccessRequired") - private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="The ID of the organization the project is granted to.", alias="grantedOrganizationId") - granted_organization_name: Optional[StrictStr] = Field(default=None, description="The name of the organization the project is granted to.", alias="grantedOrganizationName") - granted_state: Optional[BetaProjectServiceGrantedProjectState] = Field(default=None, alias="grantedState") - __properties: ClassVar[List[str]] = ["id", "organizationId", "creationDate", "changeDate", "name", "state", "projectRoleAssertion", "authorizationRequired", "projectAccessRequired", "privateLabelingSetting", "grantedOrganizationId", "grantedOrganizationName", "grantedState"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the project." + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the project belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="The name of the project." + ) + state: Optional[BetaProjectServiceProjectState] = Field(default=None, alias="state") + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="Describes if the roles of the user should be added to the token.", + ) + authorization_required: Optional[StrictBool] = Field( + default=None, + alias="authorizationRequired", + description="When enabled ZITADEL will check if a user has an authorization to use this project assigned when login into an application of this project.", + ) + project_access_required: Optional[StrictBool] = Field( + default=None, + alias="projectAccessRequired", + description="When enabled ZITADEL will check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", + ) + private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = ( + Field(default=None, alias="privateLabelingSetting") + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="The ID of the organization the project is granted to.", + ) + granted_organization_name: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationName", + description="The name of the organization the project is granted to.", + ) + granted_state: Optional[BetaProjectServiceGrantedProjectState] = Field( + default=None, alias="grantedState" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -52,74 +82,15 @@ class BetaProjectServiceProject(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProject from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if granted_organization_id (nullable) is None - # and model_fields_set contains the field - if self.granted_organization_id is None and "granted_organization_id" in self.model_fields_set: - _dict['grantedOrganizationId'] = None - - # set to None if granted_organization_name (nullable) is None - # and model_fields_set contains the field - if self.granted_organization_name is None and "granted_organization_name" in self.model_fields_set: - _dict['grantedOrganizationName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProject from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "organizationId": obj.get("organizationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "name": obj.get("name"), - "state": obj.get("state"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "authorizationRequired": obj.get("authorizationRequired"), - "projectAccessRequired": obj.get("projectAccessRequired"), - "privateLabelingSetting": obj.get("privateLabelingSetting"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "grantedOrganizationName": obj.get("grantedOrganizationName"), - "grantedState": obj.get("grantedState") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_project_service_granted_project_state import ( + BetaProjectServiceGrantedProjectState, +) +from zitadel_client.models.beta_project_service_private_labeling_setting import ( + BetaProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.beta_project_service_project_state import ( + BetaProjectServiceProjectState, +) +BetaProjectServiceProject.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_field_name.py b/zitadel_client/models/beta_project_service_project_field_name.py index a9d8c4c9..ff89783e 100644 --- a/zitadel_client/models/beta_project_service_project_field_name.py +++ b/zitadel_client/models/beta_project_service_project_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceProjectFieldName(str, Enum): @@ -23,18 +13,8 @@ class BetaProjectServiceProjectFieldName(str, Enum): BetaProjectServiceProjectFieldName """ - """ - allowed enum values - """ - PROJECT_FIELD_NAME_UNSPECIFIED = 'PROJECT_FIELD_NAME_UNSPECIFIED' - PROJECT_FIELD_NAME_ID = 'PROJECT_FIELD_NAME_ID' - PROJECT_FIELD_NAME_CREATION_DATE = 'PROJECT_FIELD_NAME_CREATION_DATE' - PROJECT_FIELD_NAME_CHANGE_DATE = 'PROJECT_FIELD_NAME_CHANGE_DATE' - PROJECT_FIELD_NAME_NAME = 'PROJECT_FIELD_NAME_NAME' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceProjectFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_FIELD_NAME_UNSPECIFIED = "PROJECT_FIELD_NAME_UNSPECIFIED" + PROJECT_FIELD_NAME_ID = "PROJECT_FIELD_NAME_ID" + PROJECT_FIELD_NAME_CREATION_DATE = "PROJECT_FIELD_NAME_CREATION_DATE" + PROJECT_FIELD_NAME_CHANGE_DATE = "PROJECT_FIELD_NAME_CHANGE_DATE" + PROJECT_FIELD_NAME_NAME = "PROJECT_FIELD_NAME_NAME" diff --git a/zitadel_client/models/beta_project_service_project_grant.py b/zitadel_client/models/beta_project_service_project_grant.py index da383ea2..1881e7df 100644 --- a/zitadel_client/models/beta_project_service_project_grant.py +++ b/zitadel_client/models/beta_project_service_project_grant.py @@ -1,44 +1,68 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_project_service_project_grant_state import BetaProjectServiceProjectGrantState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceProjectGrant(BaseModel): """ BetaProjectServiceProjectGrant - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization which granted the project to the granted_organization_id.", alias="organizationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="The ID of the organization the project is granted to.", alias="grantedOrganizationId") - granted_organization_name: Optional[StrictStr] = Field(default=None, description="The name of the organization the project is granted to.", alias="grantedOrganizationName") - granted_role_keys: Optional[List[StrictStr]] = Field(default=None, description="The roles of the granted project.", alias="grantedRoleKeys") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the granted project.", alias="projectId") - project_name: Optional[StrictStr] = Field(default=None, description="The name of the granted project.", alias="projectName") - state: Optional[BetaProjectServiceProjectGrantState] = None - __properties: ClassVar[List[str]] = ["organizationId", "creationDate", "changeDate", "grantedOrganizationId", "grantedOrganizationName", "grantedRoleKeys", "projectId", "projectName", "state"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization which granted the project to the granted_organization_id.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="The ID of the organization the project is granted to.", + ) + granted_organization_name: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationName", + description="The name of the organization the project is granted to.", + ) + granted_role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="grantedRoleKeys", + description="The roles of the granted project.", + ) + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="The ID of the granted project." + ) + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="The name of the granted project.", + ) + state: Optional[BetaProjectServiceProjectGrantState] = Field( + default=None, alias="state" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,60 +70,9 @@ class BetaProjectServiceProjectGrant(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectGrant from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectGrant from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "grantedOrganizationName": obj.get("grantedOrganizationName"), - "grantedRoleKeys": obj.get("grantedRoleKeys"), - "projectId": obj.get("projectId"), - "projectName": obj.get("projectName"), - "state": obj.get("state") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_project_service_project_grant_state import ( + BetaProjectServiceProjectGrantState, +) +BetaProjectServiceProjectGrant.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_grant_field_name.py b/zitadel_client/models/beta_project_service_project_grant_field_name.py index 96f740ff..e2f6fafc 100644 --- a/zitadel_client/models/beta_project_service_project_grant_field_name.py +++ b/zitadel_client/models/beta_project_service_project_grant_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceProjectGrantFieldName(str, Enum): @@ -23,17 +13,7 @@ class BetaProjectServiceProjectGrantFieldName(str, Enum): BetaProjectServiceProjectGrantFieldName """ - """ - allowed enum values - """ - PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = 'PROJECT_GRANT_FIELD_NAME_UNSPECIFIED' - PROJECT_GRANT_FIELD_NAME_PROJECT_ID = 'PROJECT_GRANT_FIELD_NAME_PROJECT_ID' - PROJECT_GRANT_FIELD_NAME_CREATION_DATE = 'PROJECT_GRANT_FIELD_NAME_CREATION_DATE' - PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = 'PROJECT_GRANT_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceProjectGrantFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED" + PROJECT_GRANT_FIELD_NAME_PROJECT_ID = "PROJECT_GRANT_FIELD_NAME_PROJECT_ID" + PROJECT_GRANT_FIELD_NAME_CREATION_DATE = "PROJECT_GRANT_FIELD_NAME_CREATION_DATE" + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/beta_project_service_project_grant_search_filter.py b/zitadel_client/models/beta_project_service_project_grant_search_filter.py index 9e1e2cea..74eada6a 100644 --- a/zitadel_client/models/beta_project_service_project_grant_search_filter.py +++ b/zitadel_client/models/beta_project_service_project_grant_search_filter.py @@ -1,42 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_id_filter import BetaProjectServiceIDFilter -from zitadel_client.models.beta_project_service_in_ids_filter import BetaProjectServiceInIDsFilter -from zitadel_client.models.beta_project_service_project_name_filter import BetaProjectServiceProjectNameFilter -from zitadel_client.models.beta_project_service_project_role_key_filter import BetaProjectServiceProjectRoleKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceProjectGrantSearchFilter(BaseModel): """ BetaProjectServiceProjectGrantSearchFilter - """ # noqa: E501 - in_project_ids_filter: Optional[BetaProjectServiceInIDsFilter] = Field(default=None, alias="inProjectIdsFilter") - project_grant_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field(default=None, alias="projectGrantResourceOwnerFilter") - project_name_filter: Optional[BetaProjectServiceProjectNameFilter] = Field(default=None, alias="projectNameFilter") - project_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field(default=None, alias="projectResourceOwnerFilter") - role_key_filter: Optional[BetaProjectServiceProjectRoleKeyFilter] = Field(default=None, alias="roleKeyFilter") - __properties: ClassVar[List[str]] = ["inProjectIdsFilter", "projectGrantResourceOwnerFilter", "projectNameFilter", "projectResourceOwnerFilter", "roleKeyFilter"] + """ + + in_project_ids_filter: Optional[BetaProjectServiceInIDsFilter] = Field( + default=None, alias="inProjectIdsFilter" + ) + project_grant_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field( + default=None, alias="projectGrantResourceOwnerFilter" + ) + project_name_filter: Optional[BetaProjectServiceProjectNameFilter] = Field( + default=None, alias="projectNameFilter" + ) + project_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field( + default=None, alias="projectResourceOwnerFilter" + ) + role_key_filter: Optional[BetaProjectServiceProjectRoleKeyFilter] = Field( + default=None, alias="roleKeyFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,71 +43,17 @@ class BetaProjectServiceProjectGrantSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectGrantSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of in_project_ids_filter - if self.in_project_ids_filter: - _dict['inProjectIdsFilter'] = self.in_project_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant_resource_owner_filter - if self.project_grant_resource_owner_filter: - _dict['projectGrantResourceOwnerFilter'] = self.project_grant_resource_owner_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name_filter - if self.project_name_filter: - _dict['projectNameFilter'] = self.project_name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_resource_owner_filter - if self.project_resource_owner_filter: - _dict['projectResourceOwnerFilter'] = self.project_resource_owner_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key_filter - if self.role_key_filter: - _dict['roleKeyFilter'] = self.role_key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectGrantSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inProjectIdsFilter": BetaProjectServiceInIDsFilter.from_dict(obj["inProjectIdsFilter"]) if obj.get("inProjectIdsFilter") is not None else None, - "projectGrantResourceOwnerFilter": BetaProjectServiceIDFilter.from_dict(obj["projectGrantResourceOwnerFilter"]) if obj.get("projectGrantResourceOwnerFilter") is not None else None, - "projectNameFilter": BetaProjectServiceProjectNameFilter.from_dict(obj["projectNameFilter"]) if obj.get("projectNameFilter") is not None else None, - "projectResourceOwnerFilter": BetaProjectServiceIDFilter.from_dict(obj["projectResourceOwnerFilter"]) if obj.get("projectResourceOwnerFilter") is not None else None, - "roleKeyFilter": BetaProjectServiceProjectRoleKeyFilter.from_dict(obj["roleKeyFilter"]) if obj.get("roleKeyFilter") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_project_service_id_filter import ( + BetaProjectServiceIDFilter, +) +from zitadel_client.models.beta_project_service_in_ids_filter import ( + BetaProjectServiceInIDsFilter, +) +from zitadel_client.models.beta_project_service_project_name_filter import ( + BetaProjectServiceProjectNameFilter, +) +from zitadel_client.models.beta_project_service_project_role_key_filter import ( + BetaProjectServiceProjectRoleKeyFilter, +) + +BetaProjectServiceProjectGrantSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_grant_state.py b/zitadel_client/models/beta_project_service_project_grant_state.py index f1524333..5a3a544f 100644 --- a/zitadel_client/models/beta_project_service_project_grant_state.py +++ b/zitadel_client/models/beta_project_service_project_grant_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceProjectGrantState(str, Enum): @@ -23,16 +13,6 @@ class BetaProjectServiceProjectGrantState(str, Enum): BetaProjectServiceProjectGrantState """ - """ - allowed enum values - """ - PROJECT_GRANT_STATE_UNSPECIFIED = 'PROJECT_GRANT_STATE_UNSPECIFIED' - PROJECT_GRANT_STATE_ACTIVE = 'PROJECT_GRANT_STATE_ACTIVE' - PROJECT_GRANT_STATE_INACTIVE = 'PROJECT_GRANT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceProjectGrantState from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_GRANT_STATE_UNSPECIFIED = "PROJECT_GRANT_STATE_UNSPECIFIED" + PROJECT_GRANT_STATE_ACTIVE = "PROJECT_GRANT_STATE_ACTIVE" + PROJECT_GRANT_STATE_INACTIVE = "PROJECT_GRANT_STATE_INACTIVE" diff --git a/zitadel_client/models/beta_project_service_project_name_filter.py b/zitadel_client/models/beta_project_service_project_name_filter.py index 3930d475..912ae6be 100644 --- a/zitadel_client/models/beta_project_service_project_name_filter.py +++ b/zitadel_client/models/beta_project_service_project_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_text_filter_method import BetaProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceProjectNameFilter(BaseModel): """ BetaProjectServiceProjectNameFilter - """ # noqa: E501 - project_name: Optional[StrictStr] = Field(default=None, description="Defines the name of the project to query for.", alias="projectName") - method: Optional[BetaProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["projectName", "method"] + """ + + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="Defines the name of the project to query for.", + ) + method: Optional[BetaProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class BetaProjectServiceProjectNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectName": obj.get("projectName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_project_service_text_filter_method import ( + BetaProjectServiceTextFilterMethod, +) +BetaProjectServiceProjectNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_role.py b/zitadel_client/models/beta_project_service_project_role.py index 74798c8d..a1556e3b 100644 --- a/zitadel_client/models/beta_project_service_project_role.py +++ b/zitadel_client/models/beta_project_service_project_role.py @@ -1,40 +1,51 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceProjectRole(BaseModel): """ BetaProjectServiceProjectRole - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - key: Optional[StrictStr] = Field(default=None, description="Key of the project role.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - display_name: Optional[StrictStr] = Field(default=None, description="Display name of the project role.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="Group of the project role.") - __properties: ClassVar[List[str]] = ["projectId", "key", "creationDate", "changeDate", "displayName", "group"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + key: Optional[StrictStr] = Field( + default=None, alias="key", description="Key of the project role." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Display name of the project role.", + ) + group: Optional[StrictStr] = Field( + default=None, alias="group", description="Group of the project role." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +53,6 @@ class BetaProjectServiceProjectRole(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRole from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRole from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "key": obj.get("key"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceProjectRole.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_role_display_name_filter.py b/zitadel_client/models/beta_project_service_project_role_display_name_filter.py index 33819783..fc15d449 100644 --- a/zitadel_client/models/beta_project_service_project_role_display_name_filter.py +++ b/zitadel_client/models/beta_project_service_project_role_display_name_filter.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_text_filter_method import BetaProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceProjectRoleDisplayNameFilter(BaseModel): """ BetaProjectServiceProjectRoleDisplayNameFilter - """ # noqa: E501 + """ + display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - method: Optional[BetaProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + method: Optional[BetaProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaProjectServiceProjectRoleDisplayNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleDisplayNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleDisplayNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_project_service_text_filter_method import ( + BetaProjectServiceTextFilterMethod, +) +BetaProjectServiceProjectRoleDisplayNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_role_field_name.py b/zitadel_client/models/beta_project_service_project_role_field_name.py index af9c098e..9e79fb3e 100644 --- a/zitadel_client/models/beta_project_service_project_role_field_name.py +++ b/zitadel_client/models/beta_project_service_project_role_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceProjectRoleFieldName(str, Enum): @@ -23,17 +13,7 @@ class BetaProjectServiceProjectRoleFieldName(str, Enum): BetaProjectServiceProjectRoleFieldName """ - """ - allowed enum values - """ - PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = 'PROJECT_ROLE_FIELD_NAME_UNSPECIFIED' - PROJECT_ROLE_FIELD_NAME_KEY = 'PROJECT_ROLE_FIELD_NAME_KEY' - PROJECT_ROLE_FIELD_NAME_CREATION_DATE = 'PROJECT_ROLE_FIELD_NAME_CREATION_DATE' - PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = 'PROJECT_ROLE_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceProjectRoleFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED" + PROJECT_ROLE_FIELD_NAME_KEY = "PROJECT_ROLE_FIELD_NAME_KEY" + PROJECT_ROLE_FIELD_NAME_CREATION_DATE = "PROJECT_ROLE_FIELD_NAME_CREATION_DATE" + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/beta_project_service_project_role_key_filter.py b/zitadel_client/models/beta_project_service_project_role_key_filter.py index 28e04be4..4e4101fa 100644 --- a/zitadel_client/models/beta_project_service_project_role_key_filter.py +++ b/zitadel_client/models/beta_project_service_project_role_key_filter.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_text_filter_method import BetaProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceProjectRoleKeyFilter(BaseModel): """ BetaProjectServiceProjectRoleKeyFilter - """ # noqa: E501 - key: Optional[StrictStr] = None - method: Optional[BetaProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + method: Optional[BetaProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaProjectServiceProjectRoleKeyFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleKeyFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleKeyFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_project_service_text_filter_method import ( + BetaProjectServiceTextFilterMethod, +) +BetaProjectServiceProjectRoleKeyFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_role_search_filter.py b/zitadel_client/models/beta_project_service_project_role_search_filter.py index d9e00379..60225e1d 100644 --- a/zitadel_client/models/beta_project_service_project_role_search_filter.py +++ b/zitadel_client/models/beta_project_service_project_role_search_filter.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_project_role_display_name_filter import BetaProjectServiceProjectRoleDisplayNameFilter -from zitadel_client.models.beta_project_service_project_role_key_filter import BetaProjectServiceProjectRoleKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceProjectRoleSearchFilter(BaseModel): """ BetaProjectServiceProjectRoleSearchFilter - """ # noqa: E501 - display_name_filter: Optional[BetaProjectServiceProjectRoleDisplayNameFilter] = Field(default=None, alias="displayNameFilter") - role_key_filter: Optional[BetaProjectServiceProjectRoleKeyFilter] = Field(default=None, alias="roleKeyFilter") - __properties: ClassVar[List[str]] = ["displayNameFilter", "roleKeyFilter"] + """ + + display_name_filter: Optional[BetaProjectServiceProjectRoleDisplayNameFilter] = ( + Field(default=None, alias="displayNameFilter") + ) + role_key_filter: Optional[BetaProjectServiceProjectRoleKeyFilter] = Field( + default=None, alias="roleKeyFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class BetaProjectServiceProjectRoleSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of display_name_filter - if self.display_name_filter: - _dict['displayNameFilter'] = self.display_name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key_filter - if self.role_key_filter: - _dict['roleKeyFilter'] = self.role_key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectRoleSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayNameFilter": BetaProjectServiceProjectRoleDisplayNameFilter.from_dict(obj["displayNameFilter"]) if obj.get("displayNameFilter") is not None else None, - "roleKeyFilter": BetaProjectServiceProjectRoleKeyFilter.from_dict(obj["roleKeyFilter"]) if obj.get("roleKeyFilter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_project_role_display_name_filter import ( + BetaProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.beta_project_service_project_role_key_filter import ( + BetaProjectServiceProjectRoleKeyFilter, +) +BetaProjectServiceProjectRoleSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_search_filter.py b/zitadel_client/models/beta_project_service_project_search_filter.py index ae85dedd..44cb0cf0 100644 --- a/zitadel_client/models/beta_project_service_project_search_filter.py +++ b/zitadel_client/models/beta_project_service_project_search_filter.py @@ -1,41 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_id_filter import BetaProjectServiceIDFilter -from zitadel_client.models.beta_project_service_in_ids_filter import BetaProjectServiceInIDsFilter -from zitadel_client.models.beta_project_service_project_name_filter import BetaProjectServiceProjectNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceProjectSearchFilter(BaseModel): """ BetaProjectServiceProjectSearchFilter - """ # noqa: E501 - in_project_ids_filter: Optional[BetaProjectServiceInIDsFilter] = Field(default=None, alias="inProjectIdsFilter") - project_grant_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field(default=None, alias="projectGrantResourceOwnerFilter") - project_name_filter: Optional[BetaProjectServiceProjectNameFilter] = Field(default=None, alias="projectNameFilter") - project_organization_id_filter: Optional[BetaProjectServiceIDFilter] = Field(default=None, alias="projectOrganizationIdFilter") - project_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field(default=None, alias="projectResourceOwnerFilter") - __properties: ClassVar[List[str]] = ["inProjectIdsFilter", "projectGrantResourceOwnerFilter", "projectNameFilter", "projectOrganizationIdFilter", "projectResourceOwnerFilter"] + """ + in_project_ids_filter: Optional[BetaProjectServiceInIDsFilter] = Field( + default=None, alias="inProjectIdsFilter" + ) + project_grant_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field( + default=None, alias="projectGrantResourceOwnerFilter" + ) + project_name_filter: Optional[BetaProjectServiceProjectNameFilter] = Field( + default=None, alias="projectNameFilter" + ) + project_organization_id_filter: Optional[BetaProjectServiceIDFilter] = Field( + default=None, alias="projectOrganizationIdFilter" + ) + project_resource_owner_filter: Optional[BetaProjectServiceIDFilter] = Field( + default=None, alias="projectResourceOwnerFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,71 +43,14 @@ class BetaProjectServiceProjectSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of in_project_ids_filter - if self.in_project_ids_filter: - _dict['inProjectIdsFilter'] = self.in_project_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant_resource_owner_filter - if self.project_grant_resource_owner_filter: - _dict['projectGrantResourceOwnerFilter'] = self.project_grant_resource_owner_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name_filter - if self.project_name_filter: - _dict['projectNameFilter'] = self.project_name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_organization_id_filter - if self.project_organization_id_filter: - _dict['projectOrganizationIdFilter'] = self.project_organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_resource_owner_filter - if self.project_resource_owner_filter: - _dict['projectResourceOwnerFilter'] = self.project_resource_owner_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceProjectSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inProjectIdsFilter": BetaProjectServiceInIDsFilter.from_dict(obj["inProjectIdsFilter"]) if obj.get("inProjectIdsFilter") is not None else None, - "projectGrantResourceOwnerFilter": BetaProjectServiceIDFilter.from_dict(obj["projectGrantResourceOwnerFilter"]) if obj.get("projectGrantResourceOwnerFilter") is not None else None, - "projectNameFilter": BetaProjectServiceProjectNameFilter.from_dict(obj["projectNameFilter"]) if obj.get("projectNameFilter") is not None else None, - "projectOrganizationIdFilter": BetaProjectServiceIDFilter.from_dict(obj["projectOrganizationIdFilter"]) if obj.get("projectOrganizationIdFilter") is not None else None, - "projectResourceOwnerFilter": BetaProjectServiceIDFilter.from_dict(obj["projectResourceOwnerFilter"]) if obj.get("projectResourceOwnerFilter") is not None else None - }) - return _obj - +from zitadel_client.models.beta_project_service_id_filter import ( + BetaProjectServiceIDFilter, +) +from zitadel_client.models.beta_project_service_in_ids_filter import ( + BetaProjectServiceInIDsFilter, +) +from zitadel_client.models.beta_project_service_project_name_filter import ( + BetaProjectServiceProjectNameFilter, +) +BetaProjectServiceProjectSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_project_state.py b/zitadel_client/models/beta_project_service_project_state.py index 45bdc717..d3563015 100644 --- a/zitadel_client/models/beta_project_service_project_state.py +++ b/zitadel_client/models/beta_project_service_project_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceProjectState(str, Enum): @@ -23,16 +13,6 @@ class BetaProjectServiceProjectState(str, Enum): BetaProjectServiceProjectState """ - """ - allowed enum values - """ - PROJECT_STATE_UNSPECIFIED = 'PROJECT_STATE_UNSPECIFIED' - PROJECT_STATE_ACTIVE = 'PROJECT_STATE_ACTIVE' - PROJECT_STATE_INACTIVE = 'PROJECT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceProjectState from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_STATE_UNSPECIFIED = "PROJECT_STATE_UNSPECIFIED" + PROJECT_STATE_ACTIVE = "PROJECT_STATE_ACTIVE" + PROJECT_STATE_INACTIVE = "PROJECT_STATE_INACTIVE" diff --git a/zitadel_client/models/beta_project_service_remove_project_role_request.py b/zitadel_client/models/beta_project_service_remove_project_role_request.py index 40fbe3c0..246bfc1d 100644 --- a/zitadel_client/models/beta_project_service_remove_project_role_request.py +++ b/zitadel_client/models/beta_project_service_remove_project_role_request.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceRemoveProjectRoleRequest(BaseModel): """ BetaProjectServiceRemoveProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", alias="roleKey") - __properties: ClassVar[List[str]] = ["projectId", "roleKey"] + """ + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class BetaProjectServiceRemoveProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceRemoveProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceRemoveProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey") - }) - return _obj - - +BetaProjectServiceRemoveProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_remove_project_role_response.py b/zitadel_client/models/beta_project_service_remove_project_role_response.py index 8dc4137f..517597d5 100644 --- a/zitadel_client/models/beta_project_service_remove_project_role_response.py +++ b/zitadel_client/models/beta_project_service_remove_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceRemoveProjectRoleResponse(BaseModel): """ BetaProjectServiceRemoveProjectRoleResponse - """ # noqa: E501 - removal_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="removalDate") - __properties: ClassVar[List[str]] = ["removalDate"] + """ + removal_date: Optional[AwareDatetime] = Field( + default=None, + alias="removalDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceRemoveProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceRemoveProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceRemoveProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "removalDate": obj.get("removalDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceRemoveProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_text_filter_method.py b/zitadel_client/models/beta_project_service_text_filter_method.py index e97a61ee..28a8d75d 100644 --- a/zitadel_client/models/beta_project_service_text_filter_method.py +++ b/zitadel_client/models/beta_project_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaProjectServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class BetaProjectServiceTextFilterMethod(str, Enum): BetaProjectServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaProjectServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/beta_project_service_update_project_grant_request.py b/zitadel_client/models/beta_project_service_update_project_grant_request.py index d35e09d4..a72b201a 100644 --- a/zitadel_client/models/beta_project_service_update_project_grant_request.py +++ b/zitadel_client/models/beta_project_service_update_project_grant_request.py @@ -1,36 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaProjectServiceUpdateProjectGrantRequest(BaseModel): """ BetaProjectServiceUpdateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="Organization the project is granted to.", alias="grantedOrganizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="Keys of the role available for the project grant.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId", "roleKeys"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="Organization the project is granted to.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="Keys of the role available for the project grant.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +42,4 @@ class BetaProjectServiceUpdateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +BetaProjectServiceUpdateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_update_project_grant_response.py b/zitadel_client/models/beta_project_service_update_project_grant_response.py index b844328a..4dbb0d58 100644 --- a/zitadel_client/models/beta_project_service_update_project_grant_response.py +++ b/zitadel_client/models/beta_project_service_update_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceUpdateProjectGrantResponse(BaseModel): """ BetaProjectServiceUpdateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceUpdateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceUpdateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_update_project_request.py b/zitadel_client/models/beta_project_service_update_project_request.py index 68e136d8..e059d917 100644 --- a/zitadel_client/models/beta_project_service_update_project_request.py +++ b/zitadel_client/models/beta_project_service_update_project_request.py @@ -1,40 +1,49 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_project_service_private_labeling_setting import BetaProjectServicePrivateLabelingSetting -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaProjectServiceUpdateProjectRequest(BaseModel): """ BetaProjectServiceUpdateProjectRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = Field(default=None, description="Name of the project.") - project_role_assertion: Optional[StrictBool] = Field(default=None, description="Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.", alias="projectRoleAssertion") - project_role_check: Optional[StrictBool] = Field(default=None, description="When enabled ZITADEL will check if a user has a role of this project assigned when login into an application of this project.", alias="projectRoleCheck") - has_project_check: Optional[StrictBool] = Field(default=None, description="When enabled ZITADEL will check if the organization of the user, that is trying to log in, has a grant to this project.", alias="hasProjectCheck") - private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - __properties: ClassVar[List[str]] = ["id", "name", "projectRoleAssertion", "projectRoleCheck", "hasProjectCheck", "privateLabelingSetting"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name of the project." + ) + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="Enable this setting to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.", + ) + project_role_check: Optional[StrictBool] = Field( + default=None, + alias="projectRoleCheck", + description="When enabled ZITADEL will check if a user has a role of this project assigned when login into an application of this project.", + ) + has_project_check: Optional[StrictBool] = Field( + default=None, + alias="hasProjectCheck", + description="When enabled ZITADEL will check if the organization of the user, that is trying to log in, has a grant to this project.", + ) + private_labeling_setting: Optional[BetaProjectServicePrivateLabelingSetting] = ( + Field(default=None, alias="privateLabelingSetting") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,77 +51,8 @@ class BetaProjectServiceUpdateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if project_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.project_role_assertion is None and "project_role_assertion" in self.model_fields_set: - _dict['projectRoleAssertion'] = None - - # set to None if project_role_check (nullable) is None - # and model_fields_set contains the field - if self.project_role_check is None and "project_role_check" in self.model_fields_set: - _dict['projectRoleCheck'] = None - - # set to None if has_project_check (nullable) is None - # and model_fields_set contains the field - if self.has_project_check is None and "has_project_check" in self.model_fields_set: - _dict['hasProjectCheck'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "projectRoleCheck": obj.get("projectRoleCheck"), - "hasProjectCheck": obj.get("hasProjectCheck"), - "privateLabelingSetting": obj.get("privateLabelingSetting") - }) - return _obj - +from zitadel_client.models.beta_project_service_private_labeling_setting import ( + BetaProjectServicePrivateLabelingSetting, +) +BetaProjectServiceUpdateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_update_project_response.py b/zitadel_client/models/beta_project_service_update_project_response.py index afca6892..b9594769 100644 --- a/zitadel_client/models/beta_project_service_update_project_response.py +++ b/zitadel_client/models/beta_project_service_update_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceUpdateProjectResponse(BaseModel): """ BetaProjectServiceUpdateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceUpdateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceUpdateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_update_project_role_request.py b/zitadel_client/models/beta_project_service_update_project_role_request.py index 671461f4..5c7b1bec 100644 --- a/zitadel_client/models/beta_project_service_update_project_role_request.py +++ b/zitadel_client/models/beta_project_service_update_project_role_request.py @@ -1,37 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaProjectServiceUpdateProjectRoleRequest(BaseModel): """ BetaProjectServiceUpdateProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ID of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", alias="roleKey") - display_name: Optional[StrictStr] = Field(default=None, description="Name displayed for the role.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.") - __properties: ClassVar[List[str]] = ["projectId", "roleKey", "displayName", "group"] + """ + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="ID of the project." + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="The key is the only relevant attribute for ZITADEL regarding the authorization checks.", + ) + display_name: Optional[StrictStr] = Field( + default=None, alias="displayName", description="Name displayed for the role." + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="The group is only used for display purposes. That you have better handling, like giving all the roles from a group to a user.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,65 +45,4 @@ class BetaProjectServiceUpdateProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if group (nullable) is None - # and model_fields_set contains the field - if self.group is None and "group" in self.model_fields_set: - _dict['group'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - - +BetaProjectServiceUpdateProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_project_service_update_project_role_response.py b/zitadel_client/models/beta_project_service_update_project_role_response.py index d4755df7..396974f9 100644 --- a/zitadel_client/models/beta_project_service_update_project_role_response.py +++ b/zitadel_client/models/beta_project_service_update_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaProjectServiceUpdateProjectRoleResponse(BaseModel): """ BetaProjectServiceUpdateProjectRoleResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaProjectServiceUpdateProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaProjectServiceUpdateProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaProjectServiceUpdateProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_any.py b/zitadel_client/models/beta_session_service_any.py index 3f9c7127..017604aa 100644 --- a/zitadel_client/models/beta_session_service_any.py +++ b/zitadel_client/models/beta_session_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaSessionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaSessionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_challenges.py b/zitadel_client/models/beta_session_service_challenges.py index 3e022d72..980826dd 100644 --- a/zitadel_client/models/beta_session_service_challenges.py +++ b/zitadel_client/models/beta_session_service_challenges.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_web_auth_n import BetaSessionServiceWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceChallenges(BaseModel): """ BetaSessionServiceChallenges - """ # noqa: E501 - web_auth_n: Optional[BetaSessionServiceWebAuthN] = Field(default=None, alias="webAuthN") + """ + + web_auth_n: Optional[BetaSessionServiceWebAuthN] = Field( + default=None, alias="webAuthN" + ) otp_sms: Optional[StrictStr] = Field(default=None, alias="otpSms") otp_email: Optional[StrictStr] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["webAuthN", "otpSms", "otpEmail"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,67 +34,8 @@ class BetaSessionServiceChallenges(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceChallenges from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # set to None if otp_sms (nullable) is None - # and model_fields_set contains the field - if self.otp_sms is None and "otp_sms" in self.model_fields_set: - _dict['otpSms'] = None - - # set to None if otp_email (nullable) is None - # and model_fields_set contains the field - if self.otp_email is None and "otp_email" in self.model_fields_set: - _dict['otpEmail'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceChallenges from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webAuthN": BetaSessionServiceWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "otpSms": obj.get("otpSms"), - "otpEmail": obj.get("otpEmail") - }) - return _obj - +from zitadel_client.models.beta_session_service_web_auth_n import ( + BetaSessionServiceWebAuthN, +) +BetaSessionServiceChallenges.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_idp_intent.py b/zitadel_client/models/beta_session_service_check_idp_intent.py index 2ffe5e9d..55f6ec76 100644 --- a/zitadel_client/models/beta_session_service_check_idp_intent.py +++ b/zitadel_client/models/beta_session_service_check_idp_intent.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCheckIDPIntent(BaseModel): """ BetaSessionServiceCheckIDPIntent - """ # noqa: E501 + """ + idp_intent_id: Optional[StrictStr] = Field(default=None, alias="idpIntentId") idp_intent_token: Optional[StrictStr] = Field(default=None, alias="idpIntentToken") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaSessionServiceCheckIDPIntent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckIDPIntent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckIDPIntent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken") - }) - return _obj - - +BetaSessionServiceCheckIDPIntent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_otp.py b/zitadel_client/models/beta_session_service_check_otp.py index b926879c..59a7036d 100644 --- a/zitadel_client/models/beta_session_service_check_otp.py +++ b/zitadel_client/models/beta_session_service_check_otp.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCheckOTP(BaseModel): """ BetaSessionServiceCheckOTP - """ # noqa: E501 - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["code"] + """ + + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceCheckOTP(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckOTP from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckOTP from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code") - }) - return _obj - - +BetaSessionServiceCheckOTP.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_password.py b/zitadel_client/models/beta_session_service_check_password.py index e38521fa..2eb012e7 100644 --- a/zitadel_client/models/beta_session_service_check_password.py +++ b/zitadel_client/models/beta_session_service_check_password.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCheckPassword(BaseModel): """ BetaSessionServiceCheckPassword - """ # noqa: E501 - password: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["password"] + """ + + password: Optional[StrictStr] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceCheckPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password") - }) - return _obj - - +BetaSessionServiceCheckPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_totp.py b/zitadel_client/models/beta_session_service_check_totp.py index bcb9631a..ec13ed82 100644 --- a/zitadel_client/models/beta_session_service_check_totp.py +++ b/zitadel_client/models/beta_session_service_check_totp.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCheckTOTP(BaseModel): """ BetaSessionServiceCheckTOTP - """ # noqa: E501 - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["code"] + """ + + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceCheckTOTP(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckTOTP from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckTOTP from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code") - }) - return _obj - - +BetaSessionServiceCheckTOTP.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_user.py b/zitadel_client/models/beta_session_service_check_user.py index 2c2e8d8a..177f5ba7 100644 --- a/zitadel_client/models/beta_session_service_check_user.py +++ b/zitadel_client/models/beta_session_service_check_user.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCheckUser(BaseModel): """ BetaSessionServiceCheckUser - """ # noqa: E501 + """ + login_name: Optional[StrictStr] = Field(default=None, alias="loginName") user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["loginName", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaSessionServiceCheckUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "userId": obj.get("userId") - }) - return _obj - - +BetaSessionServiceCheckUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_check_web_auth_n.py b/zitadel_client/models/beta_session_service_check_web_auth_n.py index 0c8c11c7..ef6f41c4 100644 --- a/zitadel_client/models/beta_session_service_check_web_auth_n.py +++ b/zitadel_client/models/beta_session_service_check_web_auth_n.py @@ -1,34 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Dict, Optional + class BetaSessionServiceCheckWebAuthN(BaseModel): """ BetaSessionServiceCheckWebAuthN - """ # noqa: E501 - credential_assertion_data: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="credentialAssertionData") - __properties: ClassVar[List[str]] = ["credentialAssertionData"] + """ + credential_assertion_data: Optional[Dict[str, object]] = Field( + default=None, + alias="credentialAssertionData", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +33,4 @@ class BetaSessionServiceCheckWebAuthN(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckWebAuthN from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCheckWebAuthN from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "credentialAssertionData": obj.get("credentialAssertionData") - }) - return _obj - - +BetaSessionServiceCheckWebAuthN.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_checks.py b/zitadel_client/models/beta_session_service_checks.py index ceebf812..2d2b4286 100644 --- a/zitadel_client/models/beta_session_service_checks.py +++ b/zitadel_client/models/beta_session_service_checks.py @@ -1,46 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_check_idp_intent import BetaSessionServiceCheckIDPIntent -from zitadel_client.models.beta_session_service_check_otp import BetaSessionServiceCheckOTP -from zitadel_client.models.beta_session_service_check_password import BetaSessionServiceCheckPassword -from zitadel_client.models.beta_session_service_check_totp import BetaSessionServiceCheckTOTP -from zitadel_client.models.beta_session_service_check_user import BetaSessionServiceCheckUser -from zitadel_client.models.beta_session_service_check_web_auth_n import BetaSessionServiceCheckWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceChecks(BaseModel): """ BetaSessionServiceChecks - """ # noqa: E501 - user: Optional[BetaSessionServiceCheckUser] = None - password: Optional[BetaSessionServiceCheckPassword] = None - web_auth_n: Optional[BetaSessionServiceCheckWebAuthN] = Field(default=None, alias="webAuthN") - idp_intent: Optional[BetaSessionServiceCheckIDPIntent] = Field(default=None, alias="idpIntent") - totp: Optional[BetaSessionServiceCheckTOTP] = None + """ + + user: Optional[BetaSessionServiceCheckUser] = Field(default=None, alias="user") + password: Optional[BetaSessionServiceCheckPassword] = Field( + default=None, alias="password" + ) + web_auth_n: Optional[BetaSessionServiceCheckWebAuthN] = Field( + default=None, alias="webAuthN" + ) + idp_intent: Optional[BetaSessionServiceCheckIDPIntent] = Field( + default=None, alias="idpIntent" + ) + totp: Optional[BetaSessionServiceCheckTOTP] = Field(default=None, alias="totp") otp_sms: Optional[BetaSessionServiceCheckOTP] = Field(default=None, alias="otpSms") - otp_email: Optional[BetaSessionServiceCheckOTP] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["user", "password", "webAuthN", "idpIntent", "totp", "otpSms", "otpEmail"] + otp_email: Optional[BetaSessionServiceCheckOTP] = Field( + default=None, alias="otpEmail" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,79 +43,23 @@ class BetaSessionServiceChecks(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceChecks from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_intent - if self.idp_intent: - _dict['idpIntent'] = self.idp_intent.to_dict() - # override the default output from pydantic by calling `to_dict()` of totp - if self.totp: - _dict['totp'] = self.totp.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceChecks from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "user": BetaSessionServiceCheckUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "password": BetaSessionServiceCheckPassword.from_dict(obj["password"]) if obj.get("password") is not None else None, - "webAuthN": BetaSessionServiceCheckWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "idpIntent": BetaSessionServiceCheckIDPIntent.from_dict(obj["idpIntent"]) if obj.get("idpIntent") is not None else None, - "totp": BetaSessionServiceCheckTOTP.from_dict(obj["totp"]) if obj.get("totp") is not None else None, - "otpSms": BetaSessionServiceCheckOTP.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": BetaSessionServiceCheckOTP.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_session_service_check_idp_intent import ( + BetaSessionServiceCheckIDPIntent, +) +from zitadel_client.models.beta_session_service_check_otp import ( + BetaSessionServiceCheckOTP, +) +from zitadel_client.models.beta_session_service_check_password import ( + BetaSessionServiceCheckPassword, +) +from zitadel_client.models.beta_session_service_check_totp import ( + BetaSessionServiceCheckTOTP, +) +from zitadel_client.models.beta_session_service_check_user import ( + BetaSessionServiceCheckUser, +) +from zitadel_client.models.beta_session_service_check_web_auth_n import ( + BetaSessionServiceCheckWebAuthN, +) + +BetaSessionServiceChecks.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_connect_error.py b/zitadel_client/models/beta_session_service_connect_error.py index 7f7c9c56..e979a083 100644 --- a/zitadel_client/models/beta_session_service_connect_error.py +++ b/zitadel_client/models/beta_session_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_session_service_any import BetaSessionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaSessionServiceConnectErrorCodeEnum(str, Enum): + """BetaSessionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaSessionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaSessionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaSessionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaSessionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaSessionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_session_service_any import BetaSessionServiceAny +BetaSessionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_create_session_request.py b/zitadel_client/models/beta_session_service_create_session_request.py index e05541c2..eb276896 100644 --- a/zitadel_client/models/beta_session_service_create_session_request.py +++ b/zitadel_client/models/beta_session_service_create_session_request.py @@ -1,41 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_session_service_checks import BetaSessionServiceChecks -from zitadel_client.models.beta_session_service_request_challenges import BetaSessionServiceRequestChallenges -from zitadel_client.models.beta_session_service_user_agent import BetaSessionServiceUserAgent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Dict, Optional + class BetaSessionServiceCreateSessionRequest(BaseModel): """ BetaSessionServiceCreateSessionRequest - """ # noqa: E501 - checks: Optional[BetaSessionServiceChecks] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = None - challenges: Optional[BetaSessionServiceRequestChallenges] = None - user_agent: Optional[BetaSessionServiceUserAgent] = Field(default=None, alias="userAgent") - lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - __properties: ClassVar[List[str]] = ["checks", "metadata", "challenges", "userAgent", "lifetime"] + """ + + checks: Optional[BetaSessionServiceChecks] = Field(default=None, alias="checks") + metadata: Optional[Dict[str, Base64Bytes]] = Field(default=None, alias="metadata") + challenges: Optional[BetaSessionServiceRequestChallenges] = Field( + default=None, alias="challenges" + ) + user_agent: Optional[BetaSessionServiceUserAgent] = Field( + default=None, alias="userAgent" + ) + lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="lifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,65 +41,14 @@ class BetaSessionServiceCreateSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreateSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checks - if self.checks: - _dict['checks'] = self.checks.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_agent - if self.user_agent: - _dict['userAgent'] = self.user_agent.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreateSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "checks": BetaSessionServiceChecks.from_dict(obj["checks"]) if obj.get("checks") is not None else None, - "metadata": obj.get("metadata"), - "challenges": BetaSessionServiceRequestChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None, - "userAgent": BetaSessionServiceUserAgent.from_dict(obj["userAgent"]) if obj.get("userAgent") is not None else None, - "lifetime": obj.get("lifetime") - }) - return _obj - - +from pydantic import Base64Bytes +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_session_service_checks import BetaSessionServiceChecks +from zitadel_client.models.beta_session_service_request_challenges import ( + BetaSessionServiceRequestChallenges, +) +from zitadel_client.models.beta_session_service_user_agent import ( + BetaSessionServiceUserAgent, +) + +BetaSessionServiceCreateSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_create_session_response.py b/zitadel_client/models/beta_session_service_create_session_response.py index f39ce444..f78cccac 100644 --- a/zitadel_client/models/beta_session_service_create_session_response.py +++ b/zitadel_client/models/beta_session_service_create_session_response.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_challenges import BetaSessionServiceChallenges -from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceCreateSessionResponse(BaseModel): """ BetaSessionServiceCreateSessionResponse - """ # noqa: E501 - details: Optional[BetaSessionServiceDetails] = None + """ + + details: Optional[BetaSessionServiceDetails] = Field(default=None, alias="details") session_id: Optional[StrictStr] = Field(default=None, alias="sessionId") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - challenges: Optional[BetaSessionServiceChallenges] = None - __properties: ClassVar[List[str]] = ["details", "sessionId", "sessionToken", "challenges"] + challenges: Optional[BetaSessionServiceChallenges] = Field( + default=None, alias="challenges" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,61 +35,9 @@ class BetaSessionServiceCreateSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreateSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreateSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken"), - "challenges": BetaSessionServiceChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_challenges import ( + BetaSessionServiceChallenges, +) +from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails +BetaSessionServiceCreateSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_creation_date_query.py b/zitadel_client/models/beta_session_service_creation_date_query.py index b21c2909..c5be65a5 100644 --- a/zitadel_client/models/beta_session_service_creation_date_query.py +++ b/zitadel_client/models/beta_session_service_creation_date_query.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_timestamp_query_method import BetaSessionServiceTimestampQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceCreationDateQuery(BaseModel): """ BetaSessionServiceCreationDateQuery - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - method: Optional[BetaSessionServiceTimestampQueryMethod] = None - __properties: ClassVar[List[str]] = ["creationDate", "method"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[BetaSessionServiceTimestampQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class BetaSessionServiceCreationDateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreationDateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceCreationDateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_session_service_timestamp_query_method import ( + BetaSessionServiceTimestampQueryMethod, +) +BetaSessionServiceCreationDateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_delete_session_request.py b/zitadel_client/models/beta_session_service_delete_session_request.py index c098d5ff..a3ef8a32 100644 --- a/zitadel_client/models/beta_session_service_delete_session_request.py +++ b/zitadel_client/models/beta_session_service_delete_session_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceDeleteSessionRequest(BaseModel): """ BetaSessionServiceDeleteSessionRequest - """ # noqa: E501 + """ + session_id: Optional[StrictStr] = Field(default=None, alias="sessionId") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +31,4 @@ class BetaSessionServiceDeleteSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceDeleteSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if session_token (nullable) is None - # and model_fields_set contains the field - if self.session_token is None and "session_token" in self.model_fields_set: - _dict['sessionToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceDeleteSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +BetaSessionServiceDeleteSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_delete_session_response.py b/zitadel_client/models/beta_session_service_delete_session_response.py index 10543f04..e3a5ac3d 100644 --- a/zitadel_client/models/beta_session_service_delete_session_response.py +++ b/zitadel_client/models/beta_session_service_delete_session_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSessionServiceDeleteSessionResponse(BaseModel): """ BetaSessionServiceDeleteSessionResponse - """ # noqa: E501 - details: Optional[BetaSessionServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaSessionServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaSessionServiceDeleteSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceDeleteSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceDeleteSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails +BetaSessionServiceDeleteSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_details.py b/zitadel_client/models/beta_session_service_details.py index e523f0b0..a4e2518c 100644 --- a/zitadel_client/models/beta_session_service_details.py +++ b/zitadel_client/models/beta_session_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceDetails(BaseModel): """ BetaSessionServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class BetaSessionServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_factors.py b/zitadel_client/models/beta_session_service_factors.py index 044d7b7d..0209be48 100644 --- a/zitadel_client/models/beta_session_service_factors.py +++ b/zitadel_client/models/beta_session_service_factors.py @@ -1,46 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_intent_factor import BetaSessionServiceIntentFactor -from zitadel_client.models.beta_session_service_otp_factor import BetaSessionServiceOTPFactor -from zitadel_client.models.beta_session_service_password_factor import BetaSessionServicePasswordFactor -from zitadel_client.models.beta_session_service_totp_factor import BetaSessionServiceTOTPFactor -from zitadel_client.models.beta_session_service_user_factor import BetaSessionServiceUserFactor -from zitadel_client.models.beta_session_service_web_auth_n_factor import BetaSessionServiceWebAuthNFactor -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceFactors(BaseModel): """ BetaSessionServiceFactors - """ # noqa: E501 - user: Optional[BetaSessionServiceUserFactor] = None - password: Optional[BetaSessionServicePasswordFactor] = None - web_auth_n: Optional[BetaSessionServiceWebAuthNFactor] = Field(default=None, alias="webAuthN") - intent: Optional[BetaSessionServiceIntentFactor] = None - totp: Optional[BetaSessionServiceTOTPFactor] = None + """ + + user: Optional[BetaSessionServiceUserFactor] = Field(default=None, alias="user") + password: Optional[BetaSessionServicePasswordFactor] = Field( + default=None, alias="password" + ) + web_auth_n: Optional[BetaSessionServiceWebAuthNFactor] = Field( + default=None, alias="webAuthN" + ) + intent: Optional[BetaSessionServiceIntentFactor] = Field( + default=None, alias="intent" + ) + totp: Optional[BetaSessionServiceTOTPFactor] = Field(default=None, alias="totp") otp_sms: Optional[BetaSessionServiceOTPFactor] = Field(default=None, alias="otpSms") - otp_email: Optional[BetaSessionServiceOTPFactor] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["user", "password", "webAuthN", "intent", "totp", "otpSms", "otpEmail"] + otp_email: Optional[BetaSessionServiceOTPFactor] = Field( + default=None, alias="otpEmail" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,79 +43,23 @@ class BetaSessionServiceFactors(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceFactors from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of intent - if self.intent: - _dict['intent'] = self.intent.to_dict() - # override the default output from pydantic by calling `to_dict()` of totp - if self.totp: - _dict['totp'] = self.totp.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceFactors from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "user": BetaSessionServiceUserFactor.from_dict(obj["user"]) if obj.get("user") is not None else None, - "password": BetaSessionServicePasswordFactor.from_dict(obj["password"]) if obj.get("password") is not None else None, - "webAuthN": BetaSessionServiceWebAuthNFactor.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "intent": BetaSessionServiceIntentFactor.from_dict(obj["intent"]) if obj.get("intent") is not None else None, - "totp": BetaSessionServiceTOTPFactor.from_dict(obj["totp"]) if obj.get("totp") is not None else None, - "otpSms": BetaSessionServiceOTPFactor.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": BetaSessionServiceOTPFactor.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_session_service_intent_factor import ( + BetaSessionServiceIntentFactor, +) +from zitadel_client.models.beta_session_service_otp_factor import ( + BetaSessionServiceOTPFactor, +) +from zitadel_client.models.beta_session_service_password_factor import ( + BetaSessionServicePasswordFactor, +) +from zitadel_client.models.beta_session_service_totp_factor import ( + BetaSessionServiceTOTPFactor, +) +from zitadel_client.models.beta_session_service_user_factor import ( + BetaSessionServiceUserFactor, +) +from zitadel_client.models.beta_session_service_web_auth_n_factor import ( + BetaSessionServiceWebAuthNFactor, +) + +BetaSessionServiceFactors.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_get_session_request.py b/zitadel_client/models/beta_session_service_get_session_request.py index 48e00893..28657205 100644 --- a/zitadel_client/models/beta_session_service_get_session_request.py +++ b/zitadel_client/models/beta_session_service_get_session_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceGetSessionRequest(BaseModel): """ BetaSessionServiceGetSessionRequest - """ # noqa: E501 + """ + session_id: Optional[StrictStr] = Field(default=None, alias="sessionId") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +31,4 @@ class BetaSessionServiceGetSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceGetSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if session_token (nullable) is None - # and model_fields_set contains the field - if self.session_token is None and "session_token" in self.model_fields_set: - _dict['sessionToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceGetSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +BetaSessionServiceGetSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_get_session_response.py b/zitadel_client/models/beta_session_service_get_session_response.py index 55100257..22e2c5c6 100644 --- a/zitadel_client/models/beta_session_service_get_session_response.py +++ b/zitadel_client/models/beta_session_service_get_session_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_session import BetaSessionServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSessionServiceGetSessionResponse(BaseModel): """ BetaSessionServiceGetSessionResponse - """ # noqa: E501 - session: Optional[BetaSessionServiceSession] = None - __properties: ClassVar[List[str]] = ["session"] + """ + session: Optional[BetaSessionServiceSession] = Field(default=None, alias="session") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaSessionServiceGetSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceGetSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceGetSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "session": BetaSessionServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_session import BetaSessionServiceSession +BetaSessionServiceGetSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_header_values.py b/zitadel_client/models/beta_session_service_header_values.py index b8f9dcb8..ddaa5f28 100644 --- a/zitadel_client/models/beta_session_service_header_values.py +++ b/zitadel_client/models/beta_session_service_header_values.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaSessionServiceHeaderValues(BaseModel): """ A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. - """ # noqa: E501 - values: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["values"] + """ + + values: Optional[List[StrictStr]] = Field(default=None, alias="values") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceHeaderValues(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceHeaderValues from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceHeaderValues from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "values": obj.get("values") - }) - return _obj - - +BetaSessionServiceHeaderValues.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_ids_query.py b/zitadel_client/models/beta_session_service_ids_query.py index b785c324..fbed3b53 100644 --- a/zitadel_client/models/beta_session_service_ids_query.py +++ b/zitadel_client/models/beta_session_service_ids_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaSessionServiceIDsQuery(BaseModel): """ BetaSessionServiceIDsQuery - """ # noqa: E501 - ids: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["ids"] + """ + + ids: Optional[List[StrictStr]] = Field(default=None, alias="ids") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceIDsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceIDsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceIDsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +BetaSessionServiceIDsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_intent_factor.py b/zitadel_client/models/beta_session_service_intent_factor.py index a4ae1245..6e721e60 100644 --- a/zitadel_client/models/beta_session_service_intent_factor.py +++ b/zitadel_client/models/beta_session_service_intent_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceIntentFactor(BaseModel): """ BetaSessionServiceIntentFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaSessionServiceIntentFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceIntentFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceIntentFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceIntentFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_list_details.py b/zitadel_client/models/beta_session_service_list_details.py index 66d4dde7..2ddb3b0e 100644 --- a/zitadel_client/models/beta_session_service_list_details.py +++ b/zitadel_client/models/beta_session_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceListDetails(BaseModel): """ BetaSessionServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class BetaSessionServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_list_query.py b/zitadel_client/models/beta_session_service_list_query.py index d662ef8c..637da8f5 100644 --- a/zitadel_client/models/beta_session_service_list_query.py +++ b/zitadel_client/models/beta_session_service_list_query.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaSessionServiceListQuery(BaseModel): """ BetaSessionServiceListQuery - """ # noqa: E501 - offset: Optional[Any] = None - limit: Optional[StrictInt] = None - asc: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field(default=None, alias="offset") + limit: Optional[StrictInt] = Field(default=None, alias="limit") + asc: Optional[StrictBool] = Field(default=None, alias="asc") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +32,4 @@ class BetaSessionServiceListQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceListQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceListQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaSessionServiceListQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_list_sessions_request.py b/zitadel_client/models/beta_session_service_list_sessions_request.py index 6450c324..b92dcbc3 100644 --- a/zitadel_client/models/beta_session_service_list_sessions_request.py +++ b/zitadel_client/models/beta_session_service_list_sessions_request.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_session_service_list_query import BetaSessionServiceListQuery -from zitadel_client.models.beta_session_service_search_query import BetaSessionServiceSearchQuery -from zitadel_client.models.beta_session_service_session_field_name import BetaSessionServiceSessionFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaSessionServiceListSessionsRequest(BaseModel): """ BetaSessionServiceListSessionsRequest - """ # noqa: E501 - query: Optional[BetaSessionServiceListQuery] = None - queries: Optional[List[BetaSessionServiceSearchQuery]] = None - sorting_column: Optional[BetaSessionServiceSessionFieldName] = Field(default=None, alias="sortingColumn") - __properties: ClassVar[List[str]] = ["query", "queries", "sortingColumn"] + """ + + query: Optional[BetaSessionServiceListQuery] = Field(default=None, alias="query") + queries: Optional[List[BetaSessionServiceSearchQuery]] = Field( + default=None, alias="queries" + ) + sorting_column: Optional[BetaSessionServiceSessionFieldName] = Field( + default=None, alias="sortingColumn" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +35,14 @@ class BetaSessionServiceListSessionsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceListSessionsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceListSessionsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": BetaSessionServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None, - "queries": [BetaSessionServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None, - "sortingColumn": obj.get("sortingColumn") - }) - return _obj - +from zitadel_client.models.beta_session_service_list_query import ( + BetaSessionServiceListQuery, +) +from zitadel_client.models.beta_session_service_search_query import ( + BetaSessionServiceSearchQuery, +) +from zitadel_client.models.beta_session_service_session_field_name import ( + BetaSessionServiceSessionFieldName, +) +BetaSessionServiceListSessionsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_list_sessions_response.py b/zitadel_client/models/beta_session_service_list_sessions_response.py index 4f48535c..b043f4c2 100644 --- a/zitadel_client/models/beta_session_service_list_sessions_response.py +++ b/zitadel_client/models/beta_session_service_list_sessions_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_session_service_list_details import BetaSessionServiceListDetails -from zitadel_client.models.beta_session_service_session import BetaSessionServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaSessionServiceListSessionsResponse(BaseModel): """ BetaSessionServiceListSessionsResponse - """ # noqa: E501 - details: Optional[BetaSessionServiceListDetails] = None - sessions: Optional[List[BetaSessionServiceSession]] = None - __properties: ClassVar[List[str]] = ["details", "sessions"] + """ + + details: Optional[BetaSessionServiceListDetails] = Field( + default=None, alias="details" + ) + sessions: Optional[List[BetaSessionServiceSession]] = Field( + default=None, alias="sessions" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class BetaSessionServiceListSessionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceListSessionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in sessions (list) - _items = [] - if self.sessions: - for _item_sessions in self.sessions: - if _item_sessions: - _items.append(_item_sessions.to_dict()) - _dict['sessions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceListSessionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSessionServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessions": [BetaSessionServiceSession.from_dict(_item) for _item in obj["sessions"]] if obj.get("sessions") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_list_details import ( + BetaSessionServiceListDetails, +) +from zitadel_client.models.beta_session_service_session import BetaSessionServiceSession +BetaSessionServiceListSessionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_otp_email.py b/zitadel_client/models/beta_session_service_otp_email.py index 8682dfd3..70ba4072 100644 --- a/zitadel_client/models/beta_session_service_otp_email.py +++ b/zitadel_client/models/beta_session_service_otp_email.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_send_code import BetaSessionServiceSendCode -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceOTPEmail(BaseModel): """ BetaSessionServiceOTPEmail - """ # noqa: E501 - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[BetaSessionServiceSendCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["returnCode", "sendCode"] + """ + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[BetaSessionServiceSendCode] = Field( + default=None, alias="sendCode" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +32,8 @@ class BetaSessionServiceOTPEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "returnCode": obj.get("returnCode"), - "sendCode": BetaSessionServiceSendCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_send_code import ( + BetaSessionServiceSendCode, +) +BetaSessionServiceOTPEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_otp_factor.py b/zitadel_client/models/beta_session_service_otp_factor.py index 4b451cf6..624dc17e 100644 --- a/zitadel_client/models/beta_session_service_otp_factor.py +++ b/zitadel_client/models/beta_session_service_otp_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceOTPFactor(BaseModel): """ BetaSessionServiceOTPFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaSessionServiceOTPFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceOTPFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_otpsms.py b/zitadel_client/models/beta_session_service_otpsms.py index 9b0a62d1..593f8efc 100644 --- a/zitadel_client/models/beta_session_service_otpsms.py +++ b/zitadel_client/models/beta_session_service_otpsms.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSessionServiceOTPSMS(BaseModel): """ BetaSessionServiceOTPSMS - """ # noqa: E501 + """ + return_code: Optional[StrictBool] = Field(default=None, alias="returnCode") - __properties: ClassVar[List[str]] = ["returnCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceOTPSMS(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPSMS from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceOTPSMS from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "returnCode": obj.get("returnCode") - }) - return _obj - - +BetaSessionServiceOTPSMS.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_password_factor.py b/zitadel_client/models/beta_session_service_password_factor.py index c7aba1f8..c18eb3d6 100644 --- a/zitadel_client/models/beta_session_service_password_factor.py +++ b/zitadel_client/models/beta_session_service_password_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServicePasswordFactor(BaseModel): """ BetaSessionServicePasswordFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaSessionServicePasswordFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServicePasswordFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServicePasswordFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServicePasswordFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_request_challenges.py b/zitadel_client/models/beta_session_service_request_challenges.py index 03004a16..cd3fd17d 100644 --- a/zitadel_client/models/beta_session_service_request_challenges.py +++ b/zitadel_client/models/beta_session_service_request_challenges.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_otp_email import BetaSessionServiceOTPEmail -from zitadel_client.models.beta_session_service_otpsms import BetaSessionServiceOTPSMS -from zitadel_client.models.beta_session_service_web_auth_n import BetaSessionServiceWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceRequestChallenges(BaseModel): """ BetaSessionServiceRequestChallenges - """ # noqa: E501 - web_auth_n: Optional[BetaSessionServiceWebAuthN] = Field(default=None, alias="webAuthN") + """ + + web_auth_n: Optional[BetaSessionServiceWebAuthN] = Field( + default=None, alias="webAuthN" + ) otp_sms: Optional[BetaSessionServiceOTPSMS] = Field(default=None, alias="otpSms") - otp_email: Optional[BetaSessionServiceOTPEmail] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["webAuthN", "otpSms", "otpEmail"] + otp_email: Optional[BetaSessionServiceOTPEmail] = Field( + default=None, alias="otpEmail" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +35,12 @@ class BetaSessionServiceRequestChallenges(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceRequestChallenges from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceRequestChallenges from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webAuthN": BetaSessionServiceWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "otpSms": BetaSessionServiceOTPSMS.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": BetaSessionServiceOTPEmail.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_otp_email import ( + BetaSessionServiceOTPEmail, +) +from zitadel_client.models.beta_session_service_otpsms import BetaSessionServiceOTPSMS +from zitadel_client.models.beta_session_service_web_auth_n import ( + BetaSessionServiceWebAuthN, +) +BetaSessionServiceRequestChallenges.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_search_query.py b/zitadel_client/models/beta_session_service_search_query.py index 7967aafa..42340d0a 100644 --- a/zitadel_client/models/beta_session_service_search_query.py +++ b/zitadel_client/models/beta_session_service_search_query.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_creation_date_query import BetaSessionServiceCreationDateQuery -from zitadel_client.models.beta_session_service_ids_query import BetaSessionServiceIDsQuery -from zitadel_client.models.beta_session_service_user_id_query import BetaSessionServiceUserIDQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceSearchQuery(BaseModel): """ BetaSessionServiceSearchQuery - """ # noqa: E501 - creation_date_query: Optional[BetaSessionServiceCreationDateQuery] = Field(default=None, alias="creationDateQuery") - ids_query: Optional[BetaSessionServiceIDsQuery] = Field(default=None, alias="idsQuery") - user_id_query: Optional[BetaSessionServiceUserIDQuery] = Field(default=None, alias="userIdQuery") - __properties: ClassVar[List[str]] = ["creationDateQuery", "idsQuery", "userIdQuery"] + """ + + creation_date_query: Optional[BetaSessionServiceCreationDateQuery] = Field( + default=None, alias="creationDateQuery" + ) + ids_query: Optional[BetaSessionServiceIDsQuery] = Field( + default=None, alias="idsQuery" + ) + user_id_query: Optional[BetaSessionServiceUserIDQuery] = Field( + default=None, alias="userIdQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,14 @@ class BetaSessionServiceSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of creation_date_query - if self.creation_date_query: - _dict['creationDateQuery'] = self.creation_date_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of ids_query - if self.ids_query: - _dict['idsQuery'] = self.ids_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_id_query - if self.user_id_query: - _dict['userIdQuery'] = self.user_id_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDateQuery": BetaSessionServiceCreationDateQuery.from_dict(obj["creationDateQuery"]) if obj.get("creationDateQuery") is not None else None, - "idsQuery": BetaSessionServiceIDsQuery.from_dict(obj["idsQuery"]) if obj.get("idsQuery") is not None else None, - "userIdQuery": BetaSessionServiceUserIDQuery.from_dict(obj["userIdQuery"]) if obj.get("userIdQuery") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_creation_date_query import ( + BetaSessionServiceCreationDateQuery, +) +from zitadel_client.models.beta_session_service_ids_query import ( + BetaSessionServiceIDsQuery, +) +from zitadel_client.models.beta_session_service_user_id_query import ( + BetaSessionServiceUserIDQuery, +) +BetaSessionServiceSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_send_code.py b/zitadel_client/models/beta_session_service_send_code.py index 272627c8..6b560b24 100644 --- a/zitadel_client/models/beta_session_service_send_code.py +++ b/zitadel_client/models/beta_session_service_send_code.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceSendCode(BaseModel): """ BetaSessionServiceSendCode - """ # noqa: E501 + """ + url_template: Optional[StrictStr] = Field(default=None, alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +30,4 @@ class BetaSessionServiceSendCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceSendCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceSendCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +BetaSessionServiceSendCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_session.py b/zitadel_client/models/beta_session_service_session.py index cf95f8b5..5e1f9b74 100644 --- a/zitadel_client/models/beta_session_service_session.py +++ b/zitadel_client/models/beta_session_service_session.py @@ -1,44 +1,49 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_session_service_factors import BetaSessionServiceFactors -from zitadel_client.models.beta_session_service_user_agent import BetaSessionServiceUserAgent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaSessionServiceSession(BaseModel): """ BetaSessionServiceSession - """ # noqa: E501 - id: Optional[StrictStr] = None - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - sequence: Optional[Any] = None - factors: Optional[BetaSessionServiceFactors] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = None - user_agent: Optional[BetaSessionServiceUserAgent] = Field(default=None, alias="userAgent") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "sequence", "factors", "metadata", "userAgent", "expirationDate"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + sequence: Optional[object] = Field(default=None, alias="sequence") + factors: Optional[BetaSessionServiceFactors] = Field(default=None, alias="factors") + metadata: Optional[Dict[str, Base64Bytes]] = Field(default=None, alias="metadata") + user_agent: Optional[BetaSessionServiceUserAgent] = Field( + default=None, alias="userAgent" + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,70 +51,11 @@ class BetaSessionServiceSession(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceSession from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of factors - if self.factors: - _dict['factors'] = self.factors.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_agent - if self.user_agent: - _dict['userAgent'] = self.user_agent.to_dict() - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceSession from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "sequence": obj.get("sequence"), - "factors": BetaSessionServiceFactors.from_dict(obj["factors"]) if obj.get("factors") is not None else None, - "metadata": obj.get("metadata"), - "userAgent": BetaSessionServiceUserAgent.from_dict(obj["userAgent"]) if obj.get("userAgent") is not None else None, - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +from zitadel_client.models.beta_session_service_factors import BetaSessionServiceFactors +from zitadel_client.models.beta_session_service_user_agent import ( + BetaSessionServiceUserAgent, +) +BetaSessionServiceSession.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_session_field_name.py b/zitadel_client/models/beta_session_service_session_field_name.py index b505a861..aec99202 100644 --- a/zitadel_client/models/beta_session_service_session_field_name.py +++ b/zitadel_client/models/beta_session_service_session_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSessionServiceSessionFieldName(str, Enum): @@ -23,15 +13,5 @@ class BetaSessionServiceSessionFieldName(str, Enum): BetaSessionServiceSessionFieldName """ - """ - allowed enum values - """ - SESSION_FIELD_NAME_UNSPECIFIED = 'SESSION_FIELD_NAME_UNSPECIFIED' - SESSION_FIELD_NAME_CREATION_DATE = 'SESSION_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSessionServiceSessionFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + SESSION_FIELD_NAME_UNSPECIFIED = "SESSION_FIELD_NAME_UNSPECIFIED" + SESSION_FIELD_NAME_CREATION_DATE = "SESSION_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_session_service_set_session_request.py b/zitadel_client/models/beta_session_service_set_session_request.py index 511ed24c..477e3452 100644 --- a/zitadel_client/models/beta_session_service_set_session_request.py +++ b/zitadel_client/models/beta_session_service_set_session_request.py @@ -1,41 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_session_service_checks import BetaSessionServiceChecks -from zitadel_client.models.beta_session_service_request_challenges import BetaSessionServiceRequestChallenges -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaSessionServiceSetSessionRequest(BaseModel): """ BetaSessionServiceSetSessionRequest - """ # noqa: E501 + """ + session_id: Optional[StrictStr] = Field(default=None, alias="sessionId") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - checks: Optional[BetaSessionServiceChecks] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = None - challenges: Optional[BetaSessionServiceRequestChallenges] = None - lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken", "checks", "metadata", "challenges", "lifetime"] + checks: Optional[BetaSessionServiceChecks] = Field(default=None, alias="checks") + metadata: Optional[Dict[str, Base64Bytes]] = Field(default=None, alias="metadata") + challenges: Optional[BetaSessionServiceRequestChallenges] = Field( + default=None, alias="challenges" + ) + lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="lifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,63 +41,11 @@ class BetaSessionServiceSetSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceSetSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checks - if self.checks: - _dict['checks'] = self.checks.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceSetSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken"), - "checks": BetaSessionServiceChecks.from_dict(obj["checks"]) if obj.get("checks") is not None else None, - "metadata": obj.get("metadata"), - "challenges": BetaSessionServiceRequestChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None, - "lifetime": obj.get("lifetime") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_session_service_checks import BetaSessionServiceChecks +from zitadel_client.models.beta_session_service_request_challenges import ( + BetaSessionServiceRequestChallenges, +) +BetaSessionServiceSetSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_set_session_response.py b/zitadel_client/models/beta_session_service_set_session_response.py index dd7139d1..34828f2a 100644 --- a/zitadel_client/models/beta_session_service_set_session_response.py +++ b/zitadel_client/models/beta_session_service_set_session_response.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_challenges import BetaSessionServiceChallenges -from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceSetSessionResponse(BaseModel): """ BetaSessionServiceSetSessionResponse - """ # noqa: E501 - details: Optional[BetaSessionServiceDetails] = None + """ + + details: Optional[BetaSessionServiceDetails] = Field(default=None, alias="details") session_token: Optional[StrictStr] = Field(default=None, alias="sessionToken") - challenges: Optional[BetaSessionServiceChallenges] = None - __properties: ClassVar[List[str]] = ["details", "sessionToken", "challenges"] + challenges: Optional[BetaSessionServiceChallenges] = Field( + default=None, alias="challenges" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +34,9 @@ class BetaSessionServiceSetSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceSetSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceSetSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessionToken": obj.get("sessionToken"), - "challenges": BetaSessionServiceChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None - }) - return _obj - +from zitadel_client.models.beta_session_service_challenges import ( + BetaSessionServiceChallenges, +) +from zitadel_client.models.beta_session_service_details import BetaSessionServiceDetails +BetaSessionServiceSetSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_timestamp_query_method.py b/zitadel_client/models/beta_session_service_timestamp_query_method.py index ec32c4d4..a644dc3a 100644 --- a/zitadel_client/models/beta_session_service_timestamp_query_method.py +++ b/zitadel_client/models/beta_session_service_timestamp_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSessionServiceTimestampQueryMethod(str, Enum): @@ -23,18 +13,10 @@ class BetaSessionServiceTimestampQueryMethod(str, Enum): BetaSessionServiceTimestampQueryMethod """ - """ - allowed enum values - """ - TIMESTAMP_QUERY_METHOD_EQUALS = 'TIMESTAMP_QUERY_METHOD_EQUALS' - TIMESTAMP_QUERY_METHOD_GREATER = 'TIMESTAMP_QUERY_METHOD_GREATER' - TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS' - TIMESTAMP_QUERY_METHOD_LESS = 'TIMESTAMP_QUERY_METHOD_LESS' - TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSessionServiceTimestampQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_QUERY_METHOD_EQUALS = "TIMESTAMP_QUERY_METHOD_EQUALS" + TIMESTAMP_QUERY_METHOD_GREATER = "TIMESTAMP_QUERY_METHOD_GREATER" + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = ( + "TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS" + ) + TIMESTAMP_QUERY_METHOD_LESS = "TIMESTAMP_QUERY_METHOD_LESS" + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS" diff --git a/zitadel_client/models/beta_session_service_totp_factor.py b/zitadel_client/models/beta_session_service_totp_factor.py index aa2556df..635875ef 100644 --- a/zitadel_client/models/beta_session_service_totp_factor.py +++ b/zitadel_client/models/beta_session_service_totp_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSessionServiceTOTPFactor(BaseModel): """ BetaSessionServiceTOTPFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaSessionServiceTOTPFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceTOTPFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceTOTPFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceTOTPFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_user_agent.py b/zitadel_client/models/beta_session_service_user_agent.py index 83f0823a..7e7df393 100644 --- a/zitadel_client/models/beta_session_service_user_agent.py +++ b/zitadel_client/models/beta_session_service_user_agent.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_header_values import BetaSessionServiceHeaderValues -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaSessionServiceUserAgent(BaseModel): """ BetaSessionServiceUserAgent - """ # noqa: E501 + """ + fingerprint_id: Optional[StrictStr] = Field(default=None, alias="fingerprintId") - ip: Optional[StrictStr] = None - description: Optional[StrictStr] = None - header: Optional[Dict[str, BetaSessionServiceHeaderValues]] = None - __properties: ClassVar[List[str]] = ["fingerprintId", "ip", "description", "header"] + ip: Optional[StrictStr] = Field(default=None, alias="ip") + description: Optional[StrictStr] = Field(default=None, alias="description") + header: Optional[Dict[str, BetaSessionServiceHeaderValues]] = Field( + default=None, alias="header" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,82 +35,8 @@ class BetaSessionServiceUserAgent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserAgent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in header (dict) - _field_dict = {} - if self.header: - for _key_header in self.header: - if self.header[_key_header]: - _field_dict[_key_header] = self.header[_key_header].to_dict() - _dict['header'] = _field_dict - # set to None if fingerprint_id (nullable) is None - # and model_fields_set contains the field - if self.fingerprint_id is None and "fingerprint_id" in self.model_fields_set: - _dict['fingerprintId'] = None - - # set to None if ip (nullable) is None - # and model_fields_set contains the field - if self.ip is None and "ip" in self.model_fields_set: - _dict['ip'] = None - - # set to None if description (nullable) is None - # and model_fields_set contains the field - if self.description is None and "description" in self.model_fields_set: - _dict['description'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserAgent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "fingerprintId": obj.get("fingerprintId"), - "ip": obj.get("ip"), - "description": obj.get("description"), - "header": dict( - (_k, BetaSessionServiceHeaderValues.from_dict(_v)) - for _k, _v in obj["header"].items() - ) - if obj.get("header") is not None - else None - }) - return _obj - +from zitadel_client.models.beta_session_service_header_values import ( + BetaSessionServiceHeaderValues, +) +BetaSessionServiceUserAgent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_user_factor.py b/zitadel_client/models/beta_session_service_user_factor.py index 589cefc7..7ade3388 100644 --- a/zitadel_client/models/beta_session_service_user_factor.py +++ b/zitadel_client/models/beta_session_service_user_factor.py @@ -1,39 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceUserFactor(BaseModel): """ BetaSessionServiceUserFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - id: Optional[StrictStr] = None + """ + + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + id: Optional[StrictStr] = Field(default=None, alias="id") login_name: Optional[StrictStr] = Field(default=None, alias="loginName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["verifiedAt", "id", "loginName", "displayName", "organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +38,6 @@ class BetaSessionServiceUserFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt"), - "id": obj.get("id"), - "loginName": obj.get("loginName"), - "displayName": obj.get("displayName"), - "organizationId": obj.get("organizationId") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceUserFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_user_id_query.py b/zitadel_client/models/beta_session_service_user_id_query.py index 22ab6218..b1daf90a 100644 --- a/zitadel_client/models/beta_session_service_user_id_query.py +++ b/zitadel_client/models/beta_session_service_user_id_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceUserIDQuery(BaseModel): """ BetaSessionServiceUserIDQuery - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaSessionServiceUserIDQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserIDQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceUserIDQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaSessionServiceUserIDQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_user_verification_requirement.py b/zitadel_client/models/beta_session_service_user_verification_requirement.py index 85911e47..2e19c046 100644 --- a/zitadel_client/models/beta_session_service_user_verification_requirement.py +++ b/zitadel_client/models/beta_session_service_user_verification_requirement.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSessionServiceUserVerificationRequirement(str, Enum): @@ -23,17 +13,11 @@ class BetaSessionServiceUserVerificationRequirement(str, Enum): BetaSessionServiceUserVerificationRequirement """ - """ - allowed enum values - """ - USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' - USER_VERIFICATION_REQUIREMENT_REQUIRED = 'USER_VERIFICATION_REQUIREMENT_REQUIRED' - USER_VERIFICATION_REQUIREMENT_PREFERRED = 'USER_VERIFICATION_REQUIREMENT_PREFERRED' - USER_VERIFICATION_REQUIREMENT_DISCOURAGED = 'USER_VERIFICATION_REQUIREMENT_DISCOURAGED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSessionServiceUserVerificationRequirement from a JSON string""" - return cls(json.loads(json_str)) - - + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = ( + "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED" + ) + USER_VERIFICATION_REQUIREMENT_REQUIRED = "USER_VERIFICATION_REQUIREMENT_REQUIRED" + USER_VERIFICATION_REQUIREMENT_PREFERRED = "USER_VERIFICATION_REQUIREMENT_PREFERRED" + USER_VERIFICATION_REQUIREMENT_DISCOURAGED = ( + "USER_VERIFICATION_REQUIREMENT_DISCOURAGED" + ) diff --git a/zitadel_client/models/beta_session_service_web_auth_n.py b/zitadel_client/models/beta_session_service_web_auth_n.py index a3cb9b34..b20f8842 100644 --- a/zitadel_client/models/beta_session_service_web_auth_n.py +++ b/zitadel_client/models/beta_session_service_web_auth_n.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_session_service_user_verification_requirement import BetaSessionServiceUserVerificationRequirement -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSessionServiceWebAuthN(BaseModel): """ BetaSessionServiceWebAuthN - """ # noqa: E501 - domain: Optional[StrictStr] = None - user_verification_requirement: Optional[BetaSessionServiceUserVerificationRequirement] = Field(default=None, alias="userVerificationRequirement") - __properties: ClassVar[List[str]] = ["domain", "userVerificationRequirement"] + """ + domain: Optional[StrictStr] = Field(default=None, alias="domain") + user_verification_requirement: Optional[ + BetaSessionServiceUserVerificationRequirement + ] = Field(default=None, alias="userVerificationRequirement") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaSessionServiceWebAuthN(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceWebAuthN from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceWebAuthN from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "userVerificationRequirement": obj.get("userVerificationRequirement") - }) - return _obj - +from zitadel_client.models.beta_session_service_user_verification_requirement import ( + BetaSessionServiceUserVerificationRequirement, +) +BetaSessionServiceWebAuthN.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_session_service_web_auth_n_factor.py b/zitadel_client/models/beta_session_service_web_auth_n_factor.py index 1a304427..f3993ed1 100644 --- a/zitadel_client/models/beta_session_service_web_auth_n_factor.py +++ b/zitadel_client/models/beta_session_service_web_auth_n_factor.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSessionServiceWebAuthNFactor(BaseModel): """ BetaSessionServiceWebAuthNFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") + """ + + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) user_verified: Optional[StrictBool] = Field(default=None, alias="userVerified") - __properties: ClassVar[List[str]] = ["verifiedAt", "userVerified"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,6 @@ class BetaSessionServiceWebAuthNFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSessionServiceWebAuthNFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSessionServiceWebAuthNFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt"), - "userVerified": obj.get("userVerified") - }) - return _obj - +from pydantic import AwareDatetime +BetaSessionServiceWebAuthNFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_any.py b/zitadel_client/models/beta_settings_service_any.py index 8a279756..96f61f76 100644 --- a/zitadel_client/models/beta_settings_service_any.py +++ b/zitadel_client/models/beta_settings_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaSettingsServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaSettingsServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_branding_settings.py b/zitadel_client/models/beta_settings_service_branding_settings.py index acd22f2d..c88ef7a3 100644 --- a/zitadel_client/models/beta_settings_service_branding_settings.py +++ b/zitadel_client/models/beta_settings_service_branding_settings.py @@ -1,43 +1,48 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from zitadel_client.models.beta_settings_service_theme import BetaSettingsServiceTheme -from zitadel_client.models.beta_settings_service_theme_mode import BetaSettingsServiceThemeMode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaSettingsServiceBrandingSettings(BaseModel): """ BetaSettingsServiceBrandingSettings - """ # noqa: E501 - light_theme: Optional[BetaSettingsServiceTheme] = Field(default=None, alias="lightTheme") - dark_theme: Optional[BetaSettingsServiceTheme] = Field(default=None, alias="darkTheme") + """ + + light_theme: Optional[BetaSettingsServiceTheme] = Field( + default=None, alias="lightTheme" + ) + dark_theme: Optional[BetaSettingsServiceTheme] = Field( + default=None, alias="darkTheme" + ) font_url: Optional[StrictStr] = Field(default=None, alias="fontUrl") - hide_login_name_suffix: Optional[StrictBool] = Field(default=None, description="hides the org suffix on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is set", alias="hideLoginNameSuffix") - disable_watermark: Optional[StrictBool] = Field(default=None, alias="disableWatermark") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - theme_mode: Optional[BetaSettingsServiceThemeMode] = Field(default=None, alias="themeMode") - __properties: ClassVar[List[str]] = ["lightTheme", "darkTheme", "fontUrl", "hideLoginNameSuffix", "disableWatermark", "resourceOwnerType", "themeMode"] + hide_login_name_suffix: Optional[StrictBool] = Field( + default=None, + alias="hideLoginNameSuffix", + description='hides the org suffix on the login form if the scope \\"urn:zitadel:iam:org:domain:primary:{domainname}\\" is set', + ) + disable_watermark: Optional[StrictBool] = Field( + default=None, alias="disableWatermark" + ) + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + theme_mode: Optional[BetaSettingsServiceThemeMode] = Field( + default=None, alias="themeMode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,64 +50,12 @@ class BetaSettingsServiceBrandingSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceBrandingSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of light_theme - if self.light_theme: - _dict['lightTheme'] = self.light_theme.to_dict() - # override the default output from pydantic by calling `to_dict()` of dark_theme - if self.dark_theme: - _dict['darkTheme'] = self.dark_theme.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceBrandingSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "lightTheme": BetaSettingsServiceTheme.from_dict(obj["lightTheme"]) if obj.get("lightTheme") is not None else None, - "darkTheme": BetaSettingsServiceTheme.from_dict(obj["darkTheme"]) if obj.get("darkTheme") is not None else None, - "fontUrl": obj.get("fontUrl"), - "hideLoginNameSuffix": obj.get("hideLoginNameSuffix"), - "disableWatermark": obj.get("disableWatermark"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "themeMode": obj.get("themeMode") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +from zitadel_client.models.beta_settings_service_theme import BetaSettingsServiceTheme +from zitadel_client.models.beta_settings_service_theme_mode import ( + BetaSettingsServiceThemeMode, +) +BetaSettingsServiceBrandingSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_connect_error.py b/zitadel_client/models/beta_settings_service_connect_error.py index 3fcaba53..ce3ba70d 100644 --- a/zitadel_client/models/beta_settings_service_connect_error.py +++ b/zitadel_client/models/beta_settings_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_settings_service_any import BetaSettingsServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaSettingsServiceConnectErrorCodeEnum(str, Enum): + """BetaSettingsServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaSettingsServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaSettingsServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaSettingsServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaSettingsServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaSettingsServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_settings_service_any import BetaSettingsServiceAny +BetaSettingsServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_details.py b/zitadel_client/models/beta_settings_service_details.py index fb17cee9..49a082ac 100644 --- a/zitadel_client/models/beta_settings_service_details.py +++ b/zitadel_client/models/beta_settings_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSettingsServiceDetails(BaseModel): """ BetaSettingsServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class BetaSettingsServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaSettingsServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_domain_settings.py b/zitadel_client/models/beta_settings_service_domain_settings.py index d690851b..1076ed7b 100644 --- a/zitadel_client/models/beta_settings_service_domain_settings.py +++ b/zitadel_client/models/beta_settings_service_domain_settings.py @@ -1,38 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSettingsServiceDomainSettings(BaseModel): """ BetaSettingsServiceDomainSettings - """ # noqa: E501 - login_name_includes_domain: Optional[StrictBool] = Field(default=None, alias="loginNameIncludesDomain") - require_org_domain_verification: Optional[StrictBool] = Field(default=None, alias="requireOrgDomainVerification") - smtp_sender_address_matches_instance_domain: Optional[StrictBool] = Field(default=None, alias="smtpSenderAddressMatchesInstanceDomain") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["loginNameIncludesDomain", "requireOrgDomainVerification", "smtpSenderAddressMatchesInstanceDomain", "resourceOwnerType"] + """ + + login_name_includes_domain: Optional[StrictBool] = Field( + default=None, alias="loginNameIncludesDomain" + ) + require_org_domain_verification: Optional[StrictBool] = Field( + default=None, alias="requireOrgDomainVerification" + ) + smtp_sender_address_matches_instance_domain: Optional[StrictBool] = Field( + default=None, alias="smtpSenderAddressMatchesInstanceDomain" + ) + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,55 +41,8 @@ class BetaSettingsServiceDomainSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceDomainSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceDomainSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginNameIncludesDomain": obj.get("loginNameIncludesDomain"), - "requireOrgDomainVerification": obj.get("requireOrgDomainVerification"), - "smtpSenderAddressMatchesInstanceDomain": obj.get("smtpSenderAddressMatchesInstanceDomain"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +BetaSettingsServiceDomainSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_embedded_iframe_settings.py b/zitadel_client/models/beta_settings_service_embedded_iframe_settings.py index 2029fd43..820a9d43 100644 --- a/zitadel_client/models/beta_settings_service_embedded_iframe_settings.py +++ b/zitadel_client/models/beta_settings_service_embedded_iframe_settings.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaSettingsServiceEmbeddedIframeSettings(BaseModel): """ BetaSettingsServiceEmbeddedIframeSettings - """ # noqa: E501 - enabled: Optional[StrictBool] = None - allowed_origins: Optional[List[StrictStr]] = Field(default=None, alias="allowedOrigins") - __properties: ClassVar[List[str]] = ["enabled", "allowedOrigins"] + """ + enabled: Optional[StrictBool] = Field(default=None, alias="enabled") + allowed_origins: Optional[List[StrictStr]] = Field( + default=None, alias="allowedOrigins" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class BetaSettingsServiceEmbeddedIframeSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceEmbeddedIframeSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceEmbeddedIframeSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "enabled": obj.get("enabled"), - "allowedOrigins": obj.get("allowedOrigins") - }) - return _obj - - +BetaSettingsServiceEmbeddedIframeSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_active_identity_providers_request.py b/zitadel_client/models/beta_settings_service_get_active_identity_providers_request.py index 9077b557..6656eda6 100644 --- a/zitadel_client/models/beta_settings_service_get_active_identity_providers_request.py +++ b/zitadel_client/models/beta_settings_service_get_active_identity_providers_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetActiveIdentityProvidersRequest(BaseModel): """ BetaSettingsServiceGetActiveIdentityProvidersRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetActiveIdentityProvidersRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetActiveIdentityProvidersRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetActiveIdentityProvidersRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetActiveIdentityProvidersRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_active_identity_providers_response.py b/zitadel_client/models/beta_settings_service_get_active_identity_providers_response.py index b0c3fd60..b1ed1fba 100644 --- a/zitadel_client/models/beta_settings_service_get_active_identity_providers_response.py +++ b/zitadel_client/models/beta_settings_service_get_active_identity_providers_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_settings_service_identity_provider import BetaSettingsServiceIdentityProvider -from zitadel_client.models.beta_settings_service_list_details import BetaSettingsServiceListDetails -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaSettingsServiceGetActiveIdentityProvidersResponse(BaseModel): """ BetaSettingsServiceGetActiveIdentityProvidersResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceListDetails] = None - identity_providers: Optional[List[BetaSettingsServiceIdentityProvider]] = Field(default=None, alias="identityProviders") - __properties: ClassVar[List[str]] = ["details", "identityProviders"] + """ + + details: Optional[BetaSettingsServiceListDetails] = Field( + default=None, alias="details" + ) + identity_providers: Optional[List[BetaSettingsServiceIdentityProvider]] = Field( + default=None, alias="identityProviders" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class BetaSettingsServiceGetActiveIdentityProvidersResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetActiveIdentityProvidersResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in identity_providers (list) - _items = [] - if self.identity_providers: - for _item_identity_providers in self.identity_providers: - if _item_identity_providers: - _items.append(_item_identity_providers.to_dict()) - _dict['identityProviders'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetActiveIdentityProvidersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "identityProviders": [BetaSettingsServiceIdentityProvider.from_dict(_item) for _item in obj["identityProviders"]] if obj.get("identityProviders") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_identity_provider import ( + BetaSettingsServiceIdentityProvider, +) +from zitadel_client.models.beta_settings_service_list_details import ( + BetaSettingsServiceListDetails, +) +BetaSettingsServiceGetActiveIdentityProvidersResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_branding_settings_request.py b/zitadel_client/models/beta_settings_service_get_branding_settings_request.py index fa571aec..0b02786b 100644 --- a/zitadel_client/models/beta_settings_service_get_branding_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_branding_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetBrandingSettingsRequest(BaseModel): """ BetaSettingsServiceGetBrandingSettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetBrandingSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetBrandingSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetBrandingSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetBrandingSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_branding_settings_response.py b/zitadel_client/models/beta_settings_service_get_branding_settings_response.py index 413bf187..659024d5 100644 --- a/zitadel_client/models/beta_settings_service_get_branding_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_branding_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_branding_settings import BetaSettingsServiceBrandingSettings -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetBrandingSettingsResponse(BaseModel): """ BetaSettingsServiceGetBrandingSettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceBrandingSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceBrandingSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetBrandingSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetBrandingSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetBrandingSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceBrandingSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_branding_settings import ( + BetaSettingsServiceBrandingSettings, +) +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +BetaSettingsServiceGetBrandingSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_domain_settings_request.py b/zitadel_client/models/beta_settings_service_get_domain_settings_request.py index 814f84af..986b935b 100644 --- a/zitadel_client/models/beta_settings_service_get_domain_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_domain_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetDomainSettingsRequest(BaseModel): """ BetaSettingsServiceGetDomainSettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetDomainSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetDomainSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetDomainSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetDomainSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_domain_settings_response.py b/zitadel_client/models/beta_settings_service_get_domain_settings_response.py index dc014ed6..c7774338 100644 --- a/zitadel_client/models/beta_settings_service_get_domain_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_domain_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_domain_settings import BetaSettingsServiceDomainSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetDomainSettingsResponse(BaseModel): """ BetaSettingsServiceGetDomainSettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceDomainSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceDomainSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetDomainSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetDomainSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetDomainSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceDomainSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_domain_settings import ( + BetaSettingsServiceDomainSettings, +) +BetaSettingsServiceGetDomainSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_general_settings_response.py b/zitadel_client/models/beta_settings_service_get_general_settings_response.py index aee49f46..6dd4413d 100644 --- a/zitadel_client/models/beta_settings_service_get_general_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_general_settings_response.py @@ -1,36 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaSettingsServiceGetGeneralSettingsResponse(BaseModel): """ BetaSettingsServiceGetGeneralSettingsResponse - """ # noqa: E501 + """ + default_org_id: Optional[StrictStr] = Field(default=None, alias="defaultOrgId") default_language: Optional[StrictStr] = Field(default=None, alias="defaultLanguage") - supported_languages: Optional[List[StrictStr]] = Field(default=None, alias="supportedLanguages") - __properties: ClassVar[List[str]] = ["defaultOrgId", "defaultLanguage", "supportedLanguages"] + supported_languages: Optional[List[StrictStr]] = Field( + default=None, alias="supportedLanguages" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +34,4 @@ class BetaSettingsServiceGetGeneralSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetGeneralSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetGeneralSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "defaultOrgId": obj.get("defaultOrgId"), - "defaultLanguage": obj.get("defaultLanguage"), - "supportedLanguages": obj.get("supportedLanguages") - }) - return _obj - - +BetaSettingsServiceGetGeneralSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_request.py b/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_request.py index f266804f..43b0d85d 100644 --- a/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLegalAndSupportSettingsRequest(BaseModel): """ BetaSettingsServiceGetLegalAndSupportSettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetLegalAndSupportSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLegalAndSupportSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLegalAndSupportSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetLegalAndSupportSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_response.py b/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_response.py index 928fb938..b37f92e9 100644 --- a/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_legal_and_support_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_legal_and_support_settings import BetaSettingsServiceLegalAndSupportSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLegalAndSupportSettingsResponse(BaseModel): """ BetaSettingsServiceGetLegalAndSupportSettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceLegalAndSupportSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceLegalAndSupportSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetLegalAndSupportSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLegalAndSupportSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLegalAndSupportSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceLegalAndSupportSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_legal_and_support_settings import ( + BetaSettingsServiceLegalAndSupportSettings, +) +BetaSettingsServiceGetLegalAndSupportSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_lockout_settings_request.py b/zitadel_client/models/beta_settings_service_get_lockout_settings_request.py index 92a7f57e..b9f3810a 100644 --- a/zitadel_client/models/beta_settings_service_get_lockout_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_lockout_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLockoutSettingsRequest(BaseModel): """ BetaSettingsServiceGetLockoutSettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetLockoutSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLockoutSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLockoutSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetLockoutSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_lockout_settings_response.py b/zitadel_client/models/beta_settings_service_get_lockout_settings_response.py index b9d18782..76f4801c 100644 --- a/zitadel_client/models/beta_settings_service_get_lockout_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_lockout_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_lockout_settings import BetaSettingsServiceLockoutSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLockoutSettingsResponse(BaseModel): """ BetaSettingsServiceGetLockoutSettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceLockoutSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceLockoutSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetLockoutSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLockoutSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLockoutSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceLockoutSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_lockout_settings import ( + BetaSettingsServiceLockoutSettings, +) +BetaSettingsServiceGetLockoutSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_login_settings_request.py b/zitadel_client/models/beta_settings_service_get_login_settings_request.py index 0c80f920..2e4d35f3 100644 --- a/zitadel_client/models/beta_settings_service_get_login_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_login_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLoginSettingsRequest(BaseModel): """ BetaSettingsServiceGetLoginSettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetLoginSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLoginSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLoginSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetLoginSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_login_settings_response.py b/zitadel_client/models/beta_settings_service_get_login_settings_response.py index aed04eec..3569d069 100644 --- a/zitadel_client/models/beta_settings_service_get_login_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_login_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_login_settings import BetaSettingsServiceLoginSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetLoginSettingsResponse(BaseModel): """ BetaSettingsServiceGetLoginSettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceLoginSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceLoginSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetLoginSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLoginSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetLoginSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceLoginSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_login_settings import ( + BetaSettingsServiceLoginSettings, +) +BetaSettingsServiceGetLoginSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_password_complexity_settings_request.py b/zitadel_client/models/beta_settings_service_get_password_complexity_settings_request.py index 91aba49a..fd151c45 100644 --- a/zitadel_client/models/beta_settings_service_get_password_complexity_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_password_complexity_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetPasswordComplexitySettingsRequest(BaseModel): """ BetaSettingsServiceGetPasswordComplexitySettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,10 @@ class BetaSettingsServiceGetPasswordComplexitySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordComplexitySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordComplexitySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetPasswordComplexitySettingsRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_settings_service_get_password_complexity_settings_response.py b/zitadel_client/models/beta_settings_service_get_password_complexity_settings_response.py index 40811fc3..84c58266 100644 --- a/zitadel_client/models/beta_settings_service_get_password_complexity_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_password_complexity_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_password_complexity_settings import BetaSettingsServicePasswordComplexitySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetPasswordComplexitySettingsResponse(BaseModel): """ BetaSettingsServiceGetPasswordComplexitySettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServicePasswordComplexitySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServicePasswordComplexitySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,13 @@ class BetaSettingsServiceGetPasswordComplexitySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordComplexitySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordComplexitySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServicePasswordComplexitySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_password_complexity_settings import ( + BetaSettingsServicePasswordComplexitySettings, +) +BetaSettingsServiceGetPasswordComplexitySettingsResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/beta_settings_service_get_password_expiry_settings_request.py b/zitadel_client/models/beta_settings_service_get_password_expiry_settings_request.py index f07def44..d56e6034 100644 --- a/zitadel_client/models/beta_settings_service_get_password_expiry_settings_request.py +++ b/zitadel_client/models/beta_settings_service_get_password_expiry_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_request_context import BetaSettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetPasswordExpirySettingsRequest(BaseModel): """ BetaSettingsServiceGetPasswordExpirySettingsRequest - """ # noqa: E501 - ctx: Optional[BetaSettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[BetaSettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceGetPasswordExpirySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordExpirySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordExpirySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": BetaSettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_request_context import ( + BetaSettingsServiceRequestContext, +) +BetaSettingsServiceGetPasswordExpirySettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_password_expiry_settings_response.py b/zitadel_client/models/beta_settings_service_get_password_expiry_settings_response.py index b711f2a0..46a7397e 100644 --- a/zitadel_client/models/beta_settings_service_get_password_expiry_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_password_expiry_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_password_expiry_settings import BetaSettingsServicePasswordExpirySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetPasswordExpirySettingsResponse(BaseModel): """ BetaSettingsServiceGetPasswordExpirySettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServicePasswordExpirySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServicePasswordExpirySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetPasswordExpirySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordExpirySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetPasswordExpirySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServicePasswordExpirySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_password_expiry_settings import ( + BetaSettingsServicePasswordExpirySettings, +) +BetaSettingsServiceGetPasswordExpirySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_get_security_settings_response.py b/zitadel_client/models/beta_settings_service_get_security_settings_response.py index c0b99b96..fe6ca468 100644 --- a/zitadel_client/models/beta_settings_service_get_security_settings_response.py +++ b/zitadel_client/models/beta_settings_service_get_security_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from zitadel_client.models.beta_settings_service_security_settings import BetaSettingsServiceSecuritySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceGetSecuritySettingsResponse(BaseModel): """ BetaSettingsServiceGetSecuritySettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - settings: Optional[BetaSettingsServiceSecuritySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[BetaSettingsServiceSecuritySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,11 @@ class BetaSettingsServiceGetSecuritySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetSecuritySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceGetSecuritySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": BetaSettingsServiceSecuritySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +from zitadel_client.models.beta_settings_service_security_settings import ( + BetaSettingsServiceSecuritySettings, +) +BetaSettingsServiceGetSecuritySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_identity_provider.py b/zitadel_client/models/beta_settings_service_identity_provider.py index c0e9fdb6..173711df 100644 --- a/zitadel_client/models/beta_settings_service_identity_provider.py +++ b/zitadel_client/models/beta_settings_service_identity_provider.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_identity_provider_type import BetaSettingsServiceIdentityProviderType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSettingsServiceIdentityProvider(BaseModel): """ BetaSettingsServiceIdentityProvider - """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - type: Optional[BetaSettingsServiceIdentityProviderType] = None - __properties: ClassVar[List[str]] = ["id", "name", "type"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + type: Optional[BetaSettingsServiceIdentityProviderType] = Field( + default=None, alias="type" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +34,8 @@ class BetaSettingsServiceIdentityProvider(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceIdentityProvider from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceIdentityProvider from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.beta_settings_service_identity_provider_type import ( + BetaSettingsServiceIdentityProviderType, +) +BetaSettingsServiceIdentityProvider.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_identity_provider_type.py b/zitadel_client/models/beta_settings_service_identity_provider_type.py index e461055e..bec744f1 100644 --- a/zitadel_client/models/beta_settings_service_identity_provider_type.py +++ b/zitadel_client/models/beta_settings_service_identity_provider_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServiceIdentityProviderType(str, Enum): @@ -23,25 +13,17 @@ class BetaSettingsServiceIdentityProviderType(str, Enum): BetaSettingsServiceIdentityProviderType """ - """ - allowed enum values - """ - IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED' - IDENTITY_PROVIDER_TYPE_OIDC = 'IDENTITY_PROVIDER_TYPE_OIDC' - IDENTITY_PROVIDER_TYPE_JWT = 'IDENTITY_PROVIDER_TYPE_JWT' - IDENTITY_PROVIDER_TYPE_LDAP = 'IDENTITY_PROVIDER_TYPE_LDAP' - IDENTITY_PROVIDER_TYPE_OAUTH = 'IDENTITY_PROVIDER_TYPE_OAUTH' - IDENTITY_PROVIDER_TYPE_AZURE_AD = 'IDENTITY_PROVIDER_TYPE_AZURE_AD' - IDENTITY_PROVIDER_TYPE_GITHUB = 'IDENTITY_PROVIDER_TYPE_GITHUB' - IDENTITY_PROVIDER_TYPE_GITHUB_ES = 'IDENTITY_PROVIDER_TYPE_GITHUB_ES' - IDENTITY_PROVIDER_TYPE_GITLAB = 'IDENTITY_PROVIDER_TYPE_GITLAB' - IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = 'IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED' - IDENTITY_PROVIDER_TYPE_GOOGLE = 'IDENTITY_PROVIDER_TYPE_GOOGLE' - IDENTITY_PROVIDER_TYPE_SAML = 'IDENTITY_PROVIDER_TYPE_SAML' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServiceIdentityProviderType from a JSON string""" - return cls(json.loads(json_str)) - - + IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED" + IDENTITY_PROVIDER_TYPE_OIDC = "IDENTITY_PROVIDER_TYPE_OIDC" + IDENTITY_PROVIDER_TYPE_JWT = "IDENTITY_PROVIDER_TYPE_JWT" + IDENTITY_PROVIDER_TYPE_LDAP = "IDENTITY_PROVIDER_TYPE_LDAP" + IDENTITY_PROVIDER_TYPE_OAUTH = "IDENTITY_PROVIDER_TYPE_OAUTH" + IDENTITY_PROVIDER_TYPE_AZURE_AD = "IDENTITY_PROVIDER_TYPE_AZURE_AD" + IDENTITY_PROVIDER_TYPE_GITHUB = "IDENTITY_PROVIDER_TYPE_GITHUB" + IDENTITY_PROVIDER_TYPE_GITHUB_ES = "IDENTITY_PROVIDER_TYPE_GITHUB_ES" + IDENTITY_PROVIDER_TYPE_GITLAB = "IDENTITY_PROVIDER_TYPE_GITLAB" + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = ( + "IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED" + ) + IDENTITY_PROVIDER_TYPE_GOOGLE = "IDENTITY_PROVIDER_TYPE_GOOGLE" + IDENTITY_PROVIDER_TYPE_SAML = "IDENTITY_PROVIDER_TYPE_SAML" diff --git a/zitadel_client/models/beta_settings_service_legal_and_support_settings.py b/zitadel_client/models/beta_settings_service_legal_and_support_settings.py index 4d404bb7..fb2600b7 100644 --- a/zitadel_client/models/beta_settings_service_legal_and_support_settings.py +++ b/zitadel_client/models/beta_settings_service_legal_and_support_settings.py @@ -1,42 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSettingsServiceLegalAndSupportSettings(BaseModel): """ BetaSettingsServiceLegalAndSupportSettings - """ # noqa: E501 + """ + tos_link: Optional[StrictStr] = Field(default=None, alias="tosLink") - privacy_policy_link: Optional[StrictStr] = Field(default=None, alias="privacyPolicyLink") + privacy_policy_link: Optional[StrictStr] = Field( + default=None, alias="privacyPolicyLink" + ) help_link: Optional[StrictStr] = Field(default=None, alias="helpLink") support_email: Optional[StrictStr] = Field(default=None, alias="supportEmail") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) docs_link: Optional[StrictStr] = Field(default=None, alias="docsLink") custom_link: Optional[StrictStr] = Field(default=None, alias="customLink") custom_link_text: Optional[StrictStr] = Field(default=None, alias="customLinkText") - __properties: ClassVar[List[str]] = ["tosLink", "privacyPolicyLink", "helpLink", "supportEmail", "resourceOwnerType", "docsLink", "customLink", "customLinkText"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,59 +41,8 @@ class BetaSettingsServiceLegalAndSupportSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLegalAndSupportSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLegalAndSupportSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "tosLink": obj.get("tosLink"), - "privacyPolicyLink": obj.get("privacyPolicyLink"), - "helpLink": obj.get("helpLink"), - "supportEmail": obj.get("supportEmail"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "docsLink": obj.get("docsLink"), - "customLink": obj.get("customLink"), - "customLinkText": obj.get("customLinkText") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +BetaSettingsServiceLegalAndSupportSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_list_details.py b/zitadel_client/models/beta_settings_service_list_details.py index 86875fa8..d12ad18e 100644 --- a/zitadel_client/models/beta_settings_service_list_details.py +++ b/zitadel_client/models/beta_settings_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSettingsServiceListDetails(BaseModel): """ BetaSettingsServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class BetaSettingsServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +BetaSettingsServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_lockout_settings.py b/zitadel_client/models/beta_settings_service_lockout_settings.py index 6e8cc3c5..c96c65b4 100644 --- a/zitadel_client/models/beta_settings_service_lockout_settings.py +++ b/zitadel_client/models/beta_settings_service_lockout_settings.py @@ -1,37 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSettingsServiceLockoutSettings(BaseModel): """ BetaSettingsServiceLockoutSettings - """ # noqa: E501 - max_password_attempts: Optional[Any] = Field(default=None, alias="maxPasswordAttempts") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - max_otp_attempts: Optional[Any] = Field(default=None, alias="maxOtpAttempts") - __properties: ClassVar[List[str]] = ["maxPasswordAttempts", "resourceOwnerType", "maxOtpAttempts"] + """ + max_password_attempts: Optional[object] = Field( + default=None, alias="maxPasswordAttempts" + ) + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + max_otp_attempts: Optional[object] = Field(default=None, alias="maxOtpAttempts") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +35,8 @@ class BetaSettingsServiceLockoutSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLockoutSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if max_password_attempts (nullable) is None - # and model_fields_set contains the field - if self.max_password_attempts is None and "max_password_attempts" in self.model_fields_set: - _dict['maxPasswordAttempts'] = None - - # set to None if max_otp_attempts (nullable) is None - # and model_fields_set contains the field - if self.max_otp_attempts is None and "max_otp_attempts" in self.model_fields_set: - _dict['maxOtpAttempts'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLockoutSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "maxPasswordAttempts": obj.get("maxPasswordAttempts"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "maxOtpAttempts": obj.get("maxOtpAttempts") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +BetaSettingsServiceLockoutSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_login_settings.py b/zitadel_client/models/beta_settings_service_login_settings.py index e957d2cf..dc61f9ba 100644 --- a/zitadel_client/models/beta_settings_service_login_settings.py +++ b/zitadel_client/models/beta_settings_service_login_settings.py @@ -1,57 +1,95 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_settings_service_multi_factor_type import BetaSettingsServiceMultiFactorType -from zitadel_client.models.beta_settings_service_passkeys_type import BetaSettingsServicePasskeysType -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from zitadel_client.models.beta_settings_service_second_factor_type import BetaSettingsServiceSecondFactorType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaSettingsServiceLoginSettings(BaseModel): """ BetaSettingsServiceLoginSettings - """ # noqa: E501 - allow_username_password: Optional[StrictBool] = Field(default=None, alias="allowUsernamePassword") + """ + + allow_username_password: Optional[StrictBool] = Field( + default=None, alias="allowUsernamePassword" + ) allow_register: Optional[StrictBool] = Field(default=None, alias="allowRegister") - allow_external_idp: Optional[StrictBool] = Field(default=None, alias="allowExternalIdp") + allow_external_idp: Optional[StrictBool] = Field( + default=None, alias="allowExternalIdp" + ) force_mfa: Optional[StrictBool] = Field(default=None, alias="forceMfa") - passkeys_type: Optional[BetaSettingsServicePasskeysType] = Field(default=None, alias="passkeysType") - hide_password_reset: Optional[StrictBool] = Field(default=None, alias="hidePasswordReset") - ignore_unknown_usernames: Optional[StrictBool] = Field(default=None, alias="ignoreUnknownUsernames") - default_redirect_uri: Optional[StrictStr] = Field(default=None, alias="defaultRedirectUri") - password_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="passwordCheckLifetime") - external_login_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="externalLoginCheckLifetime") - mfa_init_skip_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="mfaInitSkipLifetime") - second_factor_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="secondFactorCheckLifetime") - multi_factor_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="multiFactorCheckLifetime") - second_factors: Optional[List[BetaSettingsServiceSecondFactorType]] = Field(default=None, alias="secondFactors") - multi_factors: Optional[List[BetaSettingsServiceMultiFactorType]] = Field(default=None, alias="multiFactors") - allow_domain_discovery: Optional[StrictBool] = Field(default=None, description="If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success.", alias="allowDomainDiscovery") - disable_login_with_email: Optional[StrictBool] = Field(default=None, alias="disableLoginWithEmail") - disable_login_with_phone: Optional[StrictBool] = Field(default=None, alias="disableLoginWithPhone") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - force_mfa_local_only: Optional[StrictBool] = Field(default=None, alias="forceMfaLocalOnly") - __properties: ClassVar[List[str]] = ["allowUsernamePassword", "allowRegister", "allowExternalIdp", "forceMfa", "passkeysType", "hidePasswordReset", "ignoreUnknownUsernames", "defaultRedirectUri", "passwordCheckLifetime", "externalLoginCheckLifetime", "mfaInitSkipLifetime", "secondFactorCheckLifetime", "multiFactorCheckLifetime", "secondFactors", "multiFactors", "allowDomainDiscovery", "disableLoginWithEmail", "disableLoginWithPhone", "resourceOwnerType", "forceMfaLocalOnly"] + passkeys_type: Optional[BetaSettingsServicePasskeysType] = Field( + default=None, alias="passkeysType" + ) + hide_password_reset: Optional[StrictBool] = Field( + default=None, alias="hidePasswordReset" + ) + ignore_unknown_usernames: Optional[StrictBool] = Field( + default=None, alias="ignoreUnknownUsernames" + ) + default_redirect_uri: Optional[StrictStr] = Field( + default=None, alias="defaultRedirectUri" + ) + password_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="passwordCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + external_login_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="externalLoginCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + mfa_init_skip_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="mfaInitSkipLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + second_factor_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="secondFactorCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + multi_factor_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="multiFactorCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + second_factors: Optional[List[BetaSettingsServiceSecondFactorType]] = Field( + default=None, alias="secondFactors" + ) + multi_factors: Optional[List[BetaSettingsServiceMultiFactorType]] = Field( + default=None, alias="multiFactors" + ) + allow_domain_discovery: Optional[StrictBool] = Field( + default=None, + alias="allowDomainDiscovery", + description="If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the org domains and will redirect to the registration of that organization on success.", + ) + disable_login_with_email: Optional[StrictBool] = Field( + default=None, alias="disableLoginWithEmail" + ) + disable_login_with_phone: Optional[StrictBool] = Field( + default=None, alias="disableLoginWithPhone" + ) + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + force_mfa_local_only: Optional[StrictBool] = Field( + default=None, alias="forceMfaLocalOnly" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -59,71 +97,18 @@ class BetaSettingsServiceLoginSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLoginSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceLoginSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "allowUsernamePassword": obj.get("allowUsernamePassword"), - "allowRegister": obj.get("allowRegister"), - "allowExternalIdp": obj.get("allowExternalIdp"), - "forceMfa": obj.get("forceMfa"), - "passkeysType": obj.get("passkeysType"), - "hidePasswordReset": obj.get("hidePasswordReset"), - "ignoreUnknownUsernames": obj.get("ignoreUnknownUsernames"), - "defaultRedirectUri": obj.get("defaultRedirectUri"), - "passwordCheckLifetime": obj.get("passwordCheckLifetime"), - "externalLoginCheckLifetime": obj.get("externalLoginCheckLifetime"), - "mfaInitSkipLifetime": obj.get("mfaInitSkipLifetime"), - "secondFactorCheckLifetime": obj.get("secondFactorCheckLifetime"), - "multiFactorCheckLifetime": obj.get("multiFactorCheckLifetime"), - "secondFactors": obj.get("secondFactors"), - "multiFactors": obj.get("multiFactors"), - "allowDomainDiscovery": obj.get("allowDomainDiscovery"), - "disableLoginWithEmail": obj.get("disableLoginWithEmail"), - "disableLoginWithPhone": obj.get("disableLoginWithPhone"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "forceMfaLocalOnly": obj.get("forceMfaLocalOnly") - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.beta_settings_service_multi_factor_type import ( + BetaSettingsServiceMultiFactorType, +) +from zitadel_client.models.beta_settings_service_passkeys_type import ( + BetaSettingsServicePasskeysType, +) +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +from zitadel_client.models.beta_settings_service_second_factor_type import ( + BetaSettingsServiceSecondFactorType, +) + +BetaSettingsServiceLoginSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_multi_factor_type.py b/zitadel_client/models/beta_settings_service_multi_factor_type.py index 57a3e77d..79fdb4df 100644 --- a/zitadel_client/models/beta_settings_service_multi_factor_type.py +++ b/zitadel_client/models/beta_settings_service_multi_factor_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServiceMultiFactorType(str, Enum): @@ -23,15 +13,5 @@ class BetaSettingsServiceMultiFactorType(str, Enum): BetaSettingsServiceMultiFactorType """ - """ - allowed enum values - """ - MULTI_FACTOR_TYPE_UNSPECIFIED = 'MULTI_FACTOR_TYPE_UNSPECIFIED' - MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = 'MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServiceMultiFactorType from a JSON string""" - return cls(json.loads(json_str)) - - + MULTI_FACTOR_TYPE_UNSPECIFIED = "MULTI_FACTOR_TYPE_UNSPECIFIED" + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = "MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION" diff --git a/zitadel_client/models/beta_settings_service_passkeys_type.py b/zitadel_client/models/beta_settings_service_passkeys_type.py index 4d3a86f5..b0bdb191 100644 --- a/zitadel_client/models/beta_settings_service_passkeys_type.py +++ b/zitadel_client/models/beta_settings_service_passkeys_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServicePasskeysType(str, Enum): @@ -23,15 +13,5 @@ class BetaSettingsServicePasskeysType(str, Enum): BetaSettingsServicePasskeysType """ - """ - allowed enum values - """ - PASSKEYS_TYPE_NOT_ALLOWED = 'PASSKEYS_TYPE_NOT_ALLOWED' - PASSKEYS_TYPE_ALLOWED = 'PASSKEYS_TYPE_ALLOWED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServicePasskeysType from a JSON string""" - return cls(json.loads(json_str)) - - + PASSKEYS_TYPE_NOT_ALLOWED = "PASSKEYS_TYPE_NOT_ALLOWED" + PASSKEYS_TYPE_ALLOWED = "PASSKEYS_TYPE_ALLOWED" diff --git a/zitadel_client/models/beta_settings_service_password_complexity_settings.py b/zitadel_client/models/beta_settings_service_password_complexity_settings.py index 92465149..0dd5a7c5 100644 --- a/zitadel_client/models/beta_settings_service_password_complexity_settings.py +++ b/zitadel_client/models/beta_settings_service_password_complexity_settings.py @@ -1,40 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSettingsServicePasswordComplexitySettings(BaseModel): """ BetaSettingsServicePasswordComplexitySettings - """ # noqa: E501 - min_length: Optional[Any] = Field(default=None, alias="minLength") - requires_uppercase: Optional[StrictBool] = Field(default=None, alias="requiresUppercase") - requires_lowercase: Optional[StrictBool] = Field(default=None, alias="requiresLowercase") + """ + + min_length: Optional[object] = Field(default=None, alias="minLength") + requires_uppercase: Optional[StrictBool] = Field( + default=None, alias="requiresUppercase" + ) + requires_lowercase: Optional[StrictBool] = Field( + default=None, alias="requiresLowercase" + ) requires_number: Optional[StrictBool] = Field(default=None, alias="requiresNumber") requires_symbol: Optional[StrictBool] = Field(default=None, alias="requiresSymbol") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["minLength", "requiresUppercase", "requiresLowercase", "requiresNumber", "requiresSymbol", "resourceOwnerType"] + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,62 +41,8 @@ class BetaSettingsServicePasswordComplexitySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServicePasswordComplexitySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if min_length (nullable) is None - # and model_fields_set contains the field - if self.min_length is None and "min_length" in self.model_fields_set: - _dict['minLength'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServicePasswordComplexitySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "minLength": obj.get("minLength"), - "requiresUppercase": obj.get("requiresUppercase"), - "requiresLowercase": obj.get("requiresLowercase"), - "requiresNumber": obj.get("requiresNumber"), - "requiresSymbol": obj.get("requiresSymbol"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +BetaSettingsServicePasswordComplexitySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_password_expiry_settings.py b/zitadel_client/models/beta_settings_service_password_expiry_settings.py index b13bb374..a7a51863 100644 --- a/zitadel_client/models/beta_settings_service_password_expiry_settings.py +++ b/zitadel_client/models/beta_settings_service_password_expiry_settings.py @@ -1,37 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_resource_owner_type import BetaSettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaSettingsServicePasswordExpirySettings(BaseModel): """ BetaSettingsServicePasswordExpirySettings - """ # noqa: E501 - max_age_days: Optional[Any] = Field(default=None, description="Amount of days after which a password will expire. The user will be forced to change the password on the following authentication.", alias="maxAgeDays") - expire_warn_days: Optional[Any] = Field(default=None, description="Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user.", alias="expireWarnDays") - resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["maxAgeDays", "expireWarnDays", "resourceOwnerType"] + """ + + max_age_days: Optional[object] = Field( + default=None, + alias="maxAgeDays", + description="Amount of days after which a password will expire. The user will be forced to change the password on the following authentication.", + ) + expire_warn_days: Optional[object] = Field( + default=None, + alias="expireWarnDays", + description="Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user.", + ) + resource_owner_type: Optional[BetaSettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +41,8 @@ class BetaSettingsServicePasswordExpirySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServicePasswordExpirySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if max_age_days (nullable) is None - # and model_fields_set contains the field - if self.max_age_days is None and "max_age_days" in self.model_fields_set: - _dict['maxAgeDays'] = None - - # set to None if expire_warn_days (nullable) is None - # and model_fields_set contains the field - if self.expire_warn_days is None and "expire_warn_days" in self.model_fields_set: - _dict['expireWarnDays'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServicePasswordExpirySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "maxAgeDays": obj.get("maxAgeDays"), - "expireWarnDays": obj.get("expireWarnDays"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.beta_settings_service_resource_owner_type import ( + BetaSettingsServiceResourceOwnerType, +) +BetaSettingsServicePasswordExpirySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_request_context.py b/zitadel_client/models/beta_settings_service_request_context.py index 3d265c08..5b336db8 100644 --- a/zitadel_client/models/beta_settings_service_request_context.py +++ b/zitadel_client/models/beta_settings_service_request_context.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaSettingsServiceRequestContext(BaseModel): """ BetaSettingsServiceRequestContext - """ # noqa: E501 - instance: Optional[StrictBool] = None + """ + + instance: Optional[StrictBool] = Field(default=None, alias="instance") org_id: Optional[StrictStr] = Field(default=None, alias="orgId") - __properties: ClassVar[List[str]] = ["instance", "orgId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaSettingsServiceRequestContext(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceRequestContext from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceRequestContext from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "orgId": obj.get("orgId") - }) - return _obj - - +BetaSettingsServiceRequestContext.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_resource_owner_type.py b/zitadel_client/models/beta_settings_service_resource_owner_type.py index dd22fd3b..dd1b8a7a 100644 --- a/zitadel_client/models/beta_settings_service_resource_owner_type.py +++ b/zitadel_client/models/beta_settings_service_resource_owner_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServiceResourceOwnerType(str, Enum): @@ -23,16 +13,6 @@ class BetaSettingsServiceResourceOwnerType(str, Enum): BetaSettingsServiceResourceOwnerType """ - """ - allowed enum values - """ - RESOURCE_OWNER_TYPE_UNSPECIFIED = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' - RESOURCE_OWNER_TYPE_INSTANCE = 'RESOURCE_OWNER_TYPE_INSTANCE' - RESOURCE_OWNER_TYPE_ORG = 'RESOURCE_OWNER_TYPE_ORG' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServiceResourceOwnerType from a JSON string""" - return cls(json.loads(json_str)) - - + RESOURCE_OWNER_TYPE_UNSPECIFIED = "RESOURCE_OWNER_TYPE_UNSPECIFIED" + RESOURCE_OWNER_TYPE_INSTANCE = "RESOURCE_OWNER_TYPE_INSTANCE" + RESOURCE_OWNER_TYPE_ORG = "RESOURCE_OWNER_TYPE_ORG" diff --git a/zitadel_client/models/beta_settings_service_second_factor_type.py b/zitadel_client/models/beta_settings_service_second_factor_type.py index 8532a98a..08936489 100644 --- a/zitadel_client/models/beta_settings_service_second_factor_type.py +++ b/zitadel_client/models/beta_settings_service_second_factor_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServiceSecondFactorType(str, Enum): @@ -23,18 +13,8 @@ class BetaSettingsServiceSecondFactorType(str, Enum): BetaSettingsServiceSecondFactorType """ - """ - allowed enum values - """ - SECOND_FACTOR_TYPE_UNSPECIFIED = 'SECOND_FACTOR_TYPE_UNSPECIFIED' - SECOND_FACTOR_TYPE_OTP = 'SECOND_FACTOR_TYPE_OTP' - SECOND_FACTOR_TYPE_U2_F = 'SECOND_FACTOR_TYPE_U2F' - SECOND_FACTOR_TYPE_OTP_EMAIL = 'SECOND_FACTOR_TYPE_OTP_EMAIL' - SECOND_FACTOR_TYPE_OTP_SMS = 'SECOND_FACTOR_TYPE_OTP_SMS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServiceSecondFactorType from a JSON string""" - return cls(json.loads(json_str)) - - + SECOND_FACTOR_TYPE_UNSPECIFIED = "SECOND_FACTOR_TYPE_UNSPECIFIED" + SECOND_FACTOR_TYPE_OTP = "SECOND_FACTOR_TYPE_OTP" + SECOND_FACTOR_TYPE_U2_F = "SECOND_FACTOR_TYPE_U2F" + SECOND_FACTOR_TYPE_OTP_EMAIL = "SECOND_FACTOR_TYPE_OTP_EMAIL" + SECOND_FACTOR_TYPE_OTP_SMS = "SECOND_FACTOR_TYPE_OTP_SMS" diff --git a/zitadel_client/models/beta_settings_service_security_settings.py b/zitadel_client/models/beta_settings_service_security_settings.py index b1b1dc3c..97344c36 100644 --- a/zitadel_client/models/beta_settings_service_security_settings.py +++ b/zitadel_client/models/beta_settings_service_security_settings.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_embedded_iframe_settings import BetaSettingsServiceEmbeddedIframeSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSettingsServiceSecuritySettings(BaseModel): """ BetaSettingsServiceSecuritySettings - """ # noqa: E501 - embedded_iframe: Optional[BetaSettingsServiceEmbeddedIframeSettings] = Field(default=None, alias="embeddedIframe") - enable_impersonation: Optional[StrictBool] = Field(default=None, alias="enableImpersonation") - __properties: ClassVar[List[str]] = ["embeddedIframe", "enableImpersonation"] + """ + + embedded_iframe: Optional[BetaSettingsServiceEmbeddedIframeSettings] = Field( + default=None, alias="embeddedIframe" + ) + enable_impersonation: Optional[StrictBool] = Field( + default=None, alias="enableImpersonation" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +35,8 @@ class BetaSettingsServiceSecuritySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSecuritySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of embedded_iframe - if self.embedded_iframe: - _dict['embeddedIframe'] = self.embedded_iframe.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSecuritySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "embeddedIframe": BetaSettingsServiceEmbeddedIframeSettings.from_dict(obj["embeddedIframe"]) if obj.get("embeddedIframe") is not None else None, - "enableImpersonation": obj.get("enableImpersonation") - }) - return _obj - +from zitadel_client.models.beta_settings_service_embedded_iframe_settings import ( + BetaSettingsServiceEmbeddedIframeSettings, +) +BetaSettingsServiceSecuritySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_set_security_settings_request.py b/zitadel_client/models/beta_settings_service_set_security_settings_request.py index 5fddcabc..96a280a8 100644 --- a/zitadel_client/models/beta_settings_service_set_security_settings_request.py +++ b/zitadel_client/models/beta_settings_service_set_security_settings_request.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_embedded_iframe_settings import BetaSettingsServiceEmbeddedIframeSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class BetaSettingsServiceSetSecuritySettingsRequest(BaseModel): """ BetaSettingsServiceSetSecuritySettingsRequest - """ # noqa: E501 - embedded_iframe: Optional[BetaSettingsServiceEmbeddedIframeSettings] = Field(default=None, alias="embeddedIframe") - enable_impersonation: Optional[StrictBool] = Field(default=None, alias="enableImpersonation") - __properties: ClassVar[List[str]] = ["embeddedIframe", "enableImpersonation"] + """ + + embedded_iframe: Optional[BetaSettingsServiceEmbeddedIframeSettings] = Field( + default=None, alias="embeddedIframe" + ) + enable_impersonation: Optional[StrictBool] = Field( + default=None, alias="enableImpersonation" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +35,8 @@ class BetaSettingsServiceSetSecuritySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSetSecuritySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of embedded_iframe - if self.embedded_iframe: - _dict['embeddedIframe'] = self.embedded_iframe.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSetSecuritySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "embeddedIframe": BetaSettingsServiceEmbeddedIframeSettings.from_dict(obj["embeddedIframe"]) if obj.get("embeddedIframe") is not None else None, - "enableImpersonation": obj.get("enableImpersonation") - }) - return _obj - +from zitadel_client.models.beta_settings_service_embedded_iframe_settings import ( + BetaSettingsServiceEmbeddedIframeSettings, +) +BetaSettingsServiceSetSecuritySettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_set_security_settings_response.py b/zitadel_client/models/beta_settings_service_set_security_settings_response.py index 6c37ffae..e0a8f007 100644 --- a/zitadel_client/models/beta_settings_service_set_security_settings_response.py +++ b/zitadel_client/models/beta_settings_service_set_security_settings_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_settings_service_details import BetaSettingsServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaSettingsServiceSetSecuritySettingsResponse(BaseModel): """ BetaSettingsServiceSetSecuritySettingsResponse - """ # noqa: E501 - details: Optional[BetaSettingsServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaSettingsServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class BetaSettingsServiceSetSecuritySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSetSecuritySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceSetSecuritySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaSettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_settings_service_details import ( + BetaSettingsServiceDetails, +) +BetaSettingsServiceSetSecuritySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_theme.py b/zitadel_client/models/beta_settings_service_theme.py index 608e621a..7bf048af 100644 --- a/zitadel_client/models/beta_settings_service_theme.py +++ b/zitadel_client/models/beta_settings_service_theme.py @@ -1,39 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaSettingsServiceTheme(BaseModel): """ BetaSettingsServiceTheme - """ # noqa: E501 - primary_color: Optional[StrictStr] = Field(default=None, description="hex value for primary color", alias="primaryColor") - background_color: Optional[StrictStr] = Field(default=None, description="hex value for background color", alias="backgroundColor") - warn_color: Optional[StrictStr] = Field(default=None, description="hex value for warning color", alias="warnColor") - font_color: Optional[StrictStr] = Field(default=None, description="hex value for font color", alias="fontColor") - logo_url: Optional[StrictStr] = Field(default=None, description="url where the logo is served", alias="logoUrl") - icon_url: Optional[StrictStr] = Field(default=None, description="url where the icon is served", alias="iconUrl") - __properties: ClassVar[List[str]] = ["primaryColor", "backgroundColor", "warnColor", "fontColor", "logoUrl", "iconUrl"] + """ + primary_color: Optional[StrictStr] = Field( + default=None, alias="primaryColor", description="hex value for primary color" + ) + background_color: Optional[StrictStr] = Field( + default=None, + alias="backgroundColor", + description="hex value for background color", + ) + warn_color: Optional[StrictStr] = Field( + default=None, alias="warnColor", description="hex value for warning color" + ) + font_color: Optional[StrictStr] = Field( + default=None, alias="fontColor", description="hex value for font color" + ) + logo_url: Optional[StrictStr] = Field( + default=None, alias="logoUrl", description="url where the logo is served" + ) + icon_url: Optional[StrictStr] = Field( + default=None, alias="iconUrl", description="url where the icon is served" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,57 +49,4 @@ class BetaSettingsServiceTheme(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaSettingsServiceTheme from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaSettingsServiceTheme from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "primaryColor": obj.get("primaryColor"), - "backgroundColor": obj.get("backgroundColor"), - "warnColor": obj.get("warnColor"), - "fontColor": obj.get("fontColor"), - "logoUrl": obj.get("logoUrl"), - "iconUrl": obj.get("iconUrl") - }) - return _obj - - +BetaSettingsServiceTheme.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_settings_service_theme_mode.py b/zitadel_client/models/beta_settings_service_theme_mode.py index 0a1e8f03..6fd5134e 100644 --- a/zitadel_client/models/beta_settings_service_theme_mode.py +++ b/zitadel_client/models/beta_settings_service_theme_mode.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaSettingsServiceThemeMode(str, Enum): @@ -23,17 +13,7 @@ class BetaSettingsServiceThemeMode(str, Enum): BetaSettingsServiceThemeMode """ - """ - allowed enum values - """ - THEME_MODE_UNSPECIFIED = 'THEME_MODE_UNSPECIFIED' - THEME_MODE_AUTO = 'THEME_MODE_AUTO' - THEME_MODE_LIGHT = 'THEME_MODE_LIGHT' - THEME_MODE_DARK = 'THEME_MODE_DARK' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaSettingsServiceThemeMode from a JSON string""" - return cls(json.loads(json_str)) - - + THEME_MODE_UNSPECIFIED = "THEME_MODE_UNSPECIFIED" + THEME_MODE_AUTO = "THEME_MODE_AUTO" + THEME_MODE_LIGHT = "THEME_MODE_LIGHT" + THEME_MODE_DARK = "THEME_MODE_DARK" diff --git a/zitadel_client/models/beta_telemetry_service_any.py b/zitadel_client/models/beta_telemetry_service_any.py index 55fec35a..1a5782d0 100644 --- a/zitadel_client/models/beta_telemetry_service_any.py +++ b/zitadel_client/models/beta_telemetry_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaTelemetryServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaTelemetryServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_connect_error.py b/zitadel_client/models/beta_telemetry_service_connect_error.py index b1fa11f5..2c153fbc 100644 --- a/zitadel_client/models/beta_telemetry_service_connect_error.py +++ b/zitadel_client/models/beta_telemetry_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_telemetry_service_any import BetaTelemetryServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaTelemetryServiceConnectErrorCodeEnum(str, Enum): + """BetaTelemetryServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaTelemetryServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaTelemetryServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaTelemetryServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaTelemetryServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaTelemetryServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_telemetry_service_any import BetaTelemetryServiceAny +BetaTelemetryServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_count_parent_type.py b/zitadel_client/models/beta_telemetry_service_count_parent_type.py index 08d394d6..06fb4bea 100644 --- a/zitadel_client/models/beta_telemetry_service_count_parent_type.py +++ b/zitadel_client/models/beta_telemetry_service_count_parent_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaTelemetryServiceCountParentType(str, Enum): @@ -23,16 +13,6 @@ class BetaTelemetryServiceCountParentType(str, Enum): BetaTelemetryServiceCountParentType """ - """ - allowed enum values - """ - COUNT_PARENT_TYPE_UNSPECIFIED = 'COUNT_PARENT_TYPE_UNSPECIFIED' - COUNT_PARENT_TYPE_INSTANCE = 'COUNT_PARENT_TYPE_INSTANCE' - COUNT_PARENT_TYPE_ORGANIZATION = 'COUNT_PARENT_TYPE_ORGANIZATION' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaTelemetryServiceCountParentType from a JSON string""" - return cls(json.loads(json_str)) - - + COUNT_PARENT_TYPE_UNSPECIFIED = "COUNT_PARENT_TYPE_UNSPECIFIED" + COUNT_PARENT_TYPE_INSTANCE = "COUNT_PARENT_TYPE_INSTANCE" + COUNT_PARENT_TYPE_ORGANIZATION = "COUNT_PARENT_TYPE_ORGANIZATION" diff --git a/zitadel_client/models/beta_telemetry_service_instance_information.py b/zitadel_client/models/beta_telemetry_service_instance_information.py index 12afd30d..a21d48b9 100644 --- a/zitadel_client/models/beta_telemetry_service_instance_information.py +++ b/zitadel_client/models/beta_telemetry_service_instance_information.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaTelemetryServiceInstanceInformation(BaseModel): """ BetaTelemetryServiceInstanceInformation - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the instance.") - domains: Optional[List[StrictStr]] = Field(default=None, description="The custom domains (incl. generated ones) of the instance.") - created_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="createdAt") - __properties: ClassVar[List[str]] = ["id", "domains", "createdAt"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the instance." + ) + domains: Optional[List[StrictStr]] = Field( + default=None, + alias="domains", + description="The custom domains (incl. generated ones) of the instance.", + ) + created_at: Optional[AwareDatetime] = Field( + default=None, + alias="createdAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,6 @@ class BetaTelemetryServiceInstanceInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceInstanceInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceInstanceInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "domains": obj.get("domains"), - "createdAt": obj.get("createdAt") - }) - return _obj - +from pydantic import AwareDatetime +BetaTelemetryServiceInstanceInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_report_base_information_request.py b/zitadel_client/models/beta_telemetry_service_report_base_information_request.py index 2bc61a5b..1911596e 100644 --- a/zitadel_client/models/beta_telemetry_service_report_base_information_request.py +++ b/zitadel_client/models/beta_telemetry_service_report_base_information_request.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_telemetry_service_instance_information import BetaTelemetryServiceInstanceInformation -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaTelemetryServiceReportBaseInformationRequest(BaseModel): """ BetaTelemetryServiceReportBaseInformationRequest - """ # noqa: E501 - system_id: Optional[StrictStr] = Field(default=None, description="The system ID is a unique identifier for the ZITADEL system.", alias="systemId") - version: Optional[StrictStr] = Field(default=None, description="The current version of the ZITADEL system.") - instances: Optional[List[BetaTelemetryServiceInstanceInformation]] = Field(default=None, description="A list of instances in the ZITADEL system and their information.") - __properties: ClassVar[List[str]] = ["systemId", "version", "instances"] + """ + + system_id: Optional[StrictStr] = Field( + default=None, + alias="systemId", + description="The system ID is a unique identifier for the ZITADEL system.", + ) + version: Optional[StrictStr] = Field( + default=None, + alias="version", + description="The current version of the ZITADEL system.", + ) + instances: Optional[List[BetaTelemetryServiceInstanceInformation]] = Field( + default=None, + alias="instances", + description="A list of instances in the ZITADEL system and their information.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,61 +44,8 @@ class BetaTelemetryServiceReportBaseInformationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportBaseInformationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in instances (list) - _items = [] - if self.instances: - for _item_instances in self.instances: - if _item_instances: - _items.append(_item_instances.to_dict()) - _dict['instances'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportBaseInformationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "systemId": obj.get("systemId"), - "version": obj.get("version"), - "instances": [BetaTelemetryServiceInstanceInformation.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None - }) - return _obj - +from zitadel_client.models.beta_telemetry_service_instance_information import ( + BetaTelemetryServiceInstanceInformation, +) +BetaTelemetryServiceReportBaseInformationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_report_base_information_response.py b/zitadel_client/models/beta_telemetry_service_report_base_information_response.py index 1fe5c608..1272ab33 100644 --- a/zitadel_client/models/beta_telemetry_service_report_base_information_response.py +++ b/zitadel_client/models/beta_telemetry_service_report_base_information_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaTelemetryServiceReportBaseInformationResponse(BaseModel): """ BetaTelemetryServiceReportBaseInformationResponse - """ # noqa: E501 - report_id: Optional[StrictStr] = Field(default=None, description="The report ID is a unique identifier for the report. It is used to identify the report to be able to link it to the resource counts or other reports. Note that the report ID is only valid for the same system ID.", alias="reportId") - __properties: ClassVar[List[str]] = ["reportId"] + """ + report_id: Optional[StrictStr] = Field( + default=None, + alias="reportId", + description="The report ID is a unique identifier for the report. It is used to identify the report to be able to link it to the resource counts or other reports. Note that the report ID is only valid for the same system ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaTelemetryServiceReportBaseInformationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportBaseInformationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportBaseInformationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "reportId": obj.get("reportId") - }) - return _obj - - +BetaTelemetryServiceReportBaseInformationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_report_resource_counts_request.py b/zitadel_client/models/beta_telemetry_service_report_resource_counts_request.py index 345b89c1..dd462f01 100644 --- a/zitadel_client/models/beta_telemetry_service_report_resource_counts_request.py +++ b/zitadel_client/models/beta_telemetry_service_report_resource_counts_request.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_telemetry_service_resource_count import BetaTelemetryServiceResourceCount -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaTelemetryServiceReportResourceCountsRequest(BaseModel): """ BetaTelemetryServiceReportResourceCountsRequest - """ # noqa: E501 - system_id: Optional[StrictStr] = Field(default=None, description="The system ID is a unique identifier for the ZITADEL system.", alias="systemId") - report_id: Optional[StrictStr] = Field(default=None, description="The previously returned report ID from the server to continue reporting. Note that the report ID is only valid for the same system ID.", alias="reportId") - resource_counts: Optional[List[BetaTelemetryServiceResourceCount]] = Field(default=None, description="A list of resource counts to report.", alias="resourceCounts") - __properties: ClassVar[List[str]] = ["systemId", "reportId", "resourceCounts"] + """ + + system_id: Optional[StrictStr] = Field( + default=None, + alias="systemId", + description="The system ID is a unique identifier for the ZITADEL system.", + ) + report_id: Optional[StrictStr] = Field( + default=None, + alias="reportId", + description="The previously returned report ID from the server to continue reporting. Note that the report ID is only valid for the same system ID.", + ) + resource_counts: Optional[List[BetaTelemetryServiceResourceCount]] = Field( + default=None, + alias="resourceCounts", + description="A list of resource counts to report.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,66 +44,8 @@ class BetaTelemetryServiceReportResourceCountsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportResourceCountsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in resource_counts (list) - _items = [] - if self.resource_counts: - for _item_resource_counts in self.resource_counts: - if _item_resource_counts: - _items.append(_item_resource_counts.to_dict()) - _dict['resourceCounts'] = _items - # set to None if report_id (nullable) is None - # and model_fields_set contains the field - if self.report_id is None and "report_id" in self.model_fields_set: - _dict['reportId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportResourceCountsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "systemId": obj.get("systemId"), - "reportId": obj.get("reportId"), - "resourceCounts": [BetaTelemetryServiceResourceCount.from_dict(_item) for _item in obj["resourceCounts"]] if obj.get("resourceCounts") is not None else None - }) - return _obj - +from zitadel_client.models.beta_telemetry_service_resource_count import ( + BetaTelemetryServiceResourceCount, +) +BetaTelemetryServiceReportResourceCountsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_report_resource_counts_response.py b/zitadel_client/models/beta_telemetry_service_report_resource_counts_response.py index b6843ce3..7c73256f 100644 --- a/zitadel_client/models/beta_telemetry_service_report_resource_counts_response.py +++ b/zitadel_client/models/beta_telemetry_service_report_resource_counts_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaTelemetryServiceReportResourceCountsResponse(BaseModel): """ BetaTelemetryServiceReportResourceCountsResponse - """ # noqa: E501 - report_id: Optional[StrictStr] = Field(default=None, description="The report ID is a unique identifier for the report. It is used to identify the report in case of additional data / pagination. Note that the report ID is only valid for the same system ID.", alias="reportId") - __properties: ClassVar[List[str]] = ["reportId"] + """ + report_id: Optional[StrictStr] = Field( + default=None, + alias="reportId", + description="The report ID is a unique identifier for the report. It is used to identify the report in case of additional data / pagination. Note that the report ID is only valid for the same system ID.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class BetaTelemetryServiceReportResourceCountsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportResourceCountsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceReportResourceCountsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "reportId": obj.get("reportId") - }) - return _obj - - +BetaTelemetryServiceReportResourceCountsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_telemetry_service_resource_count.py b/zitadel_client/models/beta_telemetry_service_resource_count.py index 144f178d..0638ac1e 100644 --- a/zitadel_client/models/beta_telemetry_service_resource_count.py +++ b/zitadel_client/models/beta_telemetry_service_resource_count.py @@ -1,42 +1,58 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_telemetry_service_count_parent_type import BetaTelemetryServiceCountParentType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictInt, StrictStr +from typing import Optional + class BetaTelemetryServiceResourceCount(BaseModel): """ BetaTelemetryServiceResourceCount - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="The ID of the instance for which the resource counts are reported.", alias="instanceId") - parent_type: Optional[BetaTelemetryServiceCountParentType] = Field(default=None, alias="parentType") - parent_id: Optional[StrictStr] = Field(default=None, description="The parent ID of the resource counts (e.g. organization or instance ID). For example, reporting the amount of users per organization would use `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID.", alias="parentId") - resource_name: Optional[StrictStr] = Field(default=None, description="The resource counts to report, e.g. amount of `users`, `organizations`, etc.", alias="resourceName") - table_name: Optional[StrictStr] = Field(default=None, description="The name of the table in the database, which was used to calculate the counts. This can be used to deduplicate counts in case of multiple reports. For example, if the counts were calculated from the `users14` table, the table name would be `users14`, where there could also be a `users15` table reported at the same time as the system is rolling out a new version.", alias="tableName") - updated_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="updatedAt") - amount: Optional[StrictInt] = Field(default=None, description="The actual amount of the resource.") - __properties: ClassVar[List[str]] = ["instanceId", "parentType", "parentId", "resourceName", "tableName", "updatedAt", "amount"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="The ID of the instance for which the resource counts are reported.", + ) + parent_type: Optional[BetaTelemetryServiceCountParentType] = Field( + default=None, alias="parentType" + ) + parent_id: Optional[StrictStr] = Field( + default=None, + alias="parentId", + description="The parent ID of the resource counts (e.g. organization or instance ID). For example, reporting the amount of users per organization would use `COUNT_PARENT_TYPE_ORGANIZATION` as parent type and the organization ID as parent ID.", + ) + resource_name: Optional[StrictStr] = Field( + default=None, + alias="resourceName", + description="The resource counts to report, e.g. amount of `users`, `organizations`, etc.", + ) + table_name: Optional[StrictStr] = Field( + default=None, + alias="tableName", + description="The name of the table in the database, which was used to calculate the counts. This can be used to deduplicate counts in case of multiple reports. For example, if the counts were calculated from the `users14` table, the table name would be `users14`, where there could also be a `users15` table reported at the same time as the system is rolling out a new version.", + ) + updated_at: Optional[AwareDatetime] = Field( + default=None, + alias="updatedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + amount: Optional[StrictInt] = Field( + default=None, alias="amount", description="The actual amount of the resource." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,58 +60,9 @@ class BetaTelemetryServiceResourceCount(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceResourceCount from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaTelemetryServiceResourceCount from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "parentType": obj.get("parentType"), - "parentId": obj.get("parentId"), - "resourceName": obj.get("resourceName"), - "tableName": obj.get("tableName"), - "updatedAt": obj.get("updatedAt"), - "amount": obj.get("amount") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_telemetry_service_count_parent_type import ( + BetaTelemetryServiceCountParentType, +) +BetaTelemetryServiceResourceCount.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_access_token_type.py b/zitadel_client/models/beta_user_service_access_token_type.py index 147dec91..ba7e624d 100644 --- a/zitadel_client/models/beta_user_service_access_token_type.py +++ b/zitadel_client/models/beta_user_service_access_token_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceAccessTokenType(str, Enum): @@ -23,15 +13,5 @@ class BetaUserServiceAccessTokenType(str, Enum): BetaUserServiceAccessTokenType """ - """ - allowed enum values - """ - ACCESS_TOKEN_TYPE_BEARER = 'ACCESS_TOKEN_TYPE_BEARER' - ACCESS_TOKEN_TYPE_JWT = 'ACCESS_TOKEN_TYPE_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceAccessTokenType from a JSON string""" - return cls(json.loads(json_str)) - - + ACCESS_TOKEN_TYPE_BEARER = "ACCESS_TOKEN_TYPE_BEARER" + ACCESS_TOKEN_TYPE_JWT = "ACCESS_TOKEN_TYPE_JWT" diff --git a/zitadel_client/models/beta_user_service_add_human_user_request.py b/zitadel_client/models/beta_user_service_add_human_user_request.py index 38e84f56..a3b44e3b 100644 --- a/zitadel_client/models/beta_user_service_add_human_user_request.py +++ b/zitadel_client/models/beta_user_service_add_human_user_request.py @@ -1,52 +1,60 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_hashed_password import BetaUserServiceHashedPassword -from zitadel_client.models.beta_user_service_idp_link import BetaUserServiceIDPLink -from zitadel_client.models.beta_user_service_organization import BetaUserServiceOrganization -from zitadel_client.models.beta_user_service_password import BetaUserServicePassword -from zitadel_client.models.beta_user_service_set_human_email import BetaUserServiceSetHumanEmail -from zitadel_client.models.beta_user_service_set_human_phone import BetaUserServiceSetHumanPhone -from zitadel_client.models.beta_user_service_set_human_profile import BetaUserServiceSetHumanProfile -from zitadel_client.models.beta_user_service_set_metadata_entry import BetaUserServiceSetMetadataEntry -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaUserServiceAddHumanUserRequest(BaseModel): """ BetaUserServiceAddHumanUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="optionally set your own id unique for the user.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="optionally set a unique username, if none is provided the email will be used.") - organization: Optional[BetaUserServiceOrganization] = None - profile: Optional[BetaUserServiceSetHumanProfile] = None - email: Optional[BetaUserServiceSetHumanEmail] = None - phone: Optional[BetaUserServiceSetHumanPhone] = None - metadata: Optional[List[BetaUserServiceSetMetadataEntry]] = None - idp_links: Optional[List[BetaUserServiceIDPLink]] = Field(default=None, alias="idpLinks") - totp_secret: Optional[StrictStr] = Field(default=None, description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", alias="totpSecret") - hashed_password: Optional[BetaUserServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[BetaUserServicePassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "organization", "profile", "email", "phone", "metadata", "idpLinks", "totpSecret", "hashedPassword", "password"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="optionally set your own id unique for the user.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="optionally set a unique username, if none is provided the email will be used.", + ) + organization: Optional[BetaUserServiceOrganization] = Field( + default=None, alias="organization" + ) + profile: Optional[BetaUserServiceSetHumanProfile] = Field( + default=None, alias="profile" + ) + email: Optional[BetaUserServiceSetHumanEmail] = Field(default=None, alias="email") + phone: Optional[BetaUserServiceSetHumanPhone] = Field(default=None, alias="phone") + metadata: Optional[List[BetaUserServiceSetMetadataEntry]] = Field( + default=None, alias="metadata" + ) + idp_links: Optional[List[BetaUserServiceIDPLink]] = Field( + default=None, alias="idpLinks" + ) + totp_secret: Optional[StrictStr] = Field( + default=None, + alias="totpSecret", + description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", + ) + hashed_password: Optional[BetaUserServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[BetaUserServicePassword] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -54,109 +62,25 @@ class BetaUserServiceAddHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in idp_links (list) - _items = [] - if self.idp_links: - for _item_idp_links in self.idp_links: - if _item_idp_links: - _items.append(_item_idp_links.to_dict()) - _dict['idpLinks'] = _items - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if user_id (nullable) is None - # and model_fields_set contains the field - if self.user_id is None and "user_id" in self.model_fields_set: - _dict['userId'] = None - - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - # set to None if totp_secret (nullable) is None - # and model_fields_set contains the field - if self.totp_secret is None and "totp_secret" in self.model_fields_set: - _dict['totpSecret'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "organization": BetaUserServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "profile": BetaUserServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": BetaUserServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": BetaUserServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "metadata": [BetaUserServiceSetMetadataEntry.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None, - "idpLinks": [BetaUserServiceIDPLink.from_dict(_item) for _item in obj["idpLinks"]] if obj.get("idpLinks") is not None else None, - "totpSecret": obj.get("totpSecret"), - "hashedPassword": BetaUserServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": BetaUserServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_user_service_hashed_password import ( + BetaUserServiceHashedPassword, +) +from zitadel_client.models.beta_user_service_idp_link import BetaUserServiceIDPLink +from zitadel_client.models.beta_user_service_organization import ( + BetaUserServiceOrganization, +) +from zitadel_client.models.beta_user_service_password import BetaUserServicePassword +from zitadel_client.models.beta_user_service_set_human_email import ( + BetaUserServiceSetHumanEmail, +) +from zitadel_client.models.beta_user_service_set_human_phone import ( + BetaUserServiceSetHumanPhone, +) +from zitadel_client.models.beta_user_service_set_human_profile import ( + BetaUserServiceSetHumanProfile, +) +from zitadel_client.models.beta_user_service_set_metadata_entry import ( + BetaUserServiceSetMetadataEntry, +) + +BetaUserServiceAddHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_human_user_response.py b/zitadel_client/models/beta_user_service_add_human_user_response.py index 4d7f5db6..ae193679 100644 --- a/zitadel_client/models/beta_user_service_add_human_user_response.py +++ b/zitadel_client/models/beta_user_service_add_human_user_response.py @@ -1,38 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceAddHumanUserResponse(BaseModel): """ BetaUserServiceAddHumanUserResponse - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - details: Optional[BetaUserServiceDetails] = None + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["userId", "details", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,68 +33,6 @@ class BetaUserServiceAddHumanUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddHumanUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddHumanUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceAddHumanUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_idp_link_request.py b/zitadel_client/models/beta_user_service_add_idp_link_request.py index fdf8c45b..d138d1d5 100644 --- a/zitadel_client/models/beta_user_service_add_idp_link_request.py +++ b/zitadel_client/models/beta_user_service_add_idp_link_request.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_idp_link import BetaUserServiceIDPLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceAddIDPLinkRequest(BaseModel): """ BetaUserServiceAddIDPLinkRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") idp_link: Optional[BetaUserServiceIDPLink] = Field(default=None, alias="idpLink") - __properties: ClassVar[List[str]] = ["userId", "idpLink"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +31,6 @@ class BetaUserServiceAddIDPLinkRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddIDPLinkRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of idp_link - if self.idp_link: - _dict['idpLink'] = self.idp_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddIDPLinkRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "idpLink": BetaUserServiceIDPLink.from_dict(obj["idpLink"]) if obj.get("idpLink") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_idp_link import BetaUserServiceIDPLink +BetaUserServiceAddIDPLinkRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_idp_link_response.py b/zitadel_client/models/beta_user_service_add_idp_link_response.py index fb1c97e0..39defc23 100644 --- a/zitadel_client/models/beta_user_service_add_idp_link_response.py +++ b/zitadel_client/models/beta_user_service_add_idp_link_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceAddIDPLinkResponse(BaseModel): """ BetaUserServiceAddIDPLinkResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceAddIDPLinkResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddIDPLinkResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddIDPLinkResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceAddIDPLinkResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_otp_email_request.py b/zitadel_client/models/beta_user_service_add_otp_email_request.py index 06d350dd..303e6cd0 100644 --- a/zitadel_client/models/beta_user_service_add_otp_email_request.py +++ b/zitadel_client/models/beta_user_service_add_otp_email_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceAddOTPEmailRequest(BaseModel): """ BetaUserServiceAddOTPEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceAddOTPEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceAddOTPEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_otp_email_response.py b/zitadel_client/models/beta_user_service_add_otp_email_response.py index bc4d83d6..d3316200 100644 --- a/zitadel_client/models/beta_user_service_add_otp_email_response.py +++ b/zitadel_client/models/beta_user_service_add_otp_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceAddOTPEmailResponse(BaseModel): """ BetaUserServiceAddOTPEmailResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceAddOTPEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceAddOTPEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_otpsms_request.py b/zitadel_client/models/beta_user_service_add_otpsms_request.py index 7bf2587b..cc968583 100644 --- a/zitadel_client/models/beta_user_service_add_otpsms_request.py +++ b/zitadel_client/models/beta_user_service_add_otpsms_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceAddOTPSMSRequest(BaseModel): """ BetaUserServiceAddOTPSMSRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceAddOTPSMSRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPSMSRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPSMSRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceAddOTPSMSRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_add_otpsms_response.py b/zitadel_client/models/beta_user_service_add_otpsms_response.py index d277034c..57ca96ac 100644 --- a/zitadel_client/models/beta_user_service_add_otpsms_response.py +++ b/zitadel_client/models/beta_user_service_add_otpsms_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceAddOTPSMSResponse(BaseModel): """ BetaUserServiceAddOTPSMSResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceAddOTPSMSResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPSMSResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAddOTPSMSResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceAddOTPSMSResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_and_query.py b/zitadel_client/models/beta_user_service_and_query.py index b14a1c43..c3b88c92 100644 --- a/zitadel_client/models/beta_user_service_and_query.py +++ b/zitadel_client/models/beta_user_service_and_query.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaUserServiceAndQuery(BaseModel): """ Connect multiple sub-condition with and AND operator. - """ # noqa: E501 - queries: Optional[List[BetaUserServiceSearchQuery]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[BetaUserServiceSearchQuery]] = Field( + default=None, alias="queries" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class BetaUserServiceAndQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAndQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAndQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [BetaUserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.beta_user_service_search_query import BetaUserServiceSearchQuery -# TODO: Rewrite to not use raise_errors BetaUserServiceAndQuery.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_user_service_any.py b/zitadel_client/models/beta_user_service_any.py index e98aee6d..9a305f92 100644 --- a/zitadel_client/models/beta_user_service_any.py +++ b/zitadel_client/models/beta_user_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaUserServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaUserServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_authentication_method_type.py b/zitadel_client/models/beta_user_service_authentication_method_type.py index 7f0a2e2c..78a7ba4f 100644 --- a/zitadel_client/models/beta_user_service_authentication_method_type.py +++ b/zitadel_client/models/beta_user_service_authentication_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceAuthenticationMethodType(str, Enum): @@ -23,21 +13,11 @@ class BetaUserServiceAuthenticationMethodType(str, Enum): BetaUserServiceAuthenticationMethodType """ - """ - allowed enum values - """ - AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = 'AUTHENTICATION_METHOD_TYPE_UNSPECIFIED' - AUTHENTICATION_METHOD_TYPE_PASSWORD = 'AUTHENTICATION_METHOD_TYPE_PASSWORD' - AUTHENTICATION_METHOD_TYPE_PASSKEY = 'AUTHENTICATION_METHOD_TYPE_PASSKEY' - AUTHENTICATION_METHOD_TYPE_IDP = 'AUTHENTICATION_METHOD_TYPE_IDP' - AUTHENTICATION_METHOD_TYPE_TOTP = 'AUTHENTICATION_METHOD_TYPE_TOTP' - AUTHENTICATION_METHOD_TYPE_U2_F = 'AUTHENTICATION_METHOD_TYPE_U2F' - AUTHENTICATION_METHOD_TYPE_OTP_SMS = 'AUTHENTICATION_METHOD_TYPE_OTP_SMS' - AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = 'AUTHENTICATION_METHOD_TYPE_OTP_EMAIL' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceAuthenticationMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED" + AUTHENTICATION_METHOD_TYPE_PASSWORD = "AUTHENTICATION_METHOD_TYPE_PASSWORD" + AUTHENTICATION_METHOD_TYPE_PASSKEY = "AUTHENTICATION_METHOD_TYPE_PASSKEY" + AUTHENTICATION_METHOD_TYPE_IDP = "AUTHENTICATION_METHOD_TYPE_IDP" + AUTHENTICATION_METHOD_TYPE_TOTP = "AUTHENTICATION_METHOD_TYPE_TOTP" + AUTHENTICATION_METHOD_TYPE_U2_F = "AUTHENTICATION_METHOD_TYPE_U2F" + AUTHENTICATION_METHOD_TYPE_OTP_SMS = "AUTHENTICATION_METHOD_TYPE_OTP_SMS" + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL" diff --git a/zitadel_client/models/beta_user_service_connect_error.py b/zitadel_client/models/beta_user_service_connect_error.py index caad7ebc..7ff6bfdb 100644 --- a/zitadel_client/models/beta_user_service_connect_error.py +++ b/zitadel_client/models/beta_user_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_any import BetaUserServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaUserServiceConnectErrorCodeEnum(str, Enum): + """BetaUserServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaUserServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaUserServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaUserServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaUserServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaUserServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_user_service_any import BetaUserServiceAny +BetaUserServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_create_passkey_registration_link_request.py b/zitadel_client/models/beta_user_service_create_passkey_registration_link_request.py index 5b974f44..852a06a5 100644 --- a/zitadel_client/models/beta_user_service_create_passkey_registration_link_request.py +++ b/zitadel_client/models/beta_user_service_create_passkey_registration_link_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_send_passkey_registration_link import BetaUserServiceSendPasskeyRegistrationLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceCreatePasskeyRegistrationLinkRequest(BaseModel): """ BetaUserServiceCreatePasskeyRegistrationLinkRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_link: Optional[BetaUserServiceSendPasskeyRegistrationLink] = Field(default=None, alias="sendLink") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendLink"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_link: Optional[BetaUserServiceSendPasskeyRegistrationLink] = Field( + default=None, alias="sendLink" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class BetaUserServiceCreatePasskeyRegistrationLinkRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceCreatePasskeyRegistrationLinkRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_link - if self.send_link: - _dict['sendLink'] = self.send_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceCreatePasskeyRegistrationLinkRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendLink": BetaUserServiceSendPasskeyRegistrationLink.from_dict(obj["sendLink"]) if obj.get("sendLink") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_send_passkey_registration_link import ( + BetaUserServiceSendPasskeyRegistrationLink, +) +BetaUserServiceCreatePasskeyRegistrationLinkRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_create_passkey_registration_link_response.py b/zitadel_client/models/beta_user_service_create_passkey_registration_link_response.py index 6541a16a..9f3dd3ed 100644 --- a/zitadel_client/models/beta_user_service_create_passkey_registration_link_response.py +++ b/zitadel_client/models/beta_user_service_create_passkey_registration_link_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_passkey_registration_code import BetaUserServicePasskeyRegistrationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceCreatePasskeyRegistrationLinkResponse(BaseModel): """ BetaUserServiceCreatePasskeyRegistrationLinkResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - code: Optional[BetaUserServicePasskeyRegistrationCode] = None - __properties: ClassVar[List[str]] = ["details", "code"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + code: Optional[BetaUserServicePasskeyRegistrationCode] = Field( + default=None, alias="code" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class BetaUserServiceCreatePasskeyRegistrationLinkResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceCreatePasskeyRegistrationLinkResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of code - if self.code: - _dict['code'] = self.code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceCreatePasskeyRegistrationLinkResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "code": BetaUserServicePasskeyRegistrationCode.from_dict(obj["code"]) if obj.get("code") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +from zitadel_client.models.beta_user_service_passkey_registration_code import ( + BetaUserServicePasskeyRegistrationCode, +) +BetaUserServiceCreatePasskeyRegistrationLinkResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_deactivate_user_request.py b/zitadel_client/models/beta_user_service_deactivate_user_request.py index c6ac3929..e628bcf3 100644 --- a/zitadel_client/models/beta_user_service_deactivate_user_request.py +++ b/zitadel_client/models/beta_user_service_deactivate_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceDeactivateUserRequest(BaseModel): """ BetaUserServiceDeactivateUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceDeactivateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDeactivateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDeactivateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceDeactivateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_deactivate_user_response.py b/zitadel_client/models/beta_user_service_deactivate_user_response.py index 2d04c9a7..2768d25c 100644 --- a/zitadel_client/models/beta_user_service_deactivate_user_response.py +++ b/zitadel_client/models/beta_user_service_deactivate_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceDeactivateUserResponse(BaseModel): """ BetaUserServiceDeactivateUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceDeactivateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDeactivateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDeactivateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceDeactivateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_delete_user_request.py b/zitadel_client/models/beta_user_service_delete_user_request.py index 1256a5c5..9db4d40c 100644 --- a/zitadel_client/models/beta_user_service_delete_user_request.py +++ b/zitadel_client/models/beta_user_service_delete_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceDeleteUserRequest(BaseModel): """ BetaUserServiceDeleteUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceDeleteUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDeleteUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDeleteUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceDeleteUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_delete_user_response.py b/zitadel_client/models/beta_user_service_delete_user_response.py index eccce4e0..7f56a8be 100644 --- a/zitadel_client/models/beta_user_service_delete_user_response.py +++ b/zitadel_client/models/beta_user_service_delete_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceDeleteUserResponse(BaseModel): """ BetaUserServiceDeleteUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceDeleteUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDeleteUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDeleteUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceDeleteUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_details.py b/zitadel_client/models/beta_user_service_details.py index d1d8d371..285e7cbf 100644 --- a/zitadel_client/models/beta_user_service_details.py +++ b/zitadel_client/models/beta_user_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceDetails(BaseModel): """ BetaUserServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class BetaUserServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaUserServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_display_name_query.py b/zitadel_client/models/beta_user_service_display_name_query.py index 5c4abe40..b2582c89 100644 --- a/zitadel_client/models/beta_user_service_display_name_query.py +++ b/zitadel_client/models/beta_user_service_display_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceDisplayNameQuery(BaseModel): """ Query for users with a specific display name. - """ # noqa: E501 + """ + display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceDisplayNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceDisplayNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceDisplayNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceDisplayNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_email_query.py b/zitadel_client/models/beta_user_service_email_query.py index 424674be..282420f0 100644 --- a/zitadel_client/models/beta_user_service_email_query.py +++ b/zitadel_client/models/beta_user_service_email_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceEmailQuery(BaseModel): """ Query for users with a specific email. - """ # noqa: E501 + """ + email_address: Optional[StrictStr] = Field(default=None, alias="emailAddress") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["emailAddress", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceEmailQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceEmailQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceEmailQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "emailAddress": obj.get("emailAddress"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceEmailQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_first_name_query.py b/zitadel_client/models/beta_user_service_first_name_query.py index 2a5e4d7a..146ff1af 100644 --- a/zitadel_client/models/beta_user_service_first_name_query.py +++ b/zitadel_client/models/beta_user_service_first_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceFirstNameQuery(BaseModel): """ Query for users with a specific first name. - """ # noqa: E501 + """ + first_name: Optional[StrictStr] = Field(default=None, alias="firstName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["firstName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceFirstNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceFirstNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceFirstNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "firstName": obj.get("firstName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceFirstNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_form_data.py b/zitadel_client/models/beta_user_service_form_data.py index 221bdc46..72451d5a 100644 --- a/zitadel_client/models/beta_user_service_form_data.py +++ b/zitadel_client/models/beta_user_service_form_data.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceFormData(BaseModel): """ BetaUserServiceFormData - """ # noqa: E501 - url: Optional[StrictStr] = Field(default=None, description="The URL to which the form should be submitted using the POST method.") - fields: Optional[Dict[str, StrictStr]] = Field(default=None, description="The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\".") - __properties: ClassVar[List[str]] = ["url", "fields"] + """ + url: Optional[StrictStr] = Field( + default=None, + alias="url", + description="The URL to which the form should be submitted using the POST method.", + ) + fields: Optional[Dict[str, StrictStr]] = Field( + default=None, + alias="fields", + description='The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type "text".', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class BetaUserServiceFormData(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceFormData from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceFormData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "url": obj.get("url"), - "fields": obj.get("fields") - }) - return _obj - - +BetaUserServiceFormData.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_gender.py b/zitadel_client/models/beta_user_service_gender.py index d3f0d14f..7d733073 100644 --- a/zitadel_client/models/beta_user_service_gender.py +++ b/zitadel_client/models/beta_user_service_gender.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceGender(str, Enum): @@ -23,17 +13,7 @@ class BetaUserServiceGender(str, Enum): BetaUserServiceGender """ - """ - allowed enum values - """ - GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' - GENDER_FEMALE = 'GENDER_FEMALE' - GENDER_MALE = 'GENDER_MALE' - GENDER_DIVERSE = 'GENDER_DIVERSE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceGender from a JSON string""" - return cls(json.loads(json_str)) - - + GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED" + GENDER_FEMALE = "GENDER_FEMALE" + GENDER_MALE = "GENDER_MALE" + GENDER_DIVERSE = "GENDER_DIVERSE" diff --git a/zitadel_client/models/beta_user_service_get_user_by_id_request.py b/zitadel_client/models/beta_user_service_get_user_by_id_request.py index 3c35a601..b3605918 100644 --- a/zitadel_client/models/beta_user_service_get_user_by_id_request.py +++ b/zitadel_client/models/beta_user_service_get_user_by_id_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceGetUserByIDRequest(BaseModel): """ BetaUserServiceGetUserByIDRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceGetUserByIDRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceGetUserByIDRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceGetUserByIDRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceGetUserByIDRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_get_user_by_id_response.py b/zitadel_client/models/beta_user_service_get_user_by_id_response.py index 2bc4a4d7..590a045c 100644 --- a/zitadel_client/models/beta_user_service_get_user_by_id_response.py +++ b/zitadel_client/models/beta_user_service_get_user_by_id_response.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_user import BetaUserServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceGetUserByIDResponse(BaseModel): """ BetaUserServiceGetUserByIDResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - user: Optional[BetaUserServiceUser] = None - __properties: ClassVar[List[str]] = ["details", "user"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + user: Optional[BetaUserServiceUser] = Field(default=None, alias="user") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +30,7 @@ class BetaUserServiceGetUserByIDResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceGetUserByIDResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceGetUserByIDResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "user": BetaUserServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +from zitadel_client.models.beta_user_service_user import BetaUserServiceUser +BetaUserServiceGetUserByIDResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_hashed_password.py b/zitadel_client/models/beta_user_service_hashed_password.py index 11008418..81610e78 100644 --- a/zitadel_client/models/beta_user_service_hashed_password.py +++ b/zitadel_client/models/beta_user_service_hashed_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceHashedPassword(BaseModel): """ BetaUserServiceHashedPassword - """ # noqa: E501 - hash: Optional[StrictStr] = None + """ + + hash: Optional[StrictStr] = Field(default=None, alias="hash") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["hash", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceHashedPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceHashedPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceHashedPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +BetaUserServiceHashedPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_human_email.py b/zitadel_client/models/beta_user_service_human_email.py index 63cf2ce7..baa9d9fd 100644 --- a/zitadel_client/models/beta_user_service_human_email.py +++ b/zitadel_client/models/beta_user_service_human_email.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceHumanEmail(BaseModel): """ BetaUserServiceHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - __properties: ClassVar[List[str]] = ["email", "isVerified"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified") - }) - return _obj - - +BetaUserServiceHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_human_phone.py b/zitadel_client/models/beta_user_service_human_phone.py index eb0746bf..8b6b9430 100644 --- a/zitadel_client/models/beta_user_service_human_phone.py +++ b/zitadel_client/models/beta_user_service_human_phone.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceHumanPhone(BaseModel): """ BetaUserServiceHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - __properties: ClassVar[List[str]] = ["phone", "isVerified"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified") - }) - return _obj - - +BetaUserServiceHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_human_profile.py b/zitadel_client/models/beta_user_service_human_profile.py index 37c68954..ea0a61f1 100644 --- a/zitadel_client/models/beta_user_service_human_profile.py +++ b/zitadel_client/models/beta_user_service_human_profile.py @@ -1,41 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_gender import BetaUserServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceHumanProfile(BaseModel): """ BetaUserServiceHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[BetaUserServiceGender] = None + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[BetaUserServiceGender] = Field(default=None, alias="gender") avatar_url: Optional[StrictStr] = Field(default=None, alias="avatarUrl") - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender", "avatarUrl"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,73 +38,6 @@ class BetaUserServiceHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender"), - "avatarUrl": obj.get("avatarUrl") - }) - return _obj - +from zitadel_client.models.beta_user_service_gender import BetaUserServiceGender +BetaUserServiceHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_human_user.py b/zitadel_client/models/beta_user_service_human_user.py index f7cdd73a..92a7255e 100644 --- a/zitadel_client/models/beta_user_service_human_user.py +++ b/zitadel_client/models/beta_user_service_human_user.py @@ -1,48 +1,61 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_human_email import BetaUserServiceHumanEmail -from zitadel_client.models.beta_user_service_human_phone import BetaUserServiceHumanPhone -from zitadel_client.models.beta_user_service_human_profile import BetaUserServiceHumanProfile -from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class BetaUserServiceHumanUser(BaseModel): """ BetaUserServiceHumanUser - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user.", alias="userId") - state: Optional[BetaUserServiceUserState] = None - username: Optional[StrictStr] = Field(default=None, description="Username of the user, which can be globally unique or unique on organization level.") - login_names: Optional[List[StrictStr]] = Field(default=None, description="Possible usable login names for the user.", alias="loginNames") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="Preferred login name of the user.", alias="preferredLoginName") - profile: Optional[BetaUserServiceHumanProfile] = None - email: Optional[BetaUserServiceHumanEmail] = None - phone: Optional[BetaUserServiceHumanPhone] = None - password_change_required: Optional[StrictBool] = Field(default=None, description="User is required to change the used password on the next login.", alias="passwordChangeRequired") - password_changed: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="passwordChanged") - __properties: ClassVar[List[str]] = ["userId", "state", "username", "loginNames", "preferredLoginName", "profile", "email", "phone", "passwordChangeRequired", "passwordChanged"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="Unique identifier of the user." + ) + state: Optional[BetaUserServiceUserState] = Field(default=None, alias="state") + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="Username of the user, which can be globally unique or unique on organization level.", + ) + login_names: Optional[List[StrictStr]] = Field( + default=None, + alias="loginNames", + description="Possible usable login names for the user.", + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="Preferred login name of the user.", + ) + profile: Optional[BetaUserServiceHumanProfile] = Field( + default=None, alias="profile" + ) + email: Optional[BetaUserServiceHumanEmail] = Field(default=None, alias="email") + phone: Optional[BetaUserServiceHumanPhone] = Field(default=None, alias="phone") + password_change_required: Optional[StrictBool] = Field( + default=None, + alias="passwordChangeRequired", + description="User is required to change the used password on the next login.", + ) + password_changed: Optional[AwareDatetime] = Field( + default=None, + alias="passwordChanged", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,70 +63,16 @@ class BetaUserServiceHumanUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceHumanUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "state": obj.get("state"), - "username": obj.get("username"), - "loginNames": obj.get("loginNames"), - "preferredLoginName": obj.get("preferredLoginName"), - "profile": BetaUserServiceHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": BetaUserServiceHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": BetaUserServiceHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "passwordChangeRequired": obj.get("passwordChangeRequired"), - "passwordChanged": obj.get("passwordChanged") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_user_service_human_email import ( + BetaUserServiceHumanEmail, +) +from zitadel_client.models.beta_user_service_human_phone import ( + BetaUserServiceHumanPhone, +) +from zitadel_client.models.beta_user_service_human_profile import ( + BetaUserServiceHumanProfile, +) +from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState +BetaUserServiceHumanUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idp_information.py b/zitadel_client/models/beta_user_service_idp_information.py index fdcc298e..01cee61f 100644 --- a/zitadel_client/models/beta_user_service_idp_information.py +++ b/zitadel_client/models/beta_user_service_idp_information.py @@ -1,43 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_idpldap_access_information import BetaUserServiceIDPLDAPAccessInformation -from zitadel_client.models.beta_user_service_idpo_auth_access_information import BetaUserServiceIDPOAuthAccessInformation -from zitadel_client.models.beta_user_service_idpsaml_access_information import BetaUserServiceIDPSAMLAccessInformation -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceIDPInformation(BaseModel): """ BetaUserServiceIDPInformation - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - raw_information: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="rawInformation") - ldap: Optional[BetaUserServiceIDPLDAPAccessInformation] = None - oauth: Optional[BetaUserServiceIDPOAuthAccessInformation] = None - saml: Optional[BetaUserServiceIDPSAMLAccessInformation] = None - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName", "rawInformation", "ldap", "oauth", "saml"] + raw_information: Optional[Dict[str, object]] = Field( + default=None, + alias="rawInformation", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + ldap: Optional[BetaUserServiceIDPLDAPAccessInformation] = Field( + default=None, alias="ldap" + ) + oauth: Optional[BetaUserServiceIDPOAuthAccessInformation] = Field( + default=None, alias="oauth" + ) + saml: Optional[BetaUserServiceIDPSAMLAccessInformation] = Field( + default=None, alias="saml" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,67 +46,14 @@ class BetaUserServiceIDPInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ldap - if self.ldap: - _dict['ldap'] = self.ldap.to_dict() - # override the default output from pydantic by calling `to_dict()` of oauth - if self.oauth: - _dict['oauth'] = self.oauth.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml - if self.saml: - _dict['saml'] = self.saml.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName"), - "rawInformation": obj.get("rawInformation"), - "ldap": BetaUserServiceIDPLDAPAccessInformation.from_dict(obj["ldap"]) if obj.get("ldap") is not None else None, - "oauth": BetaUserServiceIDPOAuthAccessInformation.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, - "saml": BetaUserServiceIDPSAMLAccessInformation.from_dict(obj["saml"]) if obj.get("saml") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_idpldap_access_information import ( + BetaUserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.beta_user_service_idpo_auth_access_information import ( + BetaUserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.beta_user_service_idpsaml_access_information import ( + BetaUserServiceIDPSAMLAccessInformation, +) +BetaUserServiceIDPInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idp_intent.py b/zitadel_client/models/beta_user_service_idp_intent.py index 12730eed..f6ea391f 100644 --- a/zitadel_client/models/beta_user_service_idp_intent.py +++ b/zitadel_client/models/beta_user_service_idp_intent.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceIDPIntent(BaseModel): """ BetaUserServiceIDPIntent - """ # noqa: E501 + """ + idp_intent_id: Optional[StrictStr] = Field(default=None, alias="idpIntentId") idp_intent_token: Optional[StrictStr] = Field(default=None, alias="idpIntentToken") user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class BetaUserServiceIDPIntent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPIntent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPIntent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken"), - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceIDPIntent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idp_link.py b/zitadel_client/models/beta_user_service_idp_link.py index 340d7d6e..7c266546 100644 --- a/zitadel_client/models/beta_user_service_idp_link.py +++ b/zitadel_client/models/beta_user_service_idp_link.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceIDPLink(BaseModel): """ BetaUserServiceIDPLink - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class BetaUserServiceIDPLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName") - }) - return _obj - - +BetaUserServiceIDPLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idpldap_access_information.py b/zitadel_client/models/beta_user_service_idpldap_access_information.py index 71cbdd43..6bdcdf07 100644 --- a/zitadel_client/models/beta_user_service_idpldap_access_information.py +++ b/zitadel_client/models/beta_user_service_idpldap_access_information.py @@ -1,34 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Dict, Optional + class BetaUserServiceIDPLDAPAccessInformation(BaseModel): """ BetaUserServiceIDPLDAPAccessInformation - """ # noqa: E501 - attributes: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.") - __properties: ClassVar[List[str]] = ["attributes"] + """ + attributes: Optional[Dict[str, object]] = Field( + default=None, + alias="attributes", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +33,4 @@ class BetaUserServiceIDPLDAPAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPLDAPAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPLDAPAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "attributes": obj.get("attributes") - }) - return _obj - - +BetaUserServiceIDPLDAPAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idpo_auth_access_information.py b/zitadel_client/models/beta_user_service_idpo_auth_access_information.py index 35977d51..40628258 100644 --- a/zitadel_client/models/beta_user_service_idpo_auth_access_information.py +++ b/zitadel_client/models/beta_user_service_idpo_auth_access_information.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceIDPOAuthAccessInformation(BaseModel): """ BetaUserServiceIDPOAuthAccessInformation - """ # noqa: E501 + """ + access_token: Optional[StrictStr] = Field(default=None, alias="accessToken") id_token: Optional[StrictStr] = Field(default=None, alias="idToken") - __properties: ClassVar[List[str]] = ["accessToken", "idToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +31,4 @@ class BetaUserServiceIDPOAuthAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPOAuthAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if id_token (nullable) is None - # and model_fields_set contains the field - if self.id_token is None and "id_token" in self.model_fields_set: - _dict['idToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPOAuthAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "accessToken": obj.get("accessToken"), - "idToken": obj.get("idToken") - }) - return _obj - - +BetaUserServiceIDPOAuthAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_idpsaml_access_information.py b/zitadel_client/models/beta_user_service_idpsaml_access_information.py index e60538b0..bef59b60 100644 --- a/zitadel_client/models/beta_user_service_idpsaml_access_information.py +++ b/zitadel_client/models/beta_user_service_idpsaml_access_information.py @@ -1,34 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceIDPSAMLAccessInformation(BaseModel): """ BetaUserServiceIDPSAMLAccessInformation - """ # noqa: E501 - assertion: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["assertion"] + """ + assertion: Optional[Base64Bytes] = Field(default=None, alias="assertion") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +29,6 @@ class BetaUserServiceIDPSAMLAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPSAMLAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceIDPSAMLAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "assertion": obj.get("assertion") - }) - return _obj - +from pydantic import Base64Bytes +BetaUserServiceIDPSAMLAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_in_user_emails_query.py b/zitadel_client/models/beta_user_service_in_user_emails_query.py index eb58bff6..6a553e85 100644 --- a/zitadel_client/models/beta_user_service_in_user_emails_query.py +++ b/zitadel_client/models/beta_user_service_in_user_emails_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaUserServiceInUserEmailsQuery(BaseModel): """ Query for users with email in list of emails. - """ # noqa: E501 + """ + user_emails: Optional[List[StrictStr]] = Field(default=None, alias="userEmails") - __properties: ClassVar[List[str]] = ["userEmails"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceInUserEmailsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceInUserEmailsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceInUserEmailsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userEmails": obj.get("userEmails") - }) - return _obj - - +BetaUserServiceInUserEmailsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_in_user_id_query.py b/zitadel_client/models/beta_user_service_in_user_id_query.py index b697f987..b6b9c714 100644 --- a/zitadel_client/models/beta_user_service_in_user_id_query.py +++ b/zitadel_client/models/beta_user_service_in_user_id_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaUserServiceInUserIDQuery(BaseModel): """ Query for users with ID in list of IDs. - """ # noqa: E501 + """ + user_ids: Optional[List[StrictStr]] = Field(default=None, alias="userIds") - __properties: ClassVar[List[str]] = ["userIds"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceInUserIDQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceInUserIDQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceInUserIDQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userIds": obj.get("userIds") - }) - return _obj - - +BetaUserServiceInUserIDQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_last_name_query.py b/zitadel_client/models/beta_user_service_last_name_query.py index b66c3188..80c18932 100644 --- a/zitadel_client/models/beta_user_service_last_name_query.py +++ b/zitadel_client/models/beta_user_service_last_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceLastNameQuery(BaseModel): """ Query for users with a specific last name. - """ # noqa: E501 + """ + last_name: Optional[StrictStr] = Field(default=None, alias="lastName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["lastName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceLastNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceLastNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceLastNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "lastName": obj.get("lastName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceLastNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_ldap_credentials.py b/zitadel_client/models/beta_user_service_ldap_credentials.py index 5f1841b0..49caa98f 100644 --- a/zitadel_client/models/beta_user_service_ldap_credentials.py +++ b/zitadel_client/models/beta_user_service_ldap_credentials.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceLDAPCredentials(BaseModel): """ BetaUserServiceLDAPCredentials - """ # noqa: E501 - username: Optional[StrictStr] = None - password: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["username", "password"] + """ + + username: Optional[StrictStr] = Field(default=None, alias="username") + password: Optional[StrictStr] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceLDAPCredentials(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceLDAPCredentials from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceLDAPCredentials from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "username": obj.get("username"), - "password": obj.get("password") - }) - return _obj - - +BetaUserServiceLDAPCredentials.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_authentication_method_types_request.py b/zitadel_client/models/beta_user_service_list_authentication_method_types_request.py index 4b90ddd6..7e556ab9 100644 --- a/zitadel_client/models/beta_user_service_list_authentication_method_types_request.py +++ b/zitadel_client/models/beta_user_service_list_authentication_method_types_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceListAuthenticationMethodTypesRequest(BaseModel): """ BetaUserServiceListAuthenticationMethodTypesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceListAuthenticationMethodTypesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListAuthenticationMethodTypesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListAuthenticationMethodTypesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceListAuthenticationMethodTypesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_authentication_method_types_response.py b/zitadel_client/models/beta_user_service_list_authentication_method_types_response.py index 220d5dfb..157e1166 100644 --- a/zitadel_client/models/beta_user_service_list_authentication_method_types_response.py +++ b/zitadel_client/models/beta_user_service_list_authentication_method_types_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_authentication_method_type import BetaUserServiceAuthenticationMethodType -from zitadel_client.models.beta_user_service_list_details import BetaUserServiceListDetails -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaUserServiceListAuthenticationMethodTypesResponse(BaseModel): """ BetaUserServiceListAuthenticationMethodTypesResponse - """ # noqa: E501 - details: Optional[BetaUserServiceListDetails] = None - auth_method_types: Optional[List[BetaUserServiceAuthenticationMethodType]] = Field(default=None, alias="authMethodTypes") - __properties: ClassVar[List[str]] = ["details", "authMethodTypes"] + """ + details: Optional[BetaUserServiceListDetails] = Field(default=None, alias="details") + auth_method_types: Optional[List[BetaUserServiceAuthenticationMethodType]] = Field( + default=None, alias="authMethodTypes" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,56 +32,11 @@ class BetaUserServiceListAuthenticationMethodTypesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListAuthenticationMethodTypesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListAuthenticationMethodTypesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "authMethodTypes": obj.get("authMethodTypes") - }) - return _obj - +from zitadel_client.models.beta_user_service_authentication_method_type import ( + BetaUserServiceAuthenticationMethodType, +) +from zitadel_client.models.beta_user_service_list_details import ( + BetaUserServiceListDetails, +) +BetaUserServiceListAuthenticationMethodTypesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_details.py b/zitadel_client/models/beta_user_service_list_details.py index f6ab6f2d..30e6fdb5 100644 --- a/zitadel_client/models/beta_user_service_list_details.py +++ b/zitadel_client/models/beta_user_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaUserServiceListDetails(BaseModel): """ BetaUserServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class BetaUserServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +BetaUserServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_query.py b/zitadel_client/models/beta_user_service_list_query.py index 3992d1d8..33d33f64 100644 --- a/zitadel_client/models/beta_user_service_list_query.py +++ b/zitadel_client/models/beta_user_service_list_query.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class BetaUserServiceListQuery(BaseModel): """ BetaUserServiceListQuery - """ # noqa: E501 - offset: Optional[Any] = None - limit: Optional[StrictInt] = None - asc: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field(default=None, alias="offset") + limit: Optional[StrictInt] = Field(default=None, alias="limit") + asc: Optional[StrictBool] = Field(default=None, alias="asc") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +32,4 @@ class BetaUserServiceListQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +BetaUserServiceListQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_users_request.py b/zitadel_client/models/beta_user_service_list_users_request.py index 595c7aeb..dd5979c5 100644 --- a/zitadel_client/models/beta_user_service_list_users_request.py +++ b/zitadel_client/models/beta_user_service_list_users_request.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_list_query import BetaUserServiceListQuery -from zitadel_client.models.beta_user_service_search_query import BetaUserServiceSearchQuery -from zitadel_client.models.beta_user_service_user_field_name import BetaUserServiceUserFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaUserServiceListUsersRequest(BaseModel): """ BetaUserServiceListUsersRequest - """ # noqa: E501 - query: Optional[BetaUserServiceListQuery] = None - sorting_column: Optional[BetaUserServiceUserFieldName] = Field(default=None, alias="sortingColumn") - queries: Optional[List[BetaUserServiceSearchQuery]] = Field(default=None, description="criteria the client is looking for") - __properties: ClassVar[List[str]] = ["query", "sortingColumn", "queries"] + """ + + query: Optional[BetaUserServiceListQuery] = Field(default=None, alias="query") + sorting_column: Optional[BetaUserServiceUserFieldName] = Field( + default=None, alias="sortingColumn" + ) + queries: Optional[List[BetaUserServiceSearchQuery]] = Field( + default=None, alias="queries", description="criteria the client is looking for" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +35,12 @@ class BetaUserServiceListUsersRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListUsersRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListUsersRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": BetaUserServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "queries": [BetaUserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_user_service_list_query import BetaUserServiceListQuery +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery, +) +from zitadel_client.models.beta_user_service_user_field_name import ( + BetaUserServiceUserFieldName, +) + +BetaUserServiceListUsersRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_list_users_response.py b/zitadel_client/models/beta_user_service_list_users_response.py index af1d2abe..02dc550a 100644 --- a/zitadel_client/models/beta_user_service_list_users_response.py +++ b/zitadel_client/models/beta_user_service_list_users_response.py @@ -1,39 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_list_details import BetaUserServiceListDetails -from zitadel_client.models.beta_user_service_user import BetaUserServiceUser -from zitadel_client.models.beta_user_service_user_field_name import BetaUserServiceUserFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaUserServiceListUsersResponse(BaseModel): """ BetaUserServiceListUsersResponse - """ # noqa: E501 - details: Optional[BetaUserServiceListDetails] = None - sorting_column: Optional[BetaUserServiceUserFieldName] = Field(default=None, alias="sortingColumn") - result: Optional[List[BetaUserServiceUser]] = None - __properties: ClassVar[List[str]] = ["details", "sortingColumn", "result"] + """ + details: Optional[BetaUserServiceListDetails] = Field(default=None, alias="details") + sorting_column: Optional[BetaUserServiceUserFieldName] = Field( + default=None, alias="sortingColumn" + ) + result: Optional[List[BetaUserServiceUser]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +33,12 @@ class BetaUserServiceListUsersResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceListUsersResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceListUsersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "result": [BetaUserServiceUser.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_list_details import ( + BetaUserServiceListDetails, +) +from zitadel_client.models.beta_user_service_user import BetaUserServiceUser +from zitadel_client.models.beta_user_service_user_field_name import ( + BetaUserServiceUserFieldName, +) +BetaUserServiceListUsersResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_lock_user_request.py b/zitadel_client/models/beta_user_service_lock_user_request.py index 62484026..81b886ac 100644 --- a/zitadel_client/models/beta_user_service_lock_user_request.py +++ b/zitadel_client/models/beta_user_service_lock_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceLockUserRequest(BaseModel): """ BetaUserServiceLockUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceLockUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceLockUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceLockUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceLockUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_lock_user_response.py b/zitadel_client/models/beta_user_service_lock_user_response.py index 0c95b9b1..9c8fba96 100644 --- a/zitadel_client/models/beta_user_service_lock_user_response.py +++ b/zitadel_client/models/beta_user_service_lock_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceLockUserResponse(BaseModel): """ BetaUserServiceLockUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceLockUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceLockUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceLockUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceLockUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_login_name_query.py b/zitadel_client/models/beta_user_service_login_name_query.py index aa26a8f4..e291efe1 100644 --- a/zitadel_client/models/beta_user_service_login_name_query.py +++ b/zitadel_client/models/beta_user_service_login_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceLoginNameQuery(BaseModel): """ Query for users with a specific state. - """ # noqa: E501 + """ + login_name: Optional[StrictStr] = Field(default=None, alias="loginName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["loginName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceLoginNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceLoginNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceLoginNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceLoginNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_machine_user.py b/zitadel_client/models/beta_user_service_machine_user.py index 182c65fc..e85689cd 100644 --- a/zitadel_client/models/beta_user_service_machine_user.py +++ b/zitadel_client/models/beta_user_service_machine_user.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_access_token_type import BetaUserServiceAccessTokenType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceMachineUser(BaseModel): """ BetaUserServiceMachineUser - """ # noqa: E501 - name: Optional[StrictStr] = None - description: Optional[StrictStr] = None + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + description: Optional[StrictStr] = Field(default=None, alias="description") has_secret: Optional[StrictBool] = Field(default=None, alias="hasSecret") - access_token_type: Optional[BetaUserServiceAccessTokenType] = Field(default=None, alias="accessTokenType") - __properties: ClassVar[List[str]] = ["name", "description", "hasSecret", "accessTokenType"] + access_token_type: Optional[BetaUserServiceAccessTokenType] = Field( + default=None, alias="accessTokenType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,55 +35,8 @@ class BetaUserServiceMachineUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceMachineUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceMachineUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "description": obj.get("description"), - "hasSecret": obj.get("hasSecret"), - "accessTokenType": obj.get("accessTokenType") - }) - return _obj - +from zitadel_client.models.beta_user_service_access_token_type import ( + BetaUserServiceAccessTokenType, +) +BetaUserServiceMachineUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_nick_name_query.py b/zitadel_client/models/beta_user_service_nick_name_query.py index 36bb79d8..365c24d6 100644 --- a/zitadel_client/models/beta_user_service_nick_name_query.py +++ b/zitadel_client/models/beta_user_service_nick_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceNickNameQuery(BaseModel): """ Query for users with a specific nickname. - """ # noqa: E501 + """ + nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["nickName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceNickNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceNickNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceNickNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "nickName": obj.get("nickName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceNickNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_not_query.py b/zitadel_client/models/beta_user_service_not_query.py index 658ac7ed..dc2ea799 100644 --- a/zitadel_client/models/beta_user_service_not_query.py +++ b/zitadel_client/models/beta_user_service_not_query.py @@ -1,34 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceNotQuery(BaseModel): """ Negate the sub-condition. - """ # noqa: E501 - query: Optional[BetaUserServiceSearchQuery] = None - __properties: ClassVar[List[str]] = ["query"] + """ + query: Optional[BetaUserServiceSearchQuery] = Field(default=None, alias="query") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,58 +29,8 @@ class BetaUserServiceNotQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceNotQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceNotQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": BetaUserServiceSearchQuery.from_dict(obj["query"]) if obj.get("query") is not None else None - }) - return _obj - -from zitadel_client.models.beta_user_service_search_query import BetaUserServiceSearchQuery -# TODO: Rewrite to not use raise_errors BetaUserServiceNotQuery.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_user_service_notification_type.py b/zitadel_client/models/beta_user_service_notification_type.py index e6178977..4393ac9d 100644 --- a/zitadel_client/models/beta_user_service_notification_type.py +++ b/zitadel_client/models/beta_user_service_notification_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceNotificationType(str, Enum): @@ -23,16 +13,6 @@ class BetaUserServiceNotificationType(str, Enum): BetaUserServiceNotificationType """ - """ - allowed enum values - """ - NOTIFICATION_TYPE_UNSPECIFIED = 'NOTIFICATION_TYPE_Unspecified' - NOTIFICATION_TYPE_EMAIL = 'NOTIFICATION_TYPE_Email' - NOTIFICATION_TYPE_SMS = 'NOTIFICATION_TYPE_SMS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceNotificationType from a JSON string""" - return cls(json.loads(json_str)) - - + NOTIFICATION_TYPE_UNSPECIFIED = "NOTIFICATION_TYPE_Unspecified" + NOTIFICATION_TYPE_EMAIL = "NOTIFICATION_TYPE_Email" + NOTIFICATION_TYPE_SMS = "NOTIFICATION_TYPE_SMS" diff --git a/zitadel_client/models/beta_user_service_or_query.py b/zitadel_client/models/beta_user_service_or_query.py index fba495d2..cd282f70 100644 --- a/zitadel_client/models/beta_user_service_or_query.py +++ b/zitadel_client/models/beta_user_service_or_query.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class BetaUserServiceOrQuery(BaseModel): """ Connect multiple sub-condition with and OR operator. - """ # noqa: E501 - queries: Optional[List[BetaUserServiceSearchQuery]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[BetaUserServiceSearchQuery]] = Field( + default=None, alias="queries" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class BetaUserServiceOrQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.beta_user_service_search_query import ( + BetaUserServiceSearchQuery, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceOrQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceOrQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [BetaUserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.beta_user_service_search_query import BetaUserServiceSearchQuery -# TODO: Rewrite to not use raise_errors BetaUserServiceOrQuery.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/beta_user_service_organization.py b/zitadel_client/models/beta_user_service_organization.py index dbbd7538..049587fd 100644 --- a/zitadel_client/models/beta_user_service_organization.py +++ b/zitadel_client/models/beta_user_service_organization.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceOrganization(BaseModel): """ BetaUserServiceOrganization - """ # noqa: E501 + """ + org_domain: Optional[StrictStr] = Field(default=None, alias="orgDomain") org_id: Optional[StrictStr] = Field(default=None, alias="orgId") - __properties: ClassVar[List[str]] = ["orgDomain", "orgId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "orgDomain": obj.get("orgDomain"), - "orgId": obj.get("orgId") - }) - return _obj - - +BetaUserServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_organization_id_query.py b/zitadel_client/models/beta_user_service_organization_id_query.py index ed388fbc..77c317e3 100644 --- a/zitadel_client/models/beta_user_service_organization_id_query.py +++ b/zitadel_client/models/beta_user_service_organization_id_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceOrganizationIdQuery(BaseModel): """ Query for users under a specific organization as resource owner. - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceOrganizationIdQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceOrganizationIdQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceOrganizationIdQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +BetaUserServiceOrganizationIdQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_passkey_authenticator.py b/zitadel_client/models/beta_user_service_passkey_authenticator.py index 7740f1df..172185b7 100644 --- a/zitadel_client/models/beta_user_service_passkey_authenticator.py +++ b/zitadel_client/models/beta_user_service_passkey_authenticator.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServicePasskeyAuthenticator(str, Enum): @@ -23,16 +13,6 @@ class BetaUserServicePasskeyAuthenticator(str, Enum): BetaUserServicePasskeyAuthenticator """ - """ - allowed enum values - """ - PASSKEY_AUTHENTICATOR_UNSPECIFIED = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED' - PASSKEY_AUTHENTICATOR_PLATFORM = 'PASSKEY_AUTHENTICATOR_PLATFORM' - PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = 'PASSKEY_AUTHENTICATOR_CROSS_PLATFORM' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServicePasskeyAuthenticator from a JSON string""" - return cls(json.loads(json_str)) - - + PASSKEY_AUTHENTICATOR_UNSPECIFIED = "PASSKEY_AUTHENTICATOR_UNSPECIFIED" + PASSKEY_AUTHENTICATOR_PLATFORM = "PASSKEY_AUTHENTICATOR_PLATFORM" + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = "PASSKEY_AUTHENTICATOR_CROSS_PLATFORM" diff --git a/zitadel_client/models/beta_user_service_passkey_registration_code.py b/zitadel_client/models/beta_user_service_passkey_registration_code.py index 5aede4a0..8275c333 100644 --- a/zitadel_client/models/beta_user_service_passkey_registration_code.py +++ b/zitadel_client/models/beta_user_service_passkey_registration_code.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServicePasskeyRegistrationCode(BaseModel): """ BetaUserServicePasskeyRegistrationCode - """ # noqa: E501 - id: Optional[StrictStr] = None - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "code"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServicePasskeyRegistrationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServicePasskeyRegistrationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServicePasskeyRegistrationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "code": obj.get("code") - }) - return _obj - - +BetaUserServicePasskeyRegistrationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_password.py b/zitadel_client/models/beta_user_service_password.py index ab9c124e..a78924c6 100644 --- a/zitadel_client/models/beta_user_service_password.py +++ b/zitadel_client/models/beta_user_service_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServicePassword(BaseModel): """ BetaUserServicePassword - """ # noqa: E501 - password: Optional[StrictStr] = None + """ + + password: Optional[StrictStr] = Field(default=None, alias="password") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["password", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServicePassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServicePassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServicePassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +BetaUserServicePassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_password_reset_request.py b/zitadel_client/models/beta_user_service_password_reset_request.py index 79ddacdf..f5e43574 100644 --- a/zitadel_client/models/beta_user_service_password_reset_request.py +++ b/zitadel_client/models/beta_user_service_password_reset_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_send_password_reset_link import BetaUserServiceSendPasswordResetLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServicePasswordResetRequest(BaseModel): """ BetaUserServicePasswordResetRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_link: Optional[BetaUserServiceSendPasswordResetLink] = Field(default=None, alias="sendLink") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendLink"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_link: Optional[BetaUserServiceSendPasswordResetLink] = Field( + default=None, alias="sendLink" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class BetaUserServicePasswordResetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServicePasswordResetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_link - if self.send_link: - _dict['sendLink'] = self.send_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServicePasswordResetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendLink": BetaUserServiceSendPasswordResetLink.from_dict(obj["sendLink"]) if obj.get("sendLink") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_send_password_reset_link import ( + BetaUserServiceSendPasswordResetLink, +) +BetaUserServicePasswordResetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_password_reset_response.py b/zitadel_client/models/beta_user_service_password_reset_response.py index be15c5d3..ec5e384c 100644 --- a/zitadel_client/models/beta_user_service_password_reset_response.py +++ b/zitadel_client/models/beta_user_service_password_reset_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServicePasswordResetResponse(BaseModel): """ BetaUserServicePasswordResetResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the medium was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the medium was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class BetaUserServicePasswordResetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServicePasswordResetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServicePasswordResetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServicePasswordResetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_phone_query.py b/zitadel_client/models/beta_user_service_phone_query.py index d9efed93..75c2e575 100644 --- a/zitadel_client/models/beta_user_service_phone_query.py +++ b/zitadel_client/models/beta_user_service_phone_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServicePhoneQuery(BaseModel): """ Query for users with a specific phone. - """ # noqa: E501 - number: Optional[StrictStr] = None - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["number", "method"] + """ + number: Optional[StrictStr] = Field(default=None, alias="number") + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServicePhoneQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServicePhoneQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServicePhoneQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "number": obj.get("number"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServicePhoneQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_reactivate_user_request.py b/zitadel_client/models/beta_user_service_reactivate_user_request.py index dc2f71e0..2d5775a3 100644 --- a/zitadel_client/models/beta_user_service_reactivate_user_request.py +++ b/zitadel_client/models/beta_user_service_reactivate_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceReactivateUserRequest(BaseModel): """ BetaUserServiceReactivateUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceReactivateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceReactivateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceReactivateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceReactivateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_reactivate_user_response.py b/zitadel_client/models/beta_user_service_reactivate_user_response.py index 1161d382..e64fa960 100644 --- a/zitadel_client/models/beta_user_service_reactivate_user_response.py +++ b/zitadel_client/models/beta_user_service_reactivate_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceReactivateUserResponse(BaseModel): """ BetaUserServiceReactivateUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceReactivateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceReactivateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceReactivateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceReactivateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_redirect_urls.py b/zitadel_client/models/beta_user_service_redirect_urls.py index 243ed829..f9631499 100644 --- a/zitadel_client/models/beta_user_service_redirect_urls.py +++ b/zitadel_client/models/beta_user_service_redirect_urls.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRedirectURLs(BaseModel): """ BetaUserServiceRedirectURLs - """ # noqa: E501 + """ + success_url: Optional[StrictStr] = Field(default=None, alias="successUrl") failure_url: Optional[StrictStr] = Field(default=None, alias="failureUrl") - __properties: ClassVar[List[str]] = ["successUrl", "failureUrl"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceRedirectURLs(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRedirectURLs from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRedirectURLs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "successUrl": obj.get("successUrl"), - "failureUrl": obj.get("failureUrl") - }) - return _obj - - +BetaUserServiceRedirectURLs.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_passkey_request.py b/zitadel_client/models/beta_user_service_register_passkey_request.py index b1f40a30..8cf1937d 100644 --- a/zitadel_client/models/beta_user_service_register_passkey_request.py +++ b/zitadel_client/models/beta_user_service_register_passkey_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_passkey_authenticator import BetaUserServicePasskeyAuthenticator -from zitadel_client.models.beta_user_service_passkey_registration_code import BetaUserServicePasskeyRegistrationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRegisterPasskeyRequest(BaseModel): """ BetaUserServiceRegisterPasskeyRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - code: Optional[BetaUserServicePasskeyRegistrationCode] = None - authenticator: Optional[BetaUserServicePasskeyAuthenticator] = None - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "code", "authenticator", "domain"] + code: Optional[BetaUserServicePasskeyRegistrationCode] = Field( + default=None, alias="code" + ) + authenticator: Optional[BetaUserServicePasskeyAuthenticator] = Field( + default=None, alias="authenticator" + ) + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,58 +37,11 @@ class BetaUserServiceRegisterPasskeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterPasskeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of code - if self.code: - _dict['code'] = self.code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterPasskeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "code": BetaUserServicePasskeyRegistrationCode.from_dict(obj["code"]) if obj.get("code") is not None else None, - "authenticator": obj.get("authenticator"), - "domain": obj.get("domain") - }) - return _obj - +from zitadel_client.models.beta_user_service_passkey_authenticator import ( + BetaUserServicePasskeyAuthenticator, +) +from zitadel_client.models.beta_user_service_passkey_registration_code import ( + BetaUserServicePasskeyRegistrationCode, +) +BetaUserServiceRegisterPasskeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_passkey_response.py b/zitadel_client/models/beta_user_service_register_passkey_response.py index e5b76943..7e17af4f 100644 --- a/zitadel_client/models/beta_user_service_register_passkey_response.py +++ b/zitadel_client/models/beta_user_service_register_passkey_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceRegisterPasskeyResponse(BaseModel): """ BetaUserServiceRegisterPasskeyResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None + """ + + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") passkey_id: Optional[StrictStr] = Field(default=None, alias="passkeyId") - public_key_credential_creation_options: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredentialCreationOptions") - __properties: ClassVar[List[str]] = ["details", "passkeyId", "publicKeyCredentialCreationOptions"] + public_key_credential_creation_options: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredentialCreationOptions", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +36,6 @@ class BetaUserServiceRegisterPasskeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterPasskeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterPasskeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "passkeyId": obj.get("passkeyId"), - "publicKeyCredentialCreationOptions": obj.get("publicKeyCredentialCreationOptions") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRegisterPasskeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_totp_request.py b/zitadel_client/models/beta_user_service_register_totp_request.py index 78c24589..e7325b42 100644 --- a/zitadel_client/models/beta_user_service_register_totp_request.py +++ b/zitadel_client/models/beta_user_service_register_totp_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRegisterTOTPRequest(BaseModel): """ BetaUserServiceRegisterTOTPRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceRegisterTOTPRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterTOTPRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterTOTPRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceRegisterTOTPRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_totp_response.py b/zitadel_client/models/beta_user_service_register_totp_response.py index 9cac8119..d7898c4d 100644 --- a/zitadel_client/models/beta_user_service_register_totp_response.py +++ b/zitadel_client/models/beta_user_service_register_totp_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRegisterTOTPResponse(BaseModel): """ BetaUserServiceRegisterTOTPResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - uri: Optional[StrictStr] = None - secret: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["details", "uri", "secret"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + uri: Optional[StrictStr] = Field(default=None, alias="uri") + secret: Optional[StrictStr] = Field(default=None, alias="secret") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +32,6 @@ class BetaUserServiceRegisterTOTPResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterTOTPResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterTOTPResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "uri": obj.get("uri"), - "secret": obj.get("secret") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRegisterTOTPResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_u2_f_request.py b/zitadel_client/models/beta_user_service_register_u2_f_request.py index 37238bb8..ae7f9551 100644 --- a/zitadel_client/models/beta_user_service_register_u2_f_request.py +++ b/zitadel_client/models/beta_user_service_register_u2_f_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRegisterU2FRequest(BaseModel): """ BetaUserServiceRegisterU2FRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceRegisterU2FRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterU2FRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterU2FRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "domain": obj.get("domain") - }) - return _obj - - +BetaUserServiceRegisterU2FRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_register_u2_f_response.py b/zitadel_client/models/beta_user_service_register_u2_f_response.py index b2fa77f0..1501b75e 100644 --- a/zitadel_client/models/beta_user_service_register_u2_f_response.py +++ b/zitadel_client/models/beta_user_service_register_u2_f_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceRegisterU2FResponse(BaseModel): """ BetaUserServiceRegisterU2FResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None + """ + + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") u2f_id: Optional[StrictStr] = Field(default=None, alias="u2fId") - public_key_credential_creation_options: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredentialCreationOptions") - __properties: ClassVar[List[str]] = ["details", "u2fId", "publicKeyCredentialCreationOptions"] + public_key_credential_creation_options: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredentialCreationOptions", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +36,6 @@ class BetaUserServiceRegisterU2FResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterU2FResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRegisterU2FResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "u2fId": obj.get("u2fId"), - "publicKeyCredentialCreationOptions": obj.get("publicKeyCredentialCreationOptions") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRegisterU2FResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_otp_email_request.py b/zitadel_client/models/beta_user_service_remove_otp_email_request.py index 2d3205d3..6ce3b802 100644 --- a/zitadel_client/models/beta_user_service_remove_otp_email_request.py +++ b/zitadel_client/models/beta_user_service_remove_otp_email_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRemoveOTPEmailRequest(BaseModel): """ BetaUserServiceRemoveOTPEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceRemoveOTPEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceRemoveOTPEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_otp_email_response.py b/zitadel_client/models/beta_user_service_remove_otp_email_response.py index 2a19adc9..ab1f29c9 100644 --- a/zitadel_client/models/beta_user_service_remove_otp_email_response.py +++ b/zitadel_client/models/beta_user_service_remove_otp_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceRemoveOTPEmailResponse(BaseModel): """ BetaUserServiceRemoveOTPEmailResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceRemoveOTPEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRemoveOTPEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_otpsms_request.py b/zitadel_client/models/beta_user_service_remove_otpsms_request.py index 8a38ccfe..36e65c8c 100644 --- a/zitadel_client/models/beta_user_service_remove_otpsms_request.py +++ b/zitadel_client/models/beta_user_service_remove_otpsms_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRemoveOTPSMSRequest(BaseModel): """ BetaUserServiceRemoveOTPSMSRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceRemoveOTPSMSRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPSMSRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPSMSRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceRemoveOTPSMSRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_otpsms_response.py b/zitadel_client/models/beta_user_service_remove_otpsms_response.py index c0da6f9b..71c6c155 100644 --- a/zitadel_client/models/beta_user_service_remove_otpsms_response.py +++ b/zitadel_client/models/beta_user_service_remove_otpsms_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceRemoveOTPSMSResponse(BaseModel): """ BetaUserServiceRemoveOTPSMSResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceRemoveOTPSMSResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPSMSResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveOTPSMSResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRemoveOTPSMSResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_phone_request.py b/zitadel_client/models/beta_user_service_remove_phone_request.py index b8c59312..14427b21 100644 --- a/zitadel_client/models/beta_user_service_remove_phone_request.py +++ b/zitadel_client/models/beta_user_service_remove_phone_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRemovePhoneRequest(BaseModel): """ BetaUserServiceRemovePhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceRemovePhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemovePhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemovePhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceRemovePhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_phone_response.py b/zitadel_client/models/beta_user_service_remove_phone_response.py index 772ae8d1..e023ddc6 100644 --- a/zitadel_client/models/beta_user_service_remove_phone_response.py +++ b/zitadel_client/models/beta_user_service_remove_phone_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceRemovePhoneResponse(BaseModel): """ BetaUserServiceRemovePhoneResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceRemovePhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemovePhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemovePhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRemovePhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_totp_request.py b/zitadel_client/models/beta_user_service_remove_totp_request.py index 1bf6ee9d..61550560 100644 --- a/zitadel_client/models/beta_user_service_remove_totp_request.py +++ b/zitadel_client/models/beta_user_service_remove_totp_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRemoveTOTPRequest(BaseModel): """ BetaUserServiceRemoveTOTPRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceRemoveTOTPRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveTOTPRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveTOTPRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceRemoveTOTPRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_remove_totp_response.py b/zitadel_client/models/beta_user_service_remove_totp_response.py index 704396a9..d4a5c2ca 100644 --- a/zitadel_client/models/beta_user_service_remove_totp_response.py +++ b/zitadel_client/models/beta_user_service_remove_totp_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceRemoveTOTPResponse(BaseModel): """ BetaUserServiceRemoveTOTPResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceRemoveTOTPResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveTOTPResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRemoveTOTPResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceRemoveTOTPResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_resend_email_code_request.py b/zitadel_client/models/beta_user_service_resend_email_code_request.py index 083d17b5..06595103 100644 --- a/zitadel_client/models/beta_user_service_resend_email_code_request.py +++ b/zitadel_client/models/beta_user_service_resend_email_code_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_send_email_verification_code import BetaUserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceResendEmailCodeRequest(BaseModel): """ BetaUserServiceResendEmailCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class BetaUserServiceResendEmailCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceResendEmailCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceResendEmailCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": BetaUserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_send_email_verification_code import ( + BetaUserServiceSendEmailVerificationCode, +) +BetaUserServiceResendEmailCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_resend_email_code_response.py b/zitadel_client/models/beta_user_service_resend_email_code_response.py index 69be68b6..d712a489 100644 --- a/zitadel_client/models/beta_user_service_resend_email_code_response.py +++ b/zitadel_client/models/beta_user_service_resend_email_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceResendEmailCodeResponse(BaseModel): """ BetaUserServiceResendEmailCodeResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class BetaUserServiceResendEmailCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceResendEmailCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceResendEmailCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceResendEmailCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_resend_phone_code_request.py b/zitadel_client/models/beta_user_service_resend_phone_code_request.py index 32539664..ac7ae516 100644 --- a/zitadel_client/models/beta_user_service_resend_phone_code_request.py +++ b/zitadel_client/models/beta_user_service_resend_phone_code_request.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceResendPhoneCodeRequest(BaseModel): """ BetaUserServiceResendPhoneCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class BetaUserServiceResendPhoneCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceResendPhoneCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceResendPhoneCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +BetaUserServiceResendPhoneCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_resend_phone_code_response.py b/zitadel_client/models/beta_user_service_resend_phone_code_response.py index 595e2017..f3211720 100644 --- a/zitadel_client/models/beta_user_service_resend_phone_code_response.py +++ b/zitadel_client/models/beta_user_service_resend_phone_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceResendPhoneCodeResponse(BaseModel): """ BetaUserServiceResendPhoneCodeResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class BetaUserServiceResendPhoneCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceResendPhoneCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceResendPhoneCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceResendPhoneCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_request.py b/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_request.py index 4dfe9bcf..a1553a65 100644 --- a/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_request.py +++ b/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRetrieveIdentityProviderIntentRequest(BaseModel): """ BetaUserServiceRetrieveIdentityProviderIntentRequest - """ # noqa: E501 + """ + idp_intent_id: Optional[StrictStr] = Field(default=None, alias="idpIntentId") idp_intent_token: Optional[StrictStr] = Field(default=None, alias="idpIntentToken") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceRetrieveIdentityProviderIntentRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRetrieveIdentityProviderIntentRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRetrieveIdentityProviderIntentRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken") - }) - return _obj - - +BetaUserServiceRetrieveIdentityProviderIntentRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_response.py b/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_response.py index 2d302629..c9fa7dd8 100644 --- a/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_response.py +++ b/zitadel_client/models/beta_user_service_retrieve_identity_provider_intent_response.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_idp_information import BetaUserServiceIDPInformation -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceRetrieveIdentityProviderIntentResponse(BaseModel): """ BetaUserServiceRetrieveIdentityProviderIntentResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - idp_information: Optional[BetaUserServiceIDPInformation] = Field(default=None, alias="idpInformation") + """ + + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + idp_information: Optional[BetaUserServiceIDPInformation] = Field( + default=None, alias="idpInformation" + ) user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["details", "idpInformation", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +34,9 @@ class BetaUserServiceRetrieveIdentityProviderIntentResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceRetrieveIdentityProviderIntentResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_information - if self.idp_information: - _dict['idpInformation'] = self.idp_information.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceRetrieveIdentityProviderIntentResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "idpInformation": BetaUserServiceIDPInformation.from_dict(obj["idpInformation"]) if obj.get("idpInformation") is not None else None, - "userId": obj.get("userId") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +from zitadel_client.models.beta_user_service_idp_information import ( + BetaUserServiceIDPInformation, +) +BetaUserServiceRetrieveIdentityProviderIntentResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_search_query.py b/zitadel_client/models/beta_user_service_search_query.py index 21cac2e5..ae82f8d9 100644 --- a/zitadel_client/models/beta_user_service_search_query.py +++ b/zitadel_client/models/beta_user_service_search_query.py @@ -1,62 +1,68 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_display_name_query import BetaUserServiceDisplayNameQuery -from zitadel_client.models.beta_user_service_email_query import BetaUserServiceEmailQuery -from zitadel_client.models.beta_user_service_first_name_query import BetaUserServiceFirstNameQuery -from zitadel_client.models.beta_user_service_in_user_emails_query import BetaUserServiceInUserEmailsQuery -from zitadel_client.models.beta_user_service_in_user_id_query import BetaUserServiceInUserIDQuery -from zitadel_client.models.beta_user_service_last_name_query import BetaUserServiceLastNameQuery -from zitadel_client.models.beta_user_service_login_name_query import BetaUserServiceLoginNameQuery -from zitadel_client.models.beta_user_service_nick_name_query import BetaUserServiceNickNameQuery -from zitadel_client.models.beta_user_service_organization_id_query import BetaUserServiceOrganizationIdQuery -from zitadel_client.models.beta_user_service_phone_query import BetaUserServicePhoneQuery -from zitadel_client.models.beta_user_service_state_query import BetaUserServiceStateQuery -from zitadel_client.models.beta_user_service_type_query import BetaUserServiceTypeQuery -from zitadel_client.models.beta_user_service_user_name_query import BetaUserServiceUserNameQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaUserServiceSearchQuery(BaseModel): """ BetaUserServiceSearchQuery - """ # noqa: E501 + """ + and_query: Optional[BetaUserServiceAndQuery] = Field(default=None, alias="andQuery") - display_name_query: Optional[BetaUserServiceDisplayNameQuery] = Field(default=None, alias="displayNameQuery") - email_query: Optional[BetaUserServiceEmailQuery] = Field(default=None, alias="emailQuery") - first_name_query: Optional[BetaUserServiceFirstNameQuery] = Field(default=None, alias="firstNameQuery") - in_user_emails_query: Optional[BetaUserServiceInUserEmailsQuery] = Field(default=None, alias="inUserEmailsQuery") - in_user_ids_query: Optional[BetaUserServiceInUserIDQuery] = Field(default=None, alias="inUserIdsQuery") - last_name_query: Optional[BetaUserServiceLastNameQuery] = Field(default=None, alias="lastNameQuery") - login_name_query: Optional[BetaUserServiceLoginNameQuery] = Field(default=None, alias="loginNameQuery") - nick_name_query: Optional[BetaUserServiceNickNameQuery] = Field(default=None, alias="nickNameQuery") + display_name_query: Optional[BetaUserServiceDisplayNameQuery] = Field( + default=None, alias="displayNameQuery" + ) + email_query: Optional[BetaUserServiceEmailQuery] = Field( + default=None, alias="emailQuery" + ) + first_name_query: Optional[BetaUserServiceFirstNameQuery] = Field( + default=None, alias="firstNameQuery" + ) + in_user_emails_query: Optional[BetaUserServiceInUserEmailsQuery] = Field( + default=None, alias="inUserEmailsQuery" + ) + in_user_ids_query: Optional[BetaUserServiceInUserIDQuery] = Field( + default=None, alias="inUserIdsQuery" + ) + last_name_query: Optional[BetaUserServiceLastNameQuery] = Field( + default=None, alias="lastNameQuery" + ) + login_name_query: Optional[BetaUserServiceLoginNameQuery] = Field( + default=None, alias="loginNameQuery" + ) + nick_name_query: Optional[BetaUserServiceNickNameQuery] = Field( + default=None, alias="nickNameQuery" + ) not_query: Optional[BetaUserServiceNotQuery] = Field(default=None, alias="notQuery") or_query: Optional[BetaUserServiceOrQuery] = Field(default=None, alias="orQuery") - organization_id_query: Optional[BetaUserServiceOrganizationIdQuery] = Field(default=None, alias="organizationIdQuery") - phone_query: Optional[BetaUserServicePhoneQuery] = Field(default=None, alias="phoneQuery") - state_query: Optional[BetaUserServiceStateQuery] = Field(default=None, alias="stateQuery") - type_query: Optional[BetaUserServiceTypeQuery] = Field(default=None, alias="typeQuery") - user_name_query: Optional[BetaUserServiceUserNameQuery] = Field(default=None, alias="userNameQuery") - __properties: ClassVar[List[str]] = ["andQuery", "displayNameQuery", "emailQuery", "firstNameQuery", "inUserEmailsQuery", "inUserIdsQuery", "lastNameQuery", "loginNameQuery", "nickNameQuery", "notQuery", "orQuery", "organizationIdQuery", "phoneQuery", "stateQuery", "typeQuery", "userNameQuery"] + organization_id_query: Optional[BetaUserServiceOrganizationIdQuery] = Field( + default=None, alias="organizationIdQuery" + ) + phone_query: Optional[BetaUserServicePhoneQuery] = Field( + default=None, alias="phoneQuery" + ) + state_query: Optional[BetaUserServiceStateQuery] = Field( + default=None, alias="stateQuery" + ) + type_query: Optional[BetaUserServiceTypeQuery] = Field( + default=None, alias="typeQuery" + ) + user_name_query: Optional[BetaUserServiceUserNameQuery] = Field( + default=None, alias="userNameQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -64,120 +70,45 @@ class BetaUserServiceSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of and_query - if self.and_query: - _dict['andQuery'] = self.and_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of display_name_query - if self.display_name_query: - _dict['displayNameQuery'] = self.display_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of email_query - if self.email_query: - _dict['emailQuery'] = self.email_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of first_name_query - if self.first_name_query: - _dict['firstNameQuery'] = self.first_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_emails_query - if self.in_user_emails_query: - _dict['inUserEmailsQuery'] = self.in_user_emails_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids_query - if self.in_user_ids_query: - _dict['inUserIdsQuery'] = self.in_user_ids_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of last_name_query - if self.last_name_query: - _dict['lastNameQuery'] = self.last_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_name_query - if self.login_name_query: - _dict['loginNameQuery'] = self.login_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of nick_name_query - if self.nick_name_query: - _dict['nickNameQuery'] = self.nick_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of not_query - if self.not_query: - _dict['notQuery'] = self.not_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of or_query - if self.or_query: - _dict['orQuery'] = self.or_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_query - if self.organization_id_query: - _dict['organizationIdQuery'] = self.organization_id_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone_query - if self.phone_query: - _dict['phoneQuery'] = self.phone_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of state_query - if self.state_query: - _dict['stateQuery'] = self.state_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of type_query - if self.type_query: - _dict['typeQuery'] = self.type_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_name_query - if self.user_name_query: - _dict['userNameQuery'] = self.user_name_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "andQuery": BetaUserServiceAndQuery.from_dict(obj["andQuery"]) if obj.get("andQuery") is not None else None, - "displayNameQuery": BetaUserServiceDisplayNameQuery.from_dict(obj["displayNameQuery"]) if obj.get("displayNameQuery") is not None else None, - "emailQuery": BetaUserServiceEmailQuery.from_dict(obj["emailQuery"]) if obj.get("emailQuery") is not None else None, - "firstNameQuery": BetaUserServiceFirstNameQuery.from_dict(obj["firstNameQuery"]) if obj.get("firstNameQuery") is not None else None, - "inUserEmailsQuery": BetaUserServiceInUserEmailsQuery.from_dict(obj["inUserEmailsQuery"]) if obj.get("inUserEmailsQuery") is not None else None, - "inUserIdsQuery": BetaUserServiceInUserIDQuery.from_dict(obj["inUserIdsQuery"]) if obj.get("inUserIdsQuery") is not None else None, - "lastNameQuery": BetaUserServiceLastNameQuery.from_dict(obj["lastNameQuery"]) if obj.get("lastNameQuery") is not None else None, - "loginNameQuery": BetaUserServiceLoginNameQuery.from_dict(obj["loginNameQuery"]) if obj.get("loginNameQuery") is not None else None, - "nickNameQuery": BetaUserServiceNickNameQuery.from_dict(obj["nickNameQuery"]) if obj.get("nickNameQuery") is not None else None, - "notQuery": BetaUserServiceNotQuery.from_dict(obj["notQuery"]) if obj.get("notQuery") is not None else None, - "orQuery": BetaUserServiceOrQuery.from_dict(obj["orQuery"]) if obj.get("orQuery") is not None else None, - "organizationIdQuery": BetaUserServiceOrganizationIdQuery.from_dict(obj["organizationIdQuery"]) if obj.get("organizationIdQuery") is not None else None, - "phoneQuery": BetaUserServicePhoneQuery.from_dict(obj["phoneQuery"]) if obj.get("phoneQuery") is not None else None, - "stateQuery": BetaUserServiceStateQuery.from_dict(obj["stateQuery"]) if obj.get("stateQuery") is not None else None, - "typeQuery": BetaUserServiceTypeQuery.from_dict(obj["typeQuery"]) if obj.get("typeQuery") is not None else None, - "userNameQuery": BetaUserServiceUserNameQuery.from_dict(obj["userNameQuery"]) if obj.get("userNameQuery") is not None else None - }) - return _obj - from zitadel_client.models.beta_user_service_and_query import BetaUserServiceAndQuery +from zitadel_client.models.beta_user_service_display_name_query import ( + BetaUserServiceDisplayNameQuery, +) +from zitadel_client.models.beta_user_service_email_query import ( + BetaUserServiceEmailQuery, +) +from zitadel_client.models.beta_user_service_first_name_query import ( + BetaUserServiceFirstNameQuery, +) +from zitadel_client.models.beta_user_service_in_user_emails_query import ( + BetaUserServiceInUserEmailsQuery, +) +from zitadel_client.models.beta_user_service_in_user_id_query import ( + BetaUserServiceInUserIDQuery, +) +from zitadel_client.models.beta_user_service_last_name_query import ( + BetaUserServiceLastNameQuery, +) +from zitadel_client.models.beta_user_service_login_name_query import ( + BetaUserServiceLoginNameQuery, +) +from zitadel_client.models.beta_user_service_nick_name_query import ( + BetaUserServiceNickNameQuery, +) from zitadel_client.models.beta_user_service_not_query import BetaUserServiceNotQuery from zitadel_client.models.beta_user_service_or_query import BetaUserServiceOrQuery -# TODO: Rewrite to not use raise_errors -BetaUserServiceSearchQuery.model_rebuild(raise_errors=False) +from zitadel_client.models.beta_user_service_organization_id_query import ( + BetaUserServiceOrganizationIdQuery, +) +from zitadel_client.models.beta_user_service_phone_query import ( + BetaUserServicePhoneQuery, +) +from zitadel_client.models.beta_user_service_state_query import ( + BetaUserServiceStateQuery, +) +from zitadel_client.models.beta_user_service_type_query import BetaUserServiceTypeQuery +from zitadel_client.models.beta_user_service_user_name_query import ( + BetaUserServiceUserNameQuery, +) +BetaUserServiceSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_send_email_verification_code.py b/zitadel_client/models/beta_user_service_send_email_verification_code.py index 3b652b3b..97f3e0b9 100644 --- a/zitadel_client/models/beta_user_service_send_email_verification_code.py +++ b/zitadel_client/models/beta_user_service_send_email_verification_code.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSendEmailVerificationCode(BaseModel): """ BetaUserServiceSendEmailVerificationCode - """ # noqa: E501 + """ + url_template: Optional[StrictStr] = Field(default=None, alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +30,4 @@ class BetaUserServiceSendEmailVerificationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSendEmailVerificationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSendEmailVerificationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +BetaUserServiceSendEmailVerificationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_send_passkey_registration_link.py b/zitadel_client/models/beta_user_service_send_passkey_registration_link.py index 4257e20e..e69d10d2 100644 --- a/zitadel_client/models/beta_user_service_send_passkey_registration_link.py +++ b/zitadel_client/models/beta_user_service_send_passkey_registration_link.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSendPasskeyRegistrationLink(BaseModel): """ BetaUserServiceSendPasskeyRegistrationLink - """ # noqa: E501 + """ + url_template: Optional[StrictStr] = Field(default=None, alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +30,4 @@ class BetaUserServiceSendPasskeyRegistrationLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSendPasskeyRegistrationLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSendPasskeyRegistrationLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +BetaUserServiceSendPasskeyRegistrationLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_send_password_reset_link.py b/zitadel_client/models/beta_user_service_send_password_reset_link.py index 9363fe93..b70387de 100644 --- a/zitadel_client/models/beta_user_service_send_password_reset_link.py +++ b/zitadel_client/models/beta_user_service_send_password_reset_link.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_notification_type import BetaUserServiceNotificationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSendPasswordResetLink(BaseModel): """ BetaUserServiceSendPasswordResetLink - """ # noqa: E501 - notification_type: Optional[BetaUserServiceNotificationType] = Field(default=None, alias="notificationType") + """ + + notification_type: Optional[BetaUserServiceNotificationType] = Field( + default=None, alias="notificationType" + ) url_template: Optional[StrictStr] = Field(default=None, alias="urlTemplate") - __properties: ClassVar[List[str]] = ["notificationType", "urlTemplate"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,58 +33,8 @@ class BetaUserServiceSendPasswordResetLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSendPasswordResetLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSendPasswordResetLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "notificationType": obj.get("notificationType"), - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - +from zitadel_client.models.beta_user_service_notification_type import ( + BetaUserServiceNotificationType, +) +BetaUserServiceSendPasswordResetLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_email_request.py b/zitadel_client/models/beta_user_service_set_email_request.py index ca9d548c..851fa719 100644 --- a/zitadel_client/models/beta_user_service_set_email_request.py +++ b/zitadel_client/models/beta_user_service_set_email_request.py @@ -1,39 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_send_email_verification_code import BetaUserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceSetEmailRequest(BaseModel): """ BetaUserServiceSetEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - email: Optional[StrictStr] = None + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,59 +36,8 @@ class BetaUserServiceSetEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": BetaUserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_send_email_verification_code import ( + BetaUserServiceSendEmailVerificationCode, +) +BetaUserServiceSetEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_email_response.py b/zitadel_client/models/beta_user_service_set_email_response.py index 0d602835..47eb2c66 100644 --- a/zitadel_client/models/beta_user_service_set_email_response.py +++ b/zitadel_client/models/beta_user_service_set_email_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetEmailResponse(BaseModel): """ BetaUserServiceSetEmailResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class BetaUserServiceSetEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceSetEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_human_email.py b/zitadel_client/models/beta_user_service_set_human_email.py index 670646ce..529606e6 100644 --- a/zitadel_client/models/beta_user_service_set_human_email.py +++ b/zitadel_client/models/beta_user_service_set_human_email.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_send_email_verification_code import BetaUserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceSetHumanEmail(BaseModel): """ BetaUserServiceSetHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[BetaUserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +35,8 @@ class BetaUserServiceSetHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": BetaUserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_send_email_verification_code import ( + BetaUserServiceSendEmailVerificationCode, +) +BetaUserServiceSetHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_human_phone.py b/zitadel_client/models/beta_user_service_set_human_phone.py index 276525f6..a0d0624b 100644 --- a/zitadel_client/models/beta_user_service_set_human_phone.py +++ b/zitadel_client/models/beta_user_service_set_human_phone.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceSetHumanPhone(BaseModel): """ BetaUserServiceSetHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class BetaUserServiceSetHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +BetaUserServiceSetHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_human_profile.py b/zitadel_client/models/beta_user_service_set_human_profile.py index c50c885b..87a4f1a4 100644 --- a/zitadel_client/models/beta_user_service_set_human_profile.py +++ b/zitadel_client/models/beta_user_service_set_human_profile.py @@ -1,40 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_gender import BetaUserServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetHumanProfile(BaseModel): """ BetaUserServiceSetHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[BetaUserServiceGender] = None - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender"] + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[BetaUserServiceGender] = Field(default=None, alias="gender") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,72 +37,6 @@ class BetaUserServiceSetHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender") - }) - return _obj - +from zitadel_client.models.beta_user_service_gender import BetaUserServiceGender +BetaUserServiceSetHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_metadata_entry.py b/zitadel_client/models/beta_user_service_set_metadata_entry.py index 7be5bcfd..8fb2b8ac 100644 --- a/zitadel_client/models/beta_user_service_set_metadata_entry.py +++ b/zitadel_client/models/beta_user_service_set_metadata_entry.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetMetadataEntry(BaseModel): """ BetaUserServiceSetMetadataEntry - """ # noqa: E501 - key: Optional[StrictStr] = None - value: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["key", "value"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + value: Optional[Base64Bytes] = Field(default=None, alias="value") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,6 @@ class BetaUserServiceSetMetadataEntry(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetMetadataEntry from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetMetadataEntry from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +BetaUserServiceSetMetadataEntry.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_password.py b/zitadel_client/models/beta_user_service_set_password.py index dcf4578c..e3819f67 100644 --- a/zitadel_client/models/beta_user_service_set_password.py +++ b/zitadel_client/models/beta_user_service_set_password.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_hashed_password import BetaUserServiceHashedPassword -from zitadel_client.models.beta_user_service_password import BetaUserServicePassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetPassword(BaseModel): """ BetaUserServiceSetPassword - """ # noqa: E501 - hashed_password: Optional[BetaUserServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[BetaUserServicePassword] = None + """ + + hashed_password: Optional[BetaUserServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[BetaUserServicePassword] = Field(default=None, alias="password") current_password: Optional[StrictStr] = Field(default=None, alias="currentPassword") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["hashedPassword", "password", "currentPassword", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,61 +37,9 @@ class BetaUserServiceSetPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hashedPassword": BetaUserServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": BetaUserServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None, - "currentPassword": obj.get("currentPassword"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_hashed_password import ( + BetaUserServiceHashedPassword, +) +from zitadel_client.models.beta_user_service_password import BetaUserServicePassword +BetaUserServiceSetPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_password_request.py b/zitadel_client/models/beta_user_service_set_password_request.py index d6013f8c..14ae8251 100644 --- a/zitadel_client/models/beta_user_service_set_password_request.py +++ b/zitadel_client/models/beta_user_service_set_password_request.py @@ -1,38 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_password import BetaUserServicePassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetPasswordRequest(BaseModel): """ BetaUserServiceSetPasswordRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - new_password: Optional[BetaUserServicePassword] = Field(default=None, alias="newPassword") + new_password: Optional[BetaUserServicePassword] = Field( + default=None, alias="newPassword" + ) current_password: Optional[StrictStr] = Field(default=None, alias="currentPassword") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "newPassword", "currentPassword", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +37,6 @@ class BetaUserServiceSetPasswordRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPasswordRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of new_password - if self.new_password: - _dict['newPassword'] = self.new_password.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPasswordRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "newPassword": BetaUserServicePassword.from_dict(obj["newPassword"]) if obj.get("newPassword") is not None else None, - "currentPassword": obj.get("currentPassword"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_password import BetaUserServicePassword +BetaUserServiceSetPasswordRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_password_response.py b/zitadel_client/models/beta_user_service_set_password_response.py index f3735507..d3b5c4df 100644 --- a/zitadel_client/models/beta_user_service_set_password_response.py +++ b/zitadel_client/models/beta_user_service_set_password_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceSetPasswordResponse(BaseModel): """ BetaUserServiceSetPasswordResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceSetPasswordResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPasswordResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPasswordResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceSetPasswordResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_phone_request.py b/zitadel_client/models/beta_user_service_set_phone_request.py index 6b472ac4..534b6063 100644 --- a/zitadel_client/models/beta_user_service_set_phone_request.py +++ b/zitadel_client/models/beta_user_service_set_phone_request.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class BetaUserServiceSetPhoneRequest(BaseModel): """ BetaUserServiceSetPhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - phone: Optional[StrictStr] = None + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +34,4 @@ class BetaUserServiceSetPhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +BetaUserServiceSetPhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_set_phone_response.py b/zitadel_client/models/beta_user_service_set_phone_response.py index 0f233cbb..cbf3d371 100644 --- a/zitadel_client/models/beta_user_service_set_phone_response.py +++ b/zitadel_client/models/beta_user_service_set_phone_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceSetPhoneResponse(BaseModel): """ BetaUserServiceSetPhoneResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class BetaUserServiceSetPhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceSetPhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceSetPhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_start_identity_provider_intent_request.py b/zitadel_client/models/beta_user_service_start_identity_provider_intent_request.py index f2f5d291..85cc4d81 100644 --- a/zitadel_client/models/beta_user_service_start_identity_provider_intent_request.py +++ b/zitadel_client/models/beta_user_service_start_identity_provider_intent_request.py @@ -1,38 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_ldap_credentials import BetaUserServiceLDAPCredentials -from zitadel_client.models.beta_user_service_redirect_urls import BetaUserServiceRedirectURLs -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceStartIdentityProviderIntentRequest(BaseModel): """ BetaUserServiceStartIdentityProviderIntentRequest - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") - ldap: Optional[BetaUserServiceLDAPCredentials] = None - urls: Optional[BetaUserServiceRedirectURLs] = None - __properties: ClassVar[List[str]] = ["idpId", "ldap", "urls"] + ldap: Optional[BetaUserServiceLDAPCredentials] = Field(default=None, alias="ldap") + urls: Optional[BetaUserServiceRedirectURLs] = Field(default=None, alias="urls") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +32,11 @@ class BetaUserServiceStartIdentityProviderIntentRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceStartIdentityProviderIntentRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ldap - if self.ldap: - _dict['ldap'] = self.ldap.to_dict() - # override the default output from pydantic by calling `to_dict()` of urls - if self.urls: - _dict['urls'] = self.urls.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceStartIdentityProviderIntentRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "ldap": BetaUserServiceLDAPCredentials.from_dict(obj["ldap"]) if obj.get("ldap") is not None else None, - "urls": BetaUserServiceRedirectURLs.from_dict(obj["urls"]) if obj.get("urls") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_ldap_credentials import ( + BetaUserServiceLDAPCredentials, +) +from zitadel_client.models.beta_user_service_redirect_urls import ( + BetaUserServiceRedirectURLs, +) +BetaUserServiceStartIdentityProviderIntentRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_start_identity_provider_intent_response.py b/zitadel_client/models/beta_user_service_start_identity_provider_intent_response.py index b1815e77..79670ff1 100644 --- a/zitadel_client/models/beta_user_service_start_identity_provider_intent_response.py +++ b/zitadel_client/models/beta_user_service_start_identity_provider_intent_response.py @@ -1,41 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_form_data import BetaUserServiceFormData -from zitadel_client.models.beta_user_service_idp_intent import BetaUserServiceIDPIntent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceStartIdentityProviderIntentResponse(BaseModel): """ BetaUserServiceStartIdentityProviderIntentResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - auth_url: Optional[StrictStr] = Field(default=None, description="URL to which the client should redirect", alias="authUrl") + """ + + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + auth_url: Optional[StrictStr] = Field( + default=None, + alias="authUrl", + description="URL to which the client should redirect", + ) form_data: Optional[BetaUserServiceFormData] = Field(default=None, alias="formData") - idp_intent: Optional[BetaUserServiceIDPIntent] = Field(default=None, alias="idpIntent") - post_form: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="POST call information Deprecated: Use form_data instead", alias="postForm") - __properties: ClassVar[List[str]] = ["details", "authUrl", "formData", "idpIntent", "postForm"] + idp_intent: Optional[BetaUserServiceIDPIntent] = Field( + default=None, alias="idpIntent" + ) + post_form: Optional[Base64Bytes] = Field( + default=None, + alias="postForm", + description="POST call information Deprecated: Use form_data instead", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,65 +44,9 @@ class BetaUserServiceStartIdentityProviderIntentResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceStartIdentityProviderIntentResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of form_data - if self.form_data: - _dict['formData'] = self.form_data.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_intent - if self.idp_intent: - _dict['idpIntent'] = self.idp_intent.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceStartIdentityProviderIntentResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "authUrl": obj.get("authUrl"), - "formData": BetaUserServiceFormData.from_dict(obj["formData"]) if obj.get("formData") is not None else None, - "idpIntent": BetaUserServiceIDPIntent.from_dict(obj["idpIntent"]) if obj.get("idpIntent") is not None else None, - "postForm": obj.get("postForm") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +from zitadel_client.models.beta_user_service_form_data import BetaUserServiceFormData +from zitadel_client.models.beta_user_service_idp_intent import BetaUserServiceIDPIntent +BetaUserServiceStartIdentityProviderIntentResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_state_query.py b/zitadel_client/models/beta_user_service_state_query.py index 5ac20567..a764c596 100644 --- a/zitadel_client/models/beta_user_service_state_query.py +++ b/zitadel_client/models/beta_user_service_state_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceStateQuery(BaseModel): """ Query for users with a specific state. - """ # noqa: E501 - state: Optional[BetaUserServiceUserState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[BetaUserServiceUserState] = Field(default=None, alias="state") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class BetaUserServiceStateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceStateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceStateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState +BetaUserServiceStateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_text_query_method.py b/zitadel_client/models/beta_user_service_text_query_method.py index b8800590..85f6ecda 100644 --- a/zitadel_client/models/beta_user_service_text_query_method.py +++ b/zitadel_client/models/beta_user_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class BetaUserServiceTextQueryMethod(str, Enum): BetaUserServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/beta_user_service_type.py b/zitadel_client/models/beta_user_service_type.py index 6e9da096..d2085cd4 100644 --- a/zitadel_client/models/beta_user_service_type.py +++ b/zitadel_client/models/beta_user_service_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceType(str, Enum): @@ -23,16 +13,6 @@ class BetaUserServiceType(str, Enum): BetaUserServiceType """ - """ - allowed enum values - """ - TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' - TYPE_HUMAN = 'TYPE_HUMAN' - TYPE_MACHINE = 'TYPE_MACHINE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceType from a JSON string""" - return cls(json.loads(json_str)) - - + TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED" + TYPE_HUMAN = "TYPE_HUMAN" + TYPE_MACHINE = "TYPE_MACHINE" diff --git a/zitadel_client/models/beta_user_service_type_query.py b/zitadel_client/models/beta_user_service_type_query.py index e2633550..29d3466c 100644 --- a/zitadel_client/models/beta_user_service_type_query.py +++ b/zitadel_client/models/beta_user_service_type_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_type import BetaUserServiceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceTypeQuery(BaseModel): """ Query for users with a specific type. - """ # noqa: E501 - type: Optional[BetaUserServiceType] = None - __properties: ClassVar[List[str]] = ["type"] + """ + type: Optional[BetaUserServiceType] = Field(default=None, alias="type") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class BetaUserServiceTypeQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceTypeQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceTypeQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.beta_user_service_type import BetaUserServiceType +BetaUserServiceTypeQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_unlock_user_request.py b/zitadel_client/models/beta_user_service_unlock_user_request.py index 6f034d4f..0bb20cfa 100644 --- a/zitadel_client/models/beta_user_service_unlock_user_request.py +++ b/zitadel_client/models/beta_user_service_unlock_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceUnlockUserRequest(BaseModel): """ BetaUserServiceUnlockUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaUserServiceUnlockUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUnlockUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUnlockUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +BetaUserServiceUnlockUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_unlock_user_response.py b/zitadel_client/models/beta_user_service_unlock_user_response.py index f6e893ce..9bf5710a 100644 --- a/zitadel_client/models/beta_user_service_unlock_user_response.py +++ b/zitadel_client/models/beta_user_service_unlock_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceUnlockUserResponse(BaseModel): """ BetaUserServiceUnlockUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceUnlockUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUnlockUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUnlockUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceUnlockUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_update_human_user_request.py b/zitadel_client/models/beta_user_service_update_human_user_request.py index c368fbf0..7cbe10b7 100644 --- a/zitadel_client/models/beta_user_service_update_human_user_request.py +++ b/zitadel_client/models/beta_user_service_update_human_user_request.py @@ -1,43 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_set_human_email import BetaUserServiceSetHumanEmail -from zitadel_client.models.beta_user_service_set_human_phone import BetaUserServiceSetHumanPhone -from zitadel_client.models.beta_user_service_set_human_profile import BetaUserServiceSetHumanProfile -from zitadel_client.models.beta_user_service_set_password import BetaUserServiceSetPassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceUpdateHumanUserRequest(BaseModel): """ BetaUserServiceUpdateHumanUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - username: Optional[StrictStr] = None - profile: Optional[BetaUserServiceSetHumanProfile] = None - email: Optional[BetaUserServiceSetHumanEmail] = None - phone: Optional[BetaUserServiceSetHumanPhone] = None - password: Optional[BetaUserServiceSetPassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "profile", "email", "phone", "password"] + username: Optional[StrictStr] = Field(default=None, alias="username") + profile: Optional[BetaUserServiceSetHumanProfile] = Field( + default=None, alias="profile" + ) + email: Optional[BetaUserServiceSetHumanEmail] = Field(default=None, alias="email") + phone: Optional[BetaUserServiceSetHumanPhone] = Field(default=None, alias="phone") + password: Optional[BetaUserServiceSetPassword] = Field( + default=None, alias="password" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,74 +39,17 @@ class BetaUserServiceUpdateHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUpdateHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUpdateHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "profile": BetaUserServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": BetaUserServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": BetaUserServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "password": BetaUserServiceSetPassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - - +from zitadel_client.models.beta_user_service_set_human_email import ( + BetaUserServiceSetHumanEmail, +) +from zitadel_client.models.beta_user_service_set_human_phone import ( + BetaUserServiceSetHumanPhone, +) +from zitadel_client.models.beta_user_service_set_human_profile import ( + BetaUserServiceSetHumanProfile, +) +from zitadel_client.models.beta_user_service_set_password import ( + BetaUserServiceSetPassword, +) + +BetaUserServiceUpdateHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_update_human_user_response.py b/zitadel_client/models/beta_user_service_update_human_user_response.py index 0f330ab8..662be739 100644 --- a/zitadel_client/models/beta_user_service_update_human_user_response.py +++ b/zitadel_client/models/beta_user_service_update_human_user_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceUpdateHumanUserResponse(BaseModel): """ BetaUserServiceUpdateHumanUserResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None + """ + + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["details", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,67 +32,6 @@ class BetaUserServiceUpdateHumanUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUpdateHumanUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUpdateHumanUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceUpdateHumanUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_user.py b/zitadel_client/models/beta_user_service_user.py index 32ed13e9..96b62280 100644 --- a/zitadel_client/models/beta_user_service_user.py +++ b/zitadel_client/models/beta_user_service_user.py @@ -1,45 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from zitadel_client.models.beta_user_service_human_user import BetaUserServiceHumanUser -from zitadel_client.models.beta_user_service_machine_user import BetaUserServiceMachineUser -from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class BetaUserServiceUser(BaseModel): """ BetaUserServiceUser - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - details: Optional[BetaUserServiceDetails] = None - state: Optional[BetaUserServiceUserState] = None - username: Optional[StrictStr] = None + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + state: Optional[BetaUserServiceUserState] = Field(default=None, alias="state") + username: Optional[StrictStr] = Field(default=None, alias="username") login_names: Optional[List[StrictStr]] = Field(default=None, alias="loginNames") - preferred_login_name: Optional[StrictStr] = Field(default=None, alias="preferredLoginName") - human: Optional[BetaUserServiceHumanUser] = None - machine: Optional[BetaUserServiceMachineUser] = None - __properties: ClassVar[List[str]] = ["userId", "details", "state", "username", "loginNames", "preferredLoginName", "human", "machine"] + preferred_login_name: Optional[StrictStr] = Field( + default=None, alias="preferredLoginName" + ) + human: Optional[BetaUserServiceHumanUser] = Field(default=None, alias="human") + machine: Optional[BetaUserServiceMachineUser] = Field(default=None, alias="machine") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,68 +39,11 @@ class BetaUserServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - # override the default output from pydantic by calling `to_dict()` of machine - if self.machine: - _dict['machine'] = self.machine.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "state": obj.get("state"), - "username": obj.get("username"), - "loginNames": obj.get("loginNames"), - "preferredLoginName": obj.get("preferredLoginName"), - "human": BetaUserServiceHumanUser.from_dict(obj["human"]) if obj.get("human") is not None else None, - "machine": BetaUserServiceMachineUser.from_dict(obj["machine"]) if obj.get("machine") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +from zitadel_client.models.beta_user_service_human_user import BetaUserServiceHumanUser +from zitadel_client.models.beta_user_service_machine_user import ( + BetaUserServiceMachineUser, +) +from zitadel_client.models.beta_user_service_user_state import BetaUserServiceUserState +BetaUserServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_user_field_name.py b/zitadel_client/models/beta_user_service_user_field_name.py index 13dd0fa1..3636fb73 100644 --- a/zitadel_client/models/beta_user_service_user_field_name.py +++ b/zitadel_client/models/beta_user_service_user_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceUserFieldName(str, Enum): @@ -23,23 +13,13 @@ class BetaUserServiceUserFieldName(str, Enum): BetaUserServiceUserFieldName """ - """ - allowed enum values - """ - USER_FIELD_NAME_UNSPECIFIED = 'USER_FIELD_NAME_UNSPECIFIED' - USER_FIELD_NAME_USER_NAME = 'USER_FIELD_NAME_USER_NAME' - USER_FIELD_NAME_FIRST_NAME = 'USER_FIELD_NAME_FIRST_NAME' - USER_FIELD_NAME_LAST_NAME = 'USER_FIELD_NAME_LAST_NAME' - USER_FIELD_NAME_NICK_NAME = 'USER_FIELD_NAME_NICK_NAME' - USER_FIELD_NAME_DISPLAY_NAME = 'USER_FIELD_NAME_DISPLAY_NAME' - USER_FIELD_NAME_EMAIL = 'USER_FIELD_NAME_EMAIL' - USER_FIELD_NAME_STATE = 'USER_FIELD_NAME_STATE' - USER_FIELD_NAME_TYPE = 'USER_FIELD_NAME_TYPE' - USER_FIELD_NAME_CREATION_DATE = 'USER_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceUserFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + USER_FIELD_NAME_UNSPECIFIED = "USER_FIELD_NAME_UNSPECIFIED" + USER_FIELD_NAME_USER_NAME = "USER_FIELD_NAME_USER_NAME" + USER_FIELD_NAME_FIRST_NAME = "USER_FIELD_NAME_FIRST_NAME" + USER_FIELD_NAME_LAST_NAME = "USER_FIELD_NAME_LAST_NAME" + USER_FIELD_NAME_NICK_NAME = "USER_FIELD_NAME_NICK_NAME" + USER_FIELD_NAME_DISPLAY_NAME = "USER_FIELD_NAME_DISPLAY_NAME" + USER_FIELD_NAME_EMAIL = "USER_FIELD_NAME_EMAIL" + USER_FIELD_NAME_STATE = "USER_FIELD_NAME_STATE" + USER_FIELD_NAME_TYPE = "USER_FIELD_NAME_TYPE" + USER_FIELD_NAME_CREATION_DATE = "USER_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/beta_user_service_user_name_query.py b/zitadel_client/models/beta_user_service_user_name_query.py index 5e3a7450..7b75248f 100644 --- a/zitadel_client/models/beta_user_service_user_name_query.py +++ b/zitadel_client/models/beta_user_service_user_name_query.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_text_query_method import BetaUserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceUserNameQuery(BaseModel): """ Query for users with a specific user name. - """ # noqa: E501 + """ + user_name: Optional[StrictStr] = Field(default=None, alias="userName") - method: Optional[BetaUserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["userName", "method"] + method: Optional[BetaUserServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class BetaUserServiceUserNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceUserNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceUserNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userName": obj.get("userName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.beta_user_service_text_query_method import ( + BetaUserServiceTextQueryMethod, +) +BetaUserServiceUserNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_user_state.py b/zitadel_client/models/beta_user_service_user_state.py index f18a7228..508aa9d9 100644 --- a/zitadel_client/models/beta_user_service_user_state.py +++ b/zitadel_client/models/beta_user_service_user_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaUserServiceUserState(str, Enum): @@ -23,19 +13,9 @@ class BetaUserServiceUserState(str, Enum): BetaUserServiceUserState """ - """ - allowed enum values - """ - USER_STATE_UNSPECIFIED = 'USER_STATE_UNSPECIFIED' - USER_STATE_ACTIVE = 'USER_STATE_ACTIVE' - USER_STATE_INACTIVE = 'USER_STATE_INACTIVE' - USER_STATE_DELETED = 'USER_STATE_DELETED' - USER_STATE_LOCKED = 'USER_STATE_LOCKED' - USER_STATE_INITIAL = 'USER_STATE_INITIAL' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaUserServiceUserState from a JSON string""" - return cls(json.loads(json_str)) - - + USER_STATE_UNSPECIFIED = "USER_STATE_UNSPECIFIED" + USER_STATE_ACTIVE = "USER_STATE_ACTIVE" + USER_STATE_INACTIVE = "USER_STATE_INACTIVE" + USER_STATE_DELETED = "USER_STATE_DELETED" + USER_STATE_LOCKED = "USER_STATE_LOCKED" + USER_STATE_INITIAL = "USER_STATE_INITIAL" diff --git a/zitadel_client/models/beta_user_service_verify_email_request.py b/zitadel_client/models/beta_user_service_verify_email_request.py index a8fc4fb8..02643c7b 100644 --- a/zitadel_client/models/beta_user_service_verify_email_request.py +++ b/zitadel_client/models/beta_user_service_verify_email_request.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceVerifyEmailRequest(BaseModel): """ BetaUserServiceVerifyEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class BetaUserServiceVerifyEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - - +BetaUserServiceVerifyEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_email_response.py b/zitadel_client/models/beta_user_service_verify_email_response.py index 89ebe668..d12a0865 100644 --- a/zitadel_client/models/beta_user_service_verify_email_response.py +++ b/zitadel_client/models/beta_user_service_verify_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceVerifyEmailResponse(BaseModel): """ BetaUserServiceVerifyEmailResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceVerifyEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceVerifyEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_passkey_registration_request.py b/zitadel_client/models/beta_user_service_verify_passkey_registration_request.py index 9fa629eb..d5d46876 100644 --- a/zitadel_client/models/beta_user_service_verify_passkey_registration_request.py +++ b/zitadel_client/models/beta_user_service_verify_passkey_registration_request.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceVerifyPasskeyRegistrationRequest(BaseModel): """ BetaUserServiceVerifyPasskeyRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") passkey_id: Optional[StrictStr] = Field(default=None, alias="passkeyId") - public_key_credential: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredential") + public_key_credential: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredential", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) passkey_name: Optional[StrictStr] = Field(default=None, alias="passkeyName") - __properties: ClassVar[List[str]] = ["userId", "passkeyId", "publicKeyCredential", "passkeyName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +37,4 @@ class BetaUserServiceVerifyPasskeyRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPasskeyRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPasskeyRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "passkeyId": obj.get("passkeyId"), - "publicKeyCredential": obj.get("publicKeyCredential"), - "passkeyName": obj.get("passkeyName") - }) - return _obj - - +BetaUserServiceVerifyPasskeyRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_passkey_registration_response.py b/zitadel_client/models/beta_user_service_verify_passkey_registration_response.py index 9ff44cc5..b9877b6b 100644 --- a/zitadel_client/models/beta_user_service_verify_passkey_registration_response.py +++ b/zitadel_client/models/beta_user_service_verify_passkey_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceVerifyPasskeyRegistrationResponse(BaseModel): """ BetaUserServiceVerifyPasskeyRegistrationResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceVerifyPasskeyRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPasskeyRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPasskeyRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceVerifyPasskeyRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_phone_request.py b/zitadel_client/models/beta_user_service_verify_phone_request.py index 6bddf6da..775de7e0 100644 --- a/zitadel_client/models/beta_user_service_verify_phone_request.py +++ b/zitadel_client/models/beta_user_service_verify_phone_request.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceVerifyPhoneRequest(BaseModel): """ BetaUserServiceVerifyPhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class BetaUserServiceVerifyPhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - - +BetaUserServiceVerifyPhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_phone_response.py b/zitadel_client/models/beta_user_service_verify_phone_response.py index d2e97ea7..77859d60 100644 --- a/zitadel_client/models/beta_user_service_verify_phone_response.py +++ b/zitadel_client/models/beta_user_service_verify_phone_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceVerifyPhoneResponse(BaseModel): """ BetaUserServiceVerifyPhoneResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceVerifyPhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyPhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceVerifyPhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_totp_registration_request.py b/zitadel_client/models/beta_user_service_verify_totp_registration_request.py index 38b8148f..b52d2872 100644 --- a/zitadel_client/models/beta_user_service_verify_totp_registration_request.py +++ b/zitadel_client/models/beta_user_service_verify_totp_registration_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaUserServiceVerifyTOTPRegistrationRequest(BaseModel): """ BetaUserServiceVerifyTOTPRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "code"] + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class BetaUserServiceVerifyTOTPRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyTOTPRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyTOTPRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "code": obj.get("code") - }) - return _obj - - +BetaUserServiceVerifyTOTPRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_totp_registration_response.py b/zitadel_client/models/beta_user_service_verify_totp_registration_response.py index 4d5b2a26..16851ece 100644 --- a/zitadel_client/models/beta_user_service_verify_totp_registration_response.py +++ b/zitadel_client/models/beta_user_service_verify_totp_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceVerifyTOTPRegistrationResponse(BaseModel): """ BetaUserServiceVerifyTOTPRegistrationResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceVerifyTOTPRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyTOTPRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyTOTPRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceVerifyTOTPRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_u2_f_registration_request.py b/zitadel_client/models/beta_user_service_verify_u2_f_registration_request.py index af1d31e5..6ad44137 100644 --- a/zitadel_client/models/beta_user_service_verify_u2_f_registration_request.py +++ b/zitadel_client/models/beta_user_service_verify_u2_f_registration_request.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class BetaUserServiceVerifyU2FRegistrationRequest(BaseModel): """ BetaUserServiceVerifyU2FRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") u2f_id: Optional[StrictStr] = Field(default=None, alias="u2fId") - public_key_credential: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredential") + public_key_credential: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredential", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) token_name: Optional[StrictStr] = Field(default=None, alias="tokenName") - __properties: ClassVar[List[str]] = ["userId", "u2fId", "publicKeyCredential", "tokenName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +37,4 @@ class BetaUserServiceVerifyU2FRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyU2FRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyU2FRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "u2fId": obj.get("u2fId"), - "publicKeyCredential": obj.get("publicKeyCredential"), - "tokenName": obj.get("tokenName") - }) - return _obj - - +BetaUserServiceVerifyU2FRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_user_service_verify_u2_f_registration_response.py b/zitadel_client/models/beta_user_service_verify_u2_f_registration_response.py index 26b36a51..14a58f9a 100644 --- a/zitadel_client/models/beta_user_service_verify_u2_f_registration_response.py +++ b/zitadel_client/models/beta_user_service_verify_u2_f_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaUserServiceVerifyU2FRegistrationResponse(BaseModel): """ BetaUserServiceVerifyU2FRegistrationResponse - """ # noqa: E501 - details: Optional[BetaUserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[BetaUserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class BetaUserServiceVerifyU2FRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyU2FRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaUserServiceVerifyU2FRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": BetaUserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.beta_user_service_details import BetaUserServiceDetails +BetaUserServiceVerifyU2FRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_activate_web_key_request.py b/zitadel_client/models/beta_web_key_service_activate_web_key_request.py index 3c3224b0..c59e916f 100644 --- a/zitadel_client/models/beta_web_key_service_activate_web_key_request.py +++ b/zitadel_client/models/beta_web_key_service_activate_web_key_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaWebKeyServiceActivateWebKeyRequest(BaseModel): """ BetaWebKeyServiceActivateWebKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaWebKeyServiceActivateWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceActivateWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceActivateWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaWebKeyServiceActivateWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_activate_web_key_response.py b/zitadel_client/models/beta_web_key_service_activate_web_key_response.py index 16d4615a..99eb3be5 100644 --- a/zitadel_client/models/beta_web_key_service_activate_web_key_response.py +++ b/zitadel_client/models/beta_web_key_service_activate_web_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaWebKeyServiceActivateWebKeyResponse(BaseModel): """ BetaWebKeyServiceActivateWebKeyResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaWebKeyServiceActivateWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceActivateWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceActivateWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaWebKeyServiceActivateWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_any.py b/zitadel_client/models/beta_web_key_service_any.py index 021bf9c0..2fd42a0a 100644 --- a/zitadel_client/models/beta_web_key_service_any.py +++ b/zitadel_client/models/beta_web_key_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class BetaWebKeyServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +BetaWebKeyServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_connect_error.py b/zitadel_client/models/beta_web_key_service_connect_error.py index 364cc5c5..10dcfc58 100644 --- a/zitadel_client/models/beta_web_key_service_connect_error.py +++ b/zitadel_client/models/beta_web_key_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_web_key_service_any import BetaWebKeyServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class BetaWebKeyServiceConnectErrorCodeEnum(str, Enum): + """BetaWebKeyServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class BetaWebKeyServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[BetaWebKeyServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[BetaWebKeyServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[BetaWebKeyServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [BetaWebKeyServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.beta_web_key_service_any import BetaWebKeyServiceAny +BetaWebKeyServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_create_web_key_request.py b/zitadel_client/models/beta_web_key_service_create_web_key_request.py index ae1d172c..91623b84 100644 --- a/zitadel_client/models/beta_web_key_service_create_web_key_request.py +++ b/zitadel_client/models/beta_web_key_service_create_web_key_request.py @@ -1,38 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_web_key_service_ecdsa import BetaWebKeyServiceECDSA -from zitadel_client.models.beta_web_key_service_rsa import BetaWebKeyServiceRSA -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaWebKeyServiceCreateWebKeyRequest(BaseModel): """ BetaWebKeyServiceCreateWebKeyRequest - """ # noqa: E501 - ecdsa: Optional[BetaWebKeyServiceECDSA] = None - ed25519: Optional[Dict[str, Any]] = None - rsa: Optional[BetaWebKeyServiceRSA] = None - __properties: ClassVar[List[str]] = ["ecdsa", "ed25519", "rsa"] + """ + ecdsa: Optional[BetaWebKeyServiceECDSA] = Field(default=None, alias="ecdsa") + ed25519: Optional[object] = Field(default=None, alias="ed25519") + rsa: Optional[BetaWebKeyServiceRSA] = Field(default=None, alias="rsa") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +31,7 @@ class BetaWebKeyServiceCreateWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceCreateWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ecdsa - if self.ecdsa: - _dict['ecdsa'] = self.ecdsa.to_dict() - # override the default output from pydantic by calling `to_dict()` of rsa - if self.rsa: - _dict['rsa'] = self.rsa.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceCreateWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ecdsa": BetaWebKeyServiceECDSA.from_dict(obj["ecdsa"]) if obj.get("ecdsa") is not None else None, - "ed25519": obj.get("ed25519"), - "rsa": BetaWebKeyServiceRSA.from_dict(obj["rsa"]) if obj.get("rsa") is not None else None - }) - return _obj - +from zitadel_client.models.beta_web_key_service_ecdsa import BetaWebKeyServiceECDSA +from zitadel_client.models.beta_web_key_service_rsa import BetaWebKeyServiceRSA +BetaWebKeyServiceCreateWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_create_web_key_response.py b/zitadel_client/models/beta_web_key_service_create_web_key_response.py index d2aece7f..c04e03b9 100644 --- a/zitadel_client/models/beta_web_key_service_create_web_key_response.py +++ b/zitadel_client/models/beta_web_key_service_create_web_key_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaWebKeyServiceCreateWebKeyResponse(BaseModel): """ BetaWebKeyServiceCreateWebKeyResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created key.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created key.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class BetaWebKeyServiceCreateWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceCreateWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceCreateWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaWebKeyServiceCreateWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_delete_web_key_request.py b/zitadel_client/models/beta_web_key_service_delete_web_key_request.py index bc1bc8f0..134fa148 100644 --- a/zitadel_client/models/beta_web_key_service_delete_web_key_request.py +++ b/zitadel_client/models/beta_web_key_service_delete_web_key_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaWebKeyServiceDeleteWebKeyRequest(BaseModel): """ BetaWebKeyServiceDeleteWebKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class BetaWebKeyServiceDeleteWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceDeleteWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceDeleteWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +BetaWebKeyServiceDeleteWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_delete_web_key_response.py b/zitadel_client/models/beta_web_key_service_delete_web_key_response.py index 7e8ea671..e926b310 100644 --- a/zitadel_client/models/beta_web_key_service_delete_web_key_response.py +++ b/zitadel_client/models/beta_web_key_service_delete_web_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class BetaWebKeyServiceDeleteWebKeyResponse(BaseModel): """ BetaWebKeyServiceDeleteWebKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class BetaWebKeyServiceDeleteWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceDeleteWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceDeleteWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +BetaWebKeyServiceDeleteWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_ecdsa.py b/zitadel_client/models/beta_web_key_service_ecdsa.py index 5dd86d72..c5f8ab61 100644 --- a/zitadel_client/models/beta_web_key_service_ecdsa.py +++ b/zitadel_client/models/beta_web_key_service_ecdsa.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_web_key_service_ecdsa_curve import BetaWebKeyServiceECDSACurve -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaWebKeyServiceECDSA(BaseModel): """ BetaWebKeyServiceECDSA - """ # noqa: E501 - curve: Optional[BetaWebKeyServiceECDSACurve] = None - __properties: ClassVar[List[str]] = ["curve"] + """ + curve: Optional[BetaWebKeyServiceECDSACurve] = Field(default=None, alias="curve") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,8 @@ class BetaWebKeyServiceECDSA(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceECDSA from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceECDSA from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "curve": obj.get("curve") - }) - return _obj - +from zitadel_client.models.beta_web_key_service_ecdsa_curve import ( + BetaWebKeyServiceECDSACurve, +) +BetaWebKeyServiceECDSA.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_ecdsa_curve.py b/zitadel_client/models/beta_web_key_service_ecdsa_curve.py index b50166ec..6354051c 100644 --- a/zitadel_client/models/beta_web_key_service_ecdsa_curve.py +++ b/zitadel_client/models/beta_web_key_service_ecdsa_curve.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaWebKeyServiceECDSACurve(str, Enum): @@ -23,17 +13,7 @@ class BetaWebKeyServiceECDSACurve(str, Enum): BetaWebKeyServiceECDSACurve """ - """ - allowed enum values - """ - ECDSA_CURVE_UNSPECIFIED = 'ECDSA_CURVE_UNSPECIFIED' - ECDSA_CURVE_P256 = 'ECDSA_CURVE_P256' - ECDSA_CURVE_P384 = 'ECDSA_CURVE_P384' - ECDSA_CURVE_P512 = 'ECDSA_CURVE_P512' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaWebKeyServiceECDSACurve from a JSON string""" - return cls(json.loads(json_str)) - - + ECDSA_CURVE_UNSPECIFIED = "ECDSA_CURVE_UNSPECIFIED" + ECDSA_CURVE_P256 = "ECDSA_CURVE_P256" + ECDSA_CURVE_P384 = "ECDSA_CURVE_P384" + ECDSA_CURVE_P512 = "ECDSA_CURVE_P512" diff --git a/zitadel_client/models/beta_web_key_service_list_web_keys_response.py b/zitadel_client/models/beta_web_key_service_list_web_keys_response.py index 9677d8f8..ead9d6aa 100644 --- a/zitadel_client/models/beta_web_key_service_list_web_keys_response.py +++ b/zitadel_client/models/beta_web_key_service_list_web_keys_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.beta_web_key_service_web_key import BetaWebKeyServiceWebKey -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class BetaWebKeyServiceListWebKeysResponse(BaseModel): """ BetaWebKeyServiceListWebKeysResponse - """ # noqa: E501 - web_keys: Optional[List[BetaWebKeyServiceWebKey]] = Field(default=None, alias="webKeys") - __properties: ClassVar[List[str]] = ["webKeys"] + """ + web_keys: Optional[List[BetaWebKeyServiceWebKey]] = Field( + default=None, alias="webKeys" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,59 +31,6 @@ class BetaWebKeyServiceListWebKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceListWebKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in web_keys (list) - _items = [] - if self.web_keys: - for _item_web_keys in self.web_keys: - if _item_web_keys: - _items.append(_item_web_keys.to_dict()) - _dict['webKeys'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceListWebKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webKeys": [BetaWebKeyServiceWebKey.from_dict(_item) for _item in obj["webKeys"]] if obj.get("webKeys") is not None else None - }) - return _obj - +from zitadel_client.models.beta_web_key_service_web_key import BetaWebKeyServiceWebKey +BetaWebKeyServiceListWebKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_rsa.py b/zitadel_client/models/beta_web_key_service_rsa.py index 7eafbaef..05cd8fa7 100644 --- a/zitadel_client/models/beta_web_key_service_rsa.py +++ b/zitadel_client/models/beta_web_key_service_rsa.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_web_key_service_rsa_bits import BetaWebKeyServiceRSABits -from zitadel_client.models.beta_web_key_service_rsa_hasher import BetaWebKeyServiceRSAHasher -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class BetaWebKeyServiceRSA(BaseModel): """ BetaWebKeyServiceRSA - """ # noqa: E501 - bits: Optional[BetaWebKeyServiceRSABits] = None - hasher: Optional[BetaWebKeyServiceRSAHasher] = None - __properties: ClassVar[List[str]] = ["bits", "hasher"] + """ + bits: Optional[BetaWebKeyServiceRSABits] = Field(default=None, alias="bits") + hasher: Optional[BetaWebKeyServiceRSAHasher] = Field(default=None, alias="hasher") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +30,9 @@ class BetaWebKeyServiceRSA(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceRSA from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceRSA from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "bits": obj.get("bits"), - "hasher": obj.get("hasher") - }) - return _obj - +from zitadel_client.models.beta_web_key_service_rsa_bits import BetaWebKeyServiceRSABits +from zitadel_client.models.beta_web_key_service_rsa_hasher import ( + BetaWebKeyServiceRSAHasher, +) +BetaWebKeyServiceRSA.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/beta_web_key_service_rsa_bits.py b/zitadel_client/models/beta_web_key_service_rsa_bits.py index 886e699f..780ce802 100644 --- a/zitadel_client/models/beta_web_key_service_rsa_bits.py +++ b/zitadel_client/models/beta_web_key_service_rsa_bits.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaWebKeyServiceRSABits(str, Enum): @@ -23,17 +13,7 @@ class BetaWebKeyServiceRSABits(str, Enum): BetaWebKeyServiceRSABits """ - """ - allowed enum values - """ - RSA_BITS_UNSPECIFIED = 'RSA_BITS_UNSPECIFIED' - RSA_BITS_2048 = 'RSA_BITS_2048' - RSA_BITS_3072 = 'RSA_BITS_3072' - RSA_BITS_4096 = 'RSA_BITS_4096' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaWebKeyServiceRSABits from a JSON string""" - return cls(json.loads(json_str)) - - + RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED" + RSA_BITS_2048 = "RSA_BITS_2048" + RSA_BITS_3072 = "RSA_BITS_3072" + RSA_BITS_4096 = "RSA_BITS_4096" diff --git a/zitadel_client/models/beta_web_key_service_rsa_hasher.py b/zitadel_client/models/beta_web_key_service_rsa_hasher.py index 8aa9e1a5..11ea28d6 100644 --- a/zitadel_client/models/beta_web_key_service_rsa_hasher.py +++ b/zitadel_client/models/beta_web_key_service_rsa_hasher.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaWebKeyServiceRSAHasher(str, Enum): @@ -23,17 +13,7 @@ class BetaWebKeyServiceRSAHasher(str, Enum): BetaWebKeyServiceRSAHasher """ - """ - allowed enum values - """ - RSA_HASHER_UNSPECIFIED = 'RSA_HASHER_UNSPECIFIED' - RSA_HASHER_SHA256 = 'RSA_HASHER_SHA256' - RSA_HASHER_SHA384 = 'RSA_HASHER_SHA384' - RSA_HASHER_SHA512 = 'RSA_HASHER_SHA512' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaWebKeyServiceRSAHasher from a JSON string""" - return cls(json.loads(json_str)) - - + RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED" + RSA_HASHER_SHA256 = "RSA_HASHER_SHA256" + RSA_HASHER_SHA384 = "RSA_HASHER_SHA384" + RSA_HASHER_SHA512 = "RSA_HASHER_SHA512" diff --git a/zitadel_client/models/beta_web_key_service_state.py b/zitadel_client/models/beta_web_key_service_state.py index 26f35960..baf80af0 100644 --- a/zitadel_client/models/beta_web_key_service_state.py +++ b/zitadel_client/models/beta_web_key_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class BetaWebKeyServiceState(str, Enum): @@ -23,18 +13,8 @@ class BetaWebKeyServiceState(str, Enum): BetaWebKeyServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_INITIAL = 'STATE_INITIAL' - STATE_ACTIVE = 'STATE_ACTIVE' - STATE_INACTIVE = 'STATE_INACTIVE' - STATE_REMOVED = 'STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BetaWebKeyServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_INITIAL = "STATE_INITIAL" + STATE_ACTIVE = "STATE_ACTIVE" + STATE_INACTIVE = "STATE_INACTIVE" + STATE_REMOVED = "STATE_REMOVED" diff --git a/zitadel_client/models/beta_web_key_service_web_key.py b/zitadel_client/models/beta_web_key_service_web_key.py index e24dd6ab..fb58150e 100644 --- a/zitadel_client/models/beta_web_key_service_web_key.py +++ b/zitadel_client/models/beta_web_key_service_web_key.py @@ -1,44 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.beta_web_key_service_ecdsa import BetaWebKeyServiceECDSA -from zitadel_client.models.beta_web_key_service_rsa import BetaWebKeyServiceRSA -from zitadel_client.models.beta_web_key_service_state import BetaWebKeyServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class BetaWebKeyServiceWebKey(BaseModel): """ BetaWebKeyServiceWebKey - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the key.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - state: Optional[BetaWebKeyServiceState] = None - ecdsa: Optional[BetaWebKeyServiceECDSA] = None - ed25519: Optional[Dict[str, Any]] = None - rsa: Optional[BetaWebKeyServiceRSA] = None - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "state", "ecdsa", "ed25519", "rsa"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the key." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[BetaWebKeyServiceState] = Field(default=None, alias="state") + ecdsa: Optional[BetaWebKeyServiceECDSA] = Field(default=None, alias="ecdsa") + ed25519: Optional[object] = Field(default=None, alias="ed25519") + rsa: Optional[BetaWebKeyServiceRSA] = Field(default=None, alias="rsa") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,64 +46,9 @@ class BetaWebKeyServiceWebKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceWebKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ecdsa - if self.ecdsa: - _dict['ecdsa'] = self.ecdsa.to_dict() - # override the default output from pydantic by calling `to_dict()` of rsa - if self.rsa: - _dict['rsa'] = self.rsa.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BetaWebKeyServiceWebKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "state": obj.get("state"), - "ecdsa": BetaWebKeyServiceECDSA.from_dict(obj["ecdsa"]) if obj.get("ecdsa") is not None else None, - "ed25519": obj.get("ed25519"), - "rsa": BetaWebKeyServiceRSA.from_dict(obj["rsa"]) if obj.get("rsa") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.beta_web_key_service_ecdsa import BetaWebKeyServiceECDSA +from zitadel_client.models.beta_web_key_service_rsa import BetaWebKeyServiceRSA +from zitadel_client.models.beta_web_key_service_state import BetaWebKeyServiceState +BetaWebKeyServiceWebKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_any.py b/zitadel_client/models/feature_service_any.py index 1b436a5e..39cc5617 100644 --- a/zitadel_client/models/feature_service_any.py +++ b/zitadel_client/models/feature_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class FeatureServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +FeatureServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_connect_error.py b/zitadel_client/models/feature_service_connect_error.py index f8cfefc7..fc027e3e 100644 --- a/zitadel_client/models/feature_service_connect_error.py +++ b/zitadel_client/models/feature_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.feature_service_any import FeatureServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class FeatureServiceConnectErrorCodeEnum(str, Enum): + """FeatureServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class FeatureServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[FeatureServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[FeatureServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[FeatureServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [FeatureServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.feature_service_any import FeatureServiceAny +FeatureServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_details.py b/zitadel_client/models/feature_service_details.py index d6132907..3f191e34 100644 --- a/zitadel_client/models/feature_service_details.py +++ b/zitadel_client/models/feature_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class FeatureServiceDetails(BaseModel): """ FeatureServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class FeatureServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +FeatureServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_feature_flag.py b/zitadel_client/models/feature_service_feature_flag.py index 9a9c481d..7861f8d7 100644 --- a/zitadel_client/models/feature_service_feature_flag.py +++ b/zitadel_client/models/feature_service_feature_flag.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_source import FeatureServiceSource -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class FeatureServiceFeatureFlag(BaseModel): """ FeatureFlag is a simple boolean Feature setting, without further payload. - """ # noqa: E501 - enabled: Optional[StrictBool] = None - source: Optional[FeatureServiceSource] = None - __properties: ClassVar[List[str]] = ["enabled", "source"] + """ + enabled: Optional[StrictBool] = Field(default=None, alias="enabled") + source: Optional[FeatureServiceSource] = Field(default=None, alias="source") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,6 @@ class FeatureServiceFeatureFlag(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceFeatureFlag from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceFeatureFlag from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "enabled": obj.get("enabled"), - "source": obj.get("source") - }) - return _obj - +from zitadel_client.models.feature_service_source import FeatureServiceSource +FeatureServiceFeatureFlag.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_instance_features_request.py b/zitadel_client/models/feature_service_get_instance_features_request.py index 8851361a..d816849e 100644 --- a/zitadel_client/models/feature_service_get_instance_features_request.py +++ b/zitadel_client/models/feature_service_get_instance_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class FeatureServiceGetInstanceFeaturesRequest(BaseModel): """ FeatureServiceGetInstanceFeaturesRequest - """ # noqa: E501 - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["inheritance"] + """ + + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class FeatureServiceGetInstanceFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetInstanceFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetInstanceFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inheritance": obj.get("inheritance") - }) - return _obj - - +FeatureServiceGetInstanceFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_instance_features_response.py b/zitadel_client/models/feature_service_get_instance_features_response.py index 3c2abf57..8d813ab5 100644 --- a/zitadel_client/models/feature_service_get_instance_features_response.py +++ b/zitadel_client/models/feature_service_get_instance_features_response.py @@ -1,48 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from zitadel_client.models.feature_service_feature_flag import FeatureServiceFeatureFlag -from zitadel_client.models.feature_service_improved_performance_feature_flag import FeatureServiceImprovedPerformanceFeatureFlag -from zitadel_client.models.feature_service_login_v2_feature_flag import FeatureServiceLoginV2FeatureFlag -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class FeatureServiceGetInstanceFeaturesResponse(BaseModel): """ FeatureServiceGetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - login_default_org: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="loginDefaultOrg") - user_schema: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="oidcTokenExchange") - improved_performance: Optional[FeatureServiceImprovedPerformanceFeatureFlag] = Field(default=None, alias="improvedPerformance") - debug_oidc_parent_error: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="debugOidcParentError") - oidc_single_v1_session_termination: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="oidcSingleV1SessionTermination") - enable_back_channel_logout: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="enableBackChannelLogout") - login_v2: Optional[FeatureServiceLoginV2FeatureFlag] = Field(default=None, alias="loginV2") - permission_check_v2: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="permissionCheckV2") - console_use_v2_user_api: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="consoleUseV2UserApi") - __properties: ClassVar[List[str]] = ["details", "loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "debugOidcParentError", "oidcSingleV1SessionTermination", "enableBackChannelLogout", "loginV2", "permissionCheckV2", "consoleUseV2UserApi"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + login_default_org: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="loginDefaultOrg" + ) + user_schema: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="userSchema" + ) + oidc_token_exchange: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="oidcTokenExchange" + ) + improved_performance: Optional[FeatureServiceImprovedPerformanceFeatureFlag] = ( + Field(default=None, alias="improvedPerformance") + ) + debug_oidc_parent_error: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="debugOidcParentError" + ) + oidc_single_v1_session_termination: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + enable_back_channel_logout: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="enableBackChannelLogout" + ) + login_v2: Optional[FeatureServiceLoginV2FeatureFlag] = Field( + default=None, alias="loginV2" + ) + permission_check_v2: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="permissionCheckV2" + ) + console_use_v2_user_api: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="consoleUseV2UserApi" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,95 +59,13 @@ class FeatureServiceGetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_default_org - if self.login_default_org: - _dict['loginDefaultOrg'] = self.login_default_org.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_schema - if self.user_schema: - _dict['userSchema'] = self.user_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_token_exchange - if self.oidc_token_exchange: - _dict['oidcTokenExchange'] = self.oidc_token_exchange.to_dict() - # override the default output from pydantic by calling `to_dict()` of improved_performance - if self.improved_performance: - _dict['improvedPerformance'] = self.improved_performance.to_dict() - # override the default output from pydantic by calling `to_dict()` of debug_oidc_parent_error - if self.debug_oidc_parent_error: - _dict['debugOidcParentError'] = self.debug_oidc_parent_error.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_single_v1_session_termination - if self.oidc_single_v1_session_termination: - _dict['oidcSingleV1SessionTermination'] = self.oidc_single_v1_session_termination.to_dict() - # override the default output from pydantic by calling `to_dict()` of enable_back_channel_logout - if self.enable_back_channel_logout: - _dict['enableBackChannelLogout'] = self.enable_back_channel_logout.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - # override the default output from pydantic by calling `to_dict()` of permission_check_v2 - if self.permission_check_v2: - _dict['permissionCheckV2'] = self.permission_check_v2.to_dict() - # override the default output from pydantic by calling `to_dict()` of console_use_v2_user_api - if self.console_use_v2_user_api: - _dict['consoleUseV2UserApi'] = self.console_use_v2_user_api.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "loginDefaultOrg": FeatureServiceFeatureFlag.from_dict(obj["loginDefaultOrg"]) if obj.get("loginDefaultOrg") is not None else None, - "userSchema": FeatureServiceFeatureFlag.from_dict(obj["userSchema"]) if obj.get("userSchema") is not None else None, - "oidcTokenExchange": FeatureServiceFeatureFlag.from_dict(obj["oidcTokenExchange"]) if obj.get("oidcTokenExchange") is not None else None, - "improvedPerformance": FeatureServiceImprovedPerformanceFeatureFlag.from_dict(obj["improvedPerformance"]) if obj.get("improvedPerformance") is not None else None, - "debugOidcParentError": FeatureServiceFeatureFlag.from_dict(obj["debugOidcParentError"]) if obj.get("debugOidcParentError") is not None else None, - "oidcSingleV1SessionTermination": FeatureServiceFeatureFlag.from_dict(obj["oidcSingleV1SessionTermination"]) if obj.get("oidcSingleV1SessionTermination") is not None else None, - "enableBackChannelLogout": FeatureServiceFeatureFlag.from_dict(obj["enableBackChannelLogout"]) if obj.get("enableBackChannelLogout") is not None else None, - "loginV2": FeatureServiceLoginV2FeatureFlag.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None, - "permissionCheckV2": FeatureServiceFeatureFlag.from_dict(obj["permissionCheckV2"]) if obj.get("permissionCheckV2") is not None else None, - "consoleUseV2UserApi": FeatureServiceFeatureFlag.from_dict(obj["consoleUseV2UserApi"]) if obj.get("consoleUseV2UserApi") is not None else None - }) - return _obj - - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +from zitadel_client.models.feature_service_feature_flag import FeatureServiceFeatureFlag +from zitadel_client.models.feature_service_improved_performance_feature_flag import ( + FeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.feature_service_login_v2_feature_flag import ( + FeatureServiceLoginV2FeatureFlag, +) + +FeatureServiceGetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_organization_features_request.py b/zitadel_client/models/feature_service_get_organization_features_request.py index f8a08e53..30dd89b8 100644 --- a/zitadel_client/models/feature_service_get_organization_features_request.py +++ b/zitadel_client/models/feature_service_get_organization_features_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class FeatureServiceGetOrganizationFeaturesRequest(BaseModel): """ FeatureServiceGetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["organizationId", "inheritance"] + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class FeatureServiceGetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "inheritance": obj.get("inheritance") - }) - return _obj - - +FeatureServiceGetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_organization_features_response.py b/zitadel_client/models/feature_service_get_organization_features_response.py index 0820bff7..a6ecb7dc 100644 --- a/zitadel_client/models/feature_service_get_organization_features_response.py +++ b/zitadel_client/models/feature_service_get_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceGetOrganizationFeaturesResponse(BaseModel): """ FeatureServiceGetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceGetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceGetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_system_features_response.py b/zitadel_client/models/feature_service_get_system_features_response.py index 457037b4..fbb6dcd3 100644 --- a/zitadel_client/models/feature_service_get_system_features_response.py +++ b/zitadel_client/models/feature_service_get_system_features_response.py @@ -1,46 +1,51 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from zitadel_client.models.feature_service_feature_flag import FeatureServiceFeatureFlag -from zitadel_client.models.feature_service_improved_performance_feature_flag import FeatureServiceImprovedPerformanceFeatureFlag -from zitadel_client.models.feature_service_login_v2_feature_flag import FeatureServiceLoginV2FeatureFlag -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class FeatureServiceGetSystemFeaturesResponse(BaseModel): """ FeatureServiceGetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - login_default_org: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="loginDefaultOrg") - user_schema: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="oidcTokenExchange") - improved_performance: Optional[FeatureServiceImprovedPerformanceFeatureFlag] = Field(default=None, alias="improvedPerformance") - oidc_single_v1_session_termination: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="oidcSingleV1SessionTermination") - enable_back_channel_logout: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="enableBackChannelLogout") - login_v2: Optional[FeatureServiceLoginV2FeatureFlag] = Field(default=None, alias="loginV2") - permission_check_v2: Optional[FeatureServiceFeatureFlag] = Field(default=None, alias="permissionCheckV2") - __properties: ClassVar[List[str]] = ["details", "loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "oidcSingleV1SessionTermination", "enableBackChannelLogout", "loginV2", "permissionCheckV2"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + login_default_org: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="loginDefaultOrg" + ) + user_schema: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="userSchema" + ) + oidc_token_exchange: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="oidcTokenExchange" + ) + improved_performance: Optional[FeatureServiceImprovedPerformanceFeatureFlag] = ( + Field(default=None, alias="improvedPerformance") + ) + oidc_single_v1_session_termination: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + enable_back_channel_logout: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="enableBackChannelLogout" + ) + login_v2: Optional[FeatureServiceLoginV2FeatureFlag] = Field( + default=None, alias="loginV2" + ) + permission_check_v2: Optional[FeatureServiceFeatureFlag] = Field( + default=None, alias="permissionCheckV2" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,87 +53,13 @@ class FeatureServiceGetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_default_org - if self.login_default_org: - _dict['loginDefaultOrg'] = self.login_default_org.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_schema - if self.user_schema: - _dict['userSchema'] = self.user_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_token_exchange - if self.oidc_token_exchange: - _dict['oidcTokenExchange'] = self.oidc_token_exchange.to_dict() - # override the default output from pydantic by calling `to_dict()` of improved_performance - if self.improved_performance: - _dict['improvedPerformance'] = self.improved_performance.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc_single_v1_session_termination - if self.oidc_single_v1_session_termination: - _dict['oidcSingleV1SessionTermination'] = self.oidc_single_v1_session_termination.to_dict() - # override the default output from pydantic by calling `to_dict()` of enable_back_channel_logout - if self.enable_back_channel_logout: - _dict['enableBackChannelLogout'] = self.enable_back_channel_logout.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - # override the default output from pydantic by calling `to_dict()` of permission_check_v2 - if self.permission_check_v2: - _dict['permissionCheckV2'] = self.permission_check_v2.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "loginDefaultOrg": FeatureServiceFeatureFlag.from_dict(obj["loginDefaultOrg"]) if obj.get("loginDefaultOrg") is not None else None, - "userSchema": FeatureServiceFeatureFlag.from_dict(obj["userSchema"]) if obj.get("userSchema") is not None else None, - "oidcTokenExchange": FeatureServiceFeatureFlag.from_dict(obj["oidcTokenExchange"]) if obj.get("oidcTokenExchange") is not None else None, - "improvedPerformance": FeatureServiceImprovedPerformanceFeatureFlag.from_dict(obj["improvedPerformance"]) if obj.get("improvedPerformance") is not None else None, - "oidcSingleV1SessionTermination": FeatureServiceFeatureFlag.from_dict(obj["oidcSingleV1SessionTermination"]) if obj.get("oidcSingleV1SessionTermination") is not None else None, - "enableBackChannelLogout": FeatureServiceFeatureFlag.from_dict(obj["enableBackChannelLogout"]) if obj.get("enableBackChannelLogout") is not None else None, - "loginV2": FeatureServiceLoginV2FeatureFlag.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None, - "permissionCheckV2": FeatureServiceFeatureFlag.from_dict(obj["permissionCheckV2"]) if obj.get("permissionCheckV2") is not None else None - }) - return _obj - - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +from zitadel_client.models.feature_service_feature_flag import FeatureServiceFeatureFlag +from zitadel_client.models.feature_service_improved_performance_feature_flag import ( + FeatureServiceImprovedPerformanceFeatureFlag, +) +from zitadel_client.models.feature_service_login_v2_feature_flag import ( + FeatureServiceLoginV2FeatureFlag, +) + +FeatureServiceGetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_user_features_request.py b/zitadel_client/models/feature_service_get_user_features_request.py index 199ef202..ea53509f 100644 --- a/zitadel_client/models/feature_service_get_user_features_request.py +++ b/zitadel_client/models/feature_service_get_user_features_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class FeatureServiceGetUserFeaturesRequest(BaseModel): """ FeatureServiceGetUserFeaturesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - inheritance: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["userId", "inheritance"] + inheritance: Optional[StrictBool] = Field(default=None, alias="inheritance") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class FeatureServiceGetUserFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetUserFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetUserFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "inheritance": obj.get("inheritance") - }) - return _obj - - +FeatureServiceGetUserFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_get_user_features_response.py b/zitadel_client/models/feature_service_get_user_features_response.py index 1410d180..147dac58 100644 --- a/zitadel_client/models/feature_service_get_user_features_response.py +++ b/zitadel_client/models/feature_service_get_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceGetUserFeaturesResponse(BaseModel): """ FeatureServiceGetUserFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceGetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceGetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceGetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceGetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_improved_performance.py b/zitadel_client/models/feature_service_improved_performance.py index 9c756118..345b5e2e 100644 --- a/zitadel_client/models/feature_service_improved_performance.py +++ b/zitadel_client/models/feature_service_improved_performance.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class FeatureServiceImprovedPerformance(str, Enum): @@ -23,18 +13,10 @@ class FeatureServiceImprovedPerformance(str, Enum): FeatureServiceImprovedPerformance """ - """ - allowed enum values - """ - IMPROVED_PERFORMANCE_UNSPECIFIED = 'IMPROVED_PERFORMANCE_UNSPECIFIED' - IMPROVED_PERFORMANCE_PROJECT_GRANT = 'IMPROVED_PERFORMANCE_PROJECT_GRANT' - IMPROVED_PERFORMANCE_PROJECT = 'IMPROVED_PERFORMANCE_PROJECT' - IMPROVED_PERFORMANCE_USER_GRANT = 'IMPROVED_PERFORMANCE_USER_GRANT' - IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = 'IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of FeatureServiceImprovedPerformance from a JSON string""" - return cls(json.loads(json_str)) - - + IMPROVED_PERFORMANCE_UNSPECIFIED = "IMPROVED_PERFORMANCE_UNSPECIFIED" + IMPROVED_PERFORMANCE_PROJECT_GRANT = "IMPROVED_PERFORMANCE_PROJECT_GRANT" + IMPROVED_PERFORMANCE_PROJECT = "IMPROVED_PERFORMANCE_PROJECT" + IMPROVED_PERFORMANCE_USER_GRANT = "IMPROVED_PERFORMANCE_USER_GRANT" + IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED = ( + "IMPROVED_PERFORMANCE_ORG_DOMAIN_VERIFIED" + ) diff --git a/zitadel_client/models/feature_service_improved_performance_feature_flag.py b/zitadel_client/models/feature_service_improved_performance_feature_flag.py index 168c717b..9a0f8255 100644 --- a/zitadel_client/models/feature_service_improved_performance_feature_flag.py +++ b/zitadel_client/models/feature_service_improved_performance_feature_flag.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.feature_service_improved_performance import FeatureServiceImprovedPerformance -from zitadel_client.models.feature_service_source import FeatureServiceSource -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class FeatureServiceImprovedPerformanceFeatureFlag(BaseModel): """ FeatureServiceImprovedPerformanceFeatureFlag - """ # noqa: E501 - execution_paths: Optional[List[FeatureServiceImprovedPerformance]] = Field(default=None, alias="executionPaths") - source: Optional[FeatureServiceSource] = None - __properties: ClassVar[List[str]] = ["executionPaths", "source"] + """ + execution_paths: Optional[List[FeatureServiceImprovedPerformance]] = Field( + default=None, alias="executionPaths" + ) + source: Optional[FeatureServiceSource] = Field(default=None, alias="source") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +32,9 @@ class FeatureServiceImprovedPerformanceFeatureFlag(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceImprovedPerformanceFeatureFlag from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceImprovedPerformanceFeatureFlag from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "executionPaths": obj.get("executionPaths"), - "source": obj.get("source") - }) - return _obj - +from zitadel_client.models.feature_service_improved_performance import ( + FeatureServiceImprovedPerformance, +) +from zitadel_client.models.feature_service_source import FeatureServiceSource +FeatureServiceImprovedPerformanceFeatureFlag.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_login_v2.py b/zitadel_client/models/feature_service_login_v2.py index a0e82972..aed4a0e9 100644 --- a/zitadel_client/models/feature_service_login_v2.py +++ b/zitadel_client/models/feature_service_login_v2.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class FeatureServiceLoginV2(BaseModel): """ FeatureServiceLoginV2 - """ # noqa: E501 - required: Optional[StrictBool] = Field(default=None, description="Require that all users must use the new login UI. If enabled, all users will be redirected to the login V2 regardless of the application's preference.") - base_uri: Optional[StrictStr] = Field(default=None, description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", alias="baseUri") - __properties: ClassVar[List[str]] = ["required", "baseUri"] + """ + required: Optional[StrictBool] = Field( + default=None, + alias="required", + description="Require that all users must use the new login UI. If enabled, all users will be redirected to the login V2 regardless of the application's preference.", + ) + base_uri: Optional[StrictStr] = Field( + default=None, + alias="baseUri", + description="Optionally specify a base uri of the login UI. If unspecified the default URI will be used.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +39,4 @@ class FeatureServiceLoginV2(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceLoginV2 from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if base_uri (nullable) is None - # and model_fields_set contains the field - if self.base_uri is None and "base_uri" in self.model_fields_set: - _dict['baseUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceLoginV2 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "required": obj.get("required"), - "baseUri": obj.get("baseUri") - }) - return _obj - - +FeatureServiceLoginV2.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_login_v2_feature_flag.py b/zitadel_client/models/feature_service_login_v2_feature_flag.py index d57232ea..d5a34852 100644 --- a/zitadel_client/models/feature_service_login_v2_feature_flag.py +++ b/zitadel_client/models/feature_service_login_v2_feature_flag.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_source import FeatureServiceSource -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class FeatureServiceLoginV2FeatureFlag(BaseModel): """ FeatureServiceLoginV2FeatureFlag - """ # noqa: E501 - required: Optional[StrictBool] = None + """ + + required: Optional[StrictBool] = Field(default=None, alias="required") base_uri: Optional[StrictStr] = Field(default=None, alias="baseUri") - source: Optional[FeatureServiceSource] = None - __properties: ClassVar[List[str]] = ["required", "baseUri", "source"] + source: Optional[FeatureServiceSource] = Field(default=None, alias="source") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,6 @@ class FeatureServiceLoginV2FeatureFlag(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceLoginV2FeatureFlag from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if base_uri (nullable) is None - # and model_fields_set contains the field - if self.base_uri is None and "base_uri" in self.model_fields_set: - _dict['baseUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceLoginV2FeatureFlag from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "required": obj.get("required"), - "baseUri": obj.get("baseUri"), - "source": obj.get("source") - }) - return _obj - +from zitadel_client.models.feature_service_source import FeatureServiceSource +FeatureServiceLoginV2FeatureFlag.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_instance_features_response.py b/zitadel_client/models/feature_service_reset_instance_features_response.py index 06396778..c4fc79a2 100644 --- a/zitadel_client/models/feature_service_reset_instance_features_response.py +++ b/zitadel_client/models/feature_service_reset_instance_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceResetInstanceFeaturesResponse(BaseModel): """ FeatureServiceResetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceResetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceResetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_organization_features_request.py b/zitadel_client/models/feature_service_reset_organization_features_request.py index 61ae60fe..83ccfbfd 100644 --- a/zitadel_client/models/feature_service_reset_organization_features_request.py +++ b/zitadel_client/models/feature_service_reset_organization_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class FeatureServiceResetOrganizationFeaturesRequest(BaseModel): """ FeatureServiceResetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class FeatureServiceResetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +FeatureServiceResetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_organization_features_response.py b/zitadel_client/models/feature_service_reset_organization_features_response.py index 23d94986..d4c68d57 100644 --- a/zitadel_client/models/feature_service_reset_organization_features_response.py +++ b/zitadel_client/models/feature_service_reset_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceResetOrganizationFeaturesResponse(BaseModel): """ FeatureServiceResetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceResetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceResetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_system_features_response.py b/zitadel_client/models/feature_service_reset_system_features_response.py index b4c16fc9..fcc28208 100644 --- a/zitadel_client/models/feature_service_reset_system_features_response.py +++ b/zitadel_client/models/feature_service_reset_system_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceResetSystemFeaturesResponse(BaseModel): """ FeatureServiceResetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceResetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceResetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_user_features_request.py b/zitadel_client/models/feature_service_reset_user_features_request.py index 3643489d..6790763f 100644 --- a/zitadel_client/models/feature_service_reset_user_features_request.py +++ b/zitadel_client/models/feature_service_reset_user_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class FeatureServiceResetUserFeaturesRequest(BaseModel): """ FeatureServiceResetUserFeaturesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class FeatureServiceResetUserFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetUserFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetUserFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +FeatureServiceResetUserFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_reset_user_features_response.py b/zitadel_client/models/feature_service_reset_user_features_response.py index 4a2a35ab..4eb2caf9 100644 --- a/zitadel_client/models/feature_service_reset_user_features_response.py +++ b/zitadel_client/models/feature_service_reset_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceResetUserFeaturesResponse(BaseModel): """ FeatureServiceResetUserFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceResetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceResetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceResetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceResetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_instance_features_request.py b/zitadel_client/models/feature_service_set_instance_features_request.py index 340b756a..e4b33161 100644 --- a/zitadel_client/models/feature_service_set_instance_features_request.py +++ b/zitadel_client/models/feature_service_set_instance_features_request.py @@ -1,45 +1,82 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.feature_service_improved_performance import FeatureServiceImprovedPerformance -from zitadel_client.models.feature_service_login_v2 import FeatureServiceLoginV2 -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictBool +from typing import Any, List, Optional + class FeatureServiceSetInstanceFeaturesRequest(BaseModel): """ FeatureServiceSetInstanceFeaturesRequest - """ # noqa: E501 - login_default_org: Optional[StrictBool] = Field(default=None, alias="loginDefaultOrg") + """ + + login_default_org: Optional[StrictBool] = Field( + default=None, alias="loginDefaultOrg" + ) user_schema: Optional[StrictBool] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="oidcTokenExchange") - improved_performance: Optional[List[FeatureServiceImprovedPerformance]] = Field(default=None, alias="improvedPerformance") - debug_oidc_parent_error: Optional[StrictBool] = Field(default=None, alias="debugOidcParentError") - oidc_single_v1_session_termination: Optional[StrictBool] = Field(default=None, alias="oidcSingleV1SessionTermination") - enable_back_channel_logout: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="enableBackChannelLogout") + # .. deprecated:: This property is deprecated. + oidc_token_exchange: Optional[StrictBool] = Field( + default=None, + alias="oidcTokenExchange", + description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) + improved_performance: Optional[List[FeatureServiceImprovedPerformance]] = Field( + default=None, alias="improvedPerformance" + ) + debug_oidc_parent_error: Optional[StrictBool] = Field( + default=None, alias="debugOidcParentError" + ) + oidc_single_v1_session_termination: Optional[StrictBool] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + # .. deprecated:: This property is deprecated. + enable_back_channel_logout: Optional[StrictBool] = Field( + default=None, + alias="enableBackChannelLogout", + description="Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) login_v2: Optional[FeatureServiceLoginV2] = Field(default=None, alias="loginV2") - permission_check_v2: Optional[StrictBool] = Field(default=None, alias="permissionCheckV2") - console_use_v2_user_api: Optional[StrictBool] = Field(default=None, alias="consoleUseV2UserApi") - __properties: ClassVar[List[str]] = ["loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "debugOidcParentError", "oidcSingleV1SessionTermination", "enableBackChannelLogout", "loginV2", "permissionCheckV2", "consoleUseV2UserApi"] + permission_check_v2: Optional[StrictBool] = Field( + default=None, alias="permissionCheckV2" + ) + console_use_v2_user_api: Optional[StrictBool] = Field( + default=None, alias="consoleUseV2UserApi" + ) + @field_validator("oidc_token_exchange") + def oidc_token_exchange_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `oidc_token_exchange` is set.""" + if value is not None: + warnings.warn( + "field 'oidc_token_exchange' on FeatureServiceSetInstanceFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + @field_validator("enable_back_channel_logout") + def enable_back_channel_logout_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `enable_back_channel_logout` is set.""" + if value is not None: + warnings.warn( + "field 'enable_back_channel_logout' on FeatureServiceSetInstanceFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,104 +84,9 @@ class FeatureServiceSetInstanceFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetInstanceFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - # set to None if login_default_org (nullable) is None - # and model_fields_set contains the field - if self.login_default_org is None and "login_default_org" in self.model_fields_set: - _dict['loginDefaultOrg'] = None - - # set to None if user_schema (nullable) is None - # and model_fields_set contains the field - if self.user_schema is None and "user_schema" in self.model_fields_set: - _dict['userSchema'] = None - - # set to None if oidc_token_exchange (nullable) is None - # and model_fields_set contains the field - if self.oidc_token_exchange is None and "oidc_token_exchange" in self.model_fields_set: - _dict['oidcTokenExchange'] = None - - # set to None if debug_oidc_parent_error (nullable) is None - # and model_fields_set contains the field - if self.debug_oidc_parent_error is None and "debug_oidc_parent_error" in self.model_fields_set: - _dict['debugOidcParentError'] = None - - # set to None if oidc_single_v1_session_termination (nullable) is None - # and model_fields_set contains the field - if self.oidc_single_v1_session_termination is None and "oidc_single_v1_session_termination" in self.model_fields_set: - _dict['oidcSingleV1SessionTermination'] = None - - # set to None if enable_back_channel_logout (nullable) is None - # and model_fields_set contains the field - if self.enable_back_channel_logout is None and "enable_back_channel_logout" in self.model_fields_set: - _dict['enableBackChannelLogout'] = None - - # set to None if permission_check_v2 (nullable) is None - # and model_fields_set contains the field - if self.permission_check_v2 is None and "permission_check_v2" in self.model_fields_set: - _dict['permissionCheckV2'] = None - - # set to None if console_use_v2_user_api (nullable) is None - # and model_fields_set contains the field - if self.console_use_v2_user_api is None and "console_use_v2_user_api" in self.model_fields_set: - _dict['consoleUseV2UserApi'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetInstanceFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginDefaultOrg": obj.get("loginDefaultOrg"), - "userSchema": obj.get("userSchema"), - "oidcTokenExchange": obj.get("oidcTokenExchange"), - "improvedPerformance": obj.get("improvedPerformance"), - "debugOidcParentError": obj.get("debugOidcParentError"), - "oidcSingleV1SessionTermination": obj.get("oidcSingleV1SessionTermination"), - "enableBackChannelLogout": obj.get("enableBackChannelLogout"), - "loginV2": FeatureServiceLoginV2.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None, - "permissionCheckV2": obj.get("permissionCheckV2"), - "consoleUseV2UserApi": obj.get("consoleUseV2UserApi") - }) - return _obj - +from zitadel_client.models.feature_service_improved_performance import ( + FeatureServiceImprovedPerformance, +) +from zitadel_client.models.feature_service_login_v2 import FeatureServiceLoginV2 +FeatureServiceSetInstanceFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_instance_features_response.py b/zitadel_client/models/feature_service_set_instance_features_response.py index 8ab347e5..a52f1675 100644 --- a/zitadel_client/models/feature_service_set_instance_features_response.py +++ b/zitadel_client/models/feature_service_set_instance_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceSetInstanceFeaturesResponse(BaseModel): """ FeatureServiceSetInstanceFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceSetInstanceFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetInstanceFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetInstanceFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceSetInstanceFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_organization_features_request.py b/zitadel_client/models/feature_service_set_organization_features_request.py index 0c3673cd..b1ddc206 100644 --- a/zitadel_client/models/feature_service_set_organization_features_request.py +++ b/zitadel_client/models/feature_service_set_organization_features_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class FeatureServiceSetOrganizationFeaturesRequest(BaseModel): """ FeatureServiceSetOrganizationFeaturesRequest - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class FeatureServiceSetOrganizationFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetOrganizationFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetOrganizationFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +FeatureServiceSetOrganizationFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_organization_features_response.py b/zitadel_client/models/feature_service_set_organization_features_response.py index 1005a4c7..4c258104 100644 --- a/zitadel_client/models/feature_service_set_organization_features_response.py +++ b/zitadel_client/models/feature_service_set_organization_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceSetOrganizationFeaturesResponse(BaseModel): """ FeatureServiceSetOrganizationFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceSetOrganizationFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetOrganizationFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetOrganizationFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceSetOrganizationFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_system_features_request.py b/zitadel_client/models/feature_service_set_system_features_request.py index 4173664c..688b140b 100644 --- a/zitadel_client/models/feature_service_set_system_features_request.py +++ b/zitadel_client/models/feature_service_set_system_features_request.py @@ -1,43 +1,76 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.feature_service_improved_performance import FeatureServiceImprovedPerformance -from zitadel_client.models.feature_service_login_v2 import FeatureServiceLoginV2 -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictBool +from typing import Any, List, Optional + class FeatureServiceSetSystemFeaturesRequest(BaseModel): """ FeatureServiceSetSystemFeaturesRequest - """ # noqa: E501 - login_default_org: Optional[StrictBool] = Field(default=None, alias="loginDefaultOrg") + """ + + login_default_org: Optional[StrictBool] = Field( + default=None, alias="loginDefaultOrg" + ) user_schema: Optional[StrictBool] = Field(default=None, alias="userSchema") - oidc_token_exchange: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="oidcTokenExchange") - improved_performance: Optional[List[FeatureServiceImprovedPerformance]] = Field(default=None, alias="improvedPerformance") - oidc_single_v1_session_termination: Optional[StrictBool] = Field(default=None, alias="oidcSingleV1SessionTermination") - enable_back_channel_logout: Optional[StrictBool] = Field(default=None, description="Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", alias="enableBackChannelLogout") + # .. deprecated:: This property is deprecated. + oidc_token_exchange: Optional[StrictBool] = Field( + default=None, + alias="oidcTokenExchange", + description="Deprecated: the flag has been removed and `urn:ietf:params:oauth:grant-type:token-exchange` grant type for the OIDC token endpoint is enabled by default. Token exchange can be used to request tokens with a lesser scope or impersonate other users. See the security policy to allow impersonation on an instance. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) + improved_performance: Optional[List[FeatureServiceImprovedPerformance]] = Field( + default=None, alias="improvedPerformance" + ) + oidc_single_v1_session_termination: Optional[StrictBool] = Field( + default=None, alias="oidcSingleV1SessionTermination" + ) + # .. deprecated:: This property is deprecated. + enable_back_channel_logout: Optional[StrictBool] = Field( + default=None, + alias="enableBackChannelLogout", + description="Deprecated: the flag has been removed and OIDC Back-Channel Logout is always enabled. This field is only kept for backward compatibility and will be removed in the next major version of Zitadel. Setting the field will have no effect.", + ) login_v2: Optional[FeatureServiceLoginV2] = Field(default=None, alias="loginV2") - permission_check_v2: Optional[StrictBool] = Field(default=None, alias="permissionCheckV2") - __properties: ClassVar[List[str]] = ["loginDefaultOrg", "userSchema", "oidcTokenExchange", "improvedPerformance", "oidcSingleV1SessionTermination", "enableBackChannelLogout", "loginV2", "permissionCheckV2"] + permission_check_v2: Optional[StrictBool] = Field( + default=None, alias="permissionCheckV2" + ) + @field_validator("oidc_token_exchange") + def oidc_token_exchange_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `oidc_token_exchange` is set.""" + if value is not None: + warnings.warn( + "field 'oidc_token_exchange' on FeatureServiceSetSystemFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + @field_validator("enable_back_channel_logout") + def enable_back_channel_logout_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `enable_back_channel_logout` is set.""" + if value is not None: + warnings.warn( + "field 'enable_back_channel_logout' on FeatureServiceSetSystemFeaturesRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,92 +78,9 @@ class FeatureServiceSetSystemFeaturesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetSystemFeaturesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of login_v2 - if self.login_v2: - _dict['loginV2'] = self.login_v2.to_dict() - # set to None if login_default_org (nullable) is None - # and model_fields_set contains the field - if self.login_default_org is None and "login_default_org" in self.model_fields_set: - _dict['loginDefaultOrg'] = None - - # set to None if user_schema (nullable) is None - # and model_fields_set contains the field - if self.user_schema is None and "user_schema" in self.model_fields_set: - _dict['userSchema'] = None - - # set to None if oidc_token_exchange (nullable) is None - # and model_fields_set contains the field - if self.oidc_token_exchange is None and "oidc_token_exchange" in self.model_fields_set: - _dict['oidcTokenExchange'] = None - - # set to None if oidc_single_v1_session_termination (nullable) is None - # and model_fields_set contains the field - if self.oidc_single_v1_session_termination is None and "oidc_single_v1_session_termination" in self.model_fields_set: - _dict['oidcSingleV1SessionTermination'] = None - - # set to None if enable_back_channel_logout (nullable) is None - # and model_fields_set contains the field - if self.enable_back_channel_logout is None and "enable_back_channel_logout" in self.model_fields_set: - _dict['enableBackChannelLogout'] = None - - # set to None if permission_check_v2 (nullable) is None - # and model_fields_set contains the field - if self.permission_check_v2 is None and "permission_check_v2" in self.model_fields_set: - _dict['permissionCheckV2'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetSystemFeaturesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginDefaultOrg": obj.get("loginDefaultOrg"), - "userSchema": obj.get("userSchema"), - "oidcTokenExchange": obj.get("oidcTokenExchange"), - "improvedPerformance": obj.get("improvedPerformance"), - "oidcSingleV1SessionTermination": obj.get("oidcSingleV1SessionTermination"), - "enableBackChannelLogout": obj.get("enableBackChannelLogout"), - "loginV2": FeatureServiceLoginV2.from_dict(obj["loginV2"]) if obj.get("loginV2") is not None else None, - "permissionCheckV2": obj.get("permissionCheckV2") - }) - return _obj - +from zitadel_client.models.feature_service_improved_performance import ( + FeatureServiceImprovedPerformance, +) +from zitadel_client.models.feature_service_login_v2 import FeatureServiceLoginV2 +FeatureServiceSetSystemFeaturesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_system_features_response.py b/zitadel_client/models/feature_service_set_system_features_response.py index ab9660fd..602da7d7 100644 --- a/zitadel_client/models/feature_service_set_system_features_response.py +++ b/zitadel_client/models/feature_service_set_system_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceSetSystemFeaturesResponse(BaseModel): """ FeatureServiceSetSystemFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceSetSystemFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetSystemFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetSystemFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceSetSystemFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_user_feature_request.py b/zitadel_client/models/feature_service_set_user_feature_request.py index 45650af5..03c37426 100644 --- a/zitadel_client/models/feature_service_set_user_feature_request.py +++ b/zitadel_client/models/feature_service_set_user_feature_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class FeatureServiceSetUserFeatureRequest(BaseModel): """ FeatureServiceSetUserFeatureRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class FeatureServiceSetUserFeatureRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetUserFeatureRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetUserFeatureRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +FeatureServiceSetUserFeatureRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_set_user_features_response.py b/zitadel_client/models/feature_service_set_user_features_response.py index 01e5ff80..0fedb7eb 100644 --- a/zitadel_client/models/feature_service_set_user_features_response.py +++ b/zitadel_client/models/feature_service_set_user_features_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.feature_service_details import FeatureServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class FeatureServiceSetUserFeaturesResponse(BaseModel): """ FeatureServiceSetUserFeaturesResponse - """ # noqa: E501 - details: Optional[FeatureServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[FeatureServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class FeatureServiceSetUserFeaturesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FeatureServiceSetUserFeaturesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FeatureServiceSetUserFeaturesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": FeatureServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.feature_service_details import FeatureServiceDetails +FeatureServiceSetUserFeaturesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/feature_service_source.py b/zitadel_client/models/feature_service_source.py index 129079ca..45317bc4 100644 --- a/zitadel_client/models/feature_service_source.py +++ b/zitadel_client/models/feature_service_source.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class FeatureServiceSource(str, Enum): @@ -23,20 +13,10 @@ class FeatureServiceSource(str, Enum): FeatureServiceSource """ - """ - allowed enum values - """ - SOURCE_UNSPECIFIED = 'SOURCE_UNSPECIFIED' - SOURCE_SYSTEM = 'SOURCE_SYSTEM' - SOURCE_INSTANCE = 'SOURCE_INSTANCE' - SOURCE_ORGANIZATION = 'SOURCE_ORGANIZATION' - SOURCE_PROJECT = 'SOURCE_PROJECT' - SOURCE_APP = 'SOURCE_APP' - SOURCE_USER = 'SOURCE_USER' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of FeatureServiceSource from a JSON string""" - return cls(json.loads(json_str)) - - + SOURCE_UNSPECIFIED = "SOURCE_UNSPECIFIED" + SOURCE_SYSTEM = "SOURCE_SYSTEM" + SOURCE_INSTANCE = "SOURCE_INSTANCE" + SOURCE_ORGANIZATION = "SOURCE_ORGANIZATION" + SOURCE_PROJECT = "SOURCE_PROJECT" + SOURCE_APP = "SOURCE_APP" + SOURCE_USER = "SOURCE_USER" diff --git a/zitadel_client/models/identity_provider_service_any.py b/zitadel_client/models/identity_provider_service_any.py index c4dedc3b..91d6f771 100644 --- a/zitadel_client/models/identity_provider_service_any.py +++ b/zitadel_client/models/identity_provider_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class IdentityProviderServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +IdentityProviderServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_apple_config.py b/zitadel_client/models/identity_provider_service_apple_config.py index 820d7bf9..47c55e63 100644 --- a/zitadel_client/models/identity_provider_service_apple_config.py +++ b/zitadel_client/models/identity_provider_service_apple_config.py @@ -1,37 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceAppleConfig(BaseModel): """ IdentityProviderServiceAppleConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="Client id (App ID or Service ID) provided by Apple.", alias="clientId") - team_id: Optional[StrictStr] = Field(default=None, description="Team ID provided by Apple.", alias="teamId") - key_id: Optional[StrictStr] = Field(default=None, description="ID of the private key generated by Apple.", alias="keyId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to Apple.") - __properties: ClassVar[List[str]] = ["clientId", "teamId", "keyId", "scopes"] + """ + + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id (App ID or Service ID) provided by Apple.", + ) + team_id: Optional[StrictStr] = Field( + default=None, alias="teamId", description="Team ID provided by Apple." + ) + key_id: Optional[StrictStr] = Field( + default=None, + alias="keyId", + description="ID of the private key generated by Apple.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to Apple.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +47,4 @@ class IdentityProviderServiceAppleConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAppleConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAppleConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "teamId": obj.get("teamId"), - "keyId": obj.get("keyId"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceAppleConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_auto_linking_option.py b/zitadel_client/models/identity_provider_service_auto_linking_option.py index e1913f36..f367afa6 100644 --- a/zitadel_client/models/identity_provider_service_auto_linking_option.py +++ b/zitadel_client/models/identity_provider_service_auto_linking_option.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceAutoLinkingOption(str, Enum): @@ -23,16 +13,6 @@ class IdentityProviderServiceAutoLinkingOption(str, Enum): IdentityProviderServiceAutoLinkingOption """ - """ - allowed enum values - """ - AUTO_LINKING_OPTION_UNSPECIFIED = 'AUTO_LINKING_OPTION_UNSPECIFIED' - AUTO_LINKING_OPTION_USERNAME = 'AUTO_LINKING_OPTION_USERNAME' - AUTO_LINKING_OPTION_EMAIL = 'AUTO_LINKING_OPTION_EMAIL' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceAutoLinkingOption from a JSON string""" - return cls(json.loads(json_str)) - - + AUTO_LINKING_OPTION_UNSPECIFIED = "AUTO_LINKING_OPTION_UNSPECIFIED" + AUTO_LINKING_OPTION_USERNAME = "AUTO_LINKING_OPTION_USERNAME" + AUTO_LINKING_OPTION_EMAIL = "AUTO_LINKING_OPTION_EMAIL" diff --git a/zitadel_client/models/identity_provider_service_azure_ad_config.py b/zitadel_client/models/identity_provider_service_azure_ad_config.py index ff59f020..93e98460 100644 --- a/zitadel_client/models/identity_provider_service_azure_ad_config.py +++ b/zitadel_client/models/identity_provider_service_azure_ad_config.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.identity_provider_service_azure_ad_tenant import IdentityProviderServiceAzureADTenant -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class IdentityProviderServiceAzureADConfig(BaseModel): """ IdentityProviderServiceAzureADConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="Client id of the Azure AD application", alias="clientId") - tenant: Optional[IdentityProviderServiceAzureADTenant] = None - email_verified: Optional[StrictBool] = Field(default=None, description="Azure AD doesn't send if the email has been verified. Enable this if the user email should always be added verified in ZITADEL (no verification emails will be sent).", alias="emailVerified") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to Azure AD.") - __properties: ClassVar[List[str]] = ["clientId", "tenant", "emailVerified", "scopes"] + """ + + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id of the Azure AD application", + ) + tenant: Optional[IdentityProviderServiceAzureADTenant] = Field( + default=None, alias="tenant" + ) + email_verified: Optional[StrictBool] = Field( + default=None, + alias="emailVerified", + description="Azure AD doesn't send if the email has been verified. Enable this if the user email should always be added verified in ZITADEL (no verification emails will be sent).", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to Azure AD.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +47,8 @@ class IdentityProviderServiceAzureADConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAzureADConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of tenant - if self.tenant: - _dict['tenant'] = self.tenant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAzureADConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "tenant": IdentityProviderServiceAzureADTenant.from_dict(obj["tenant"]) if obj.get("tenant") is not None else None, - "emailVerified": obj.get("emailVerified"), - "scopes": obj.get("scopes") - }) - return _obj - +from zitadel_client.models.identity_provider_service_azure_ad_tenant import ( + IdentityProviderServiceAzureADTenant, +) +IdentityProviderServiceAzureADConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_azure_ad_tenant.py b/zitadel_client/models/identity_provider_service_azure_ad_tenant.py index 644eda6f..3603df52 100644 --- a/zitadel_client/models/identity_provider_service_azure_ad_tenant.py +++ b/zitadel_client/models/identity_provider_service_azure_ad_tenant.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.identity_provider_service_azure_ad_tenant_type import IdentityProviderServiceAzureADTenantType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceAzureADTenant(BaseModel): """ IdentityProviderServiceAzureADTenant - """ # noqa: E501 + """ + tenant_id: Optional[StrictStr] = Field(default=None, alias="tenantId") - tenant_type: Optional[IdentityProviderServiceAzureADTenantType] = Field(default=None, alias="tenantType") - __properties: ClassVar[List[str]] = ["tenantId", "tenantType"] + tenant_type: Optional[IdentityProviderServiceAzureADTenantType] = Field( + default=None, alias="tenantType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class IdentityProviderServiceAzureADTenant(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAzureADTenant from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceAzureADTenant from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "tenantId": obj.get("tenantId"), - "tenantType": obj.get("tenantType") - }) - return _obj - +from zitadel_client.models.identity_provider_service_azure_ad_tenant_type import ( + IdentityProviderServiceAzureADTenantType, +) +IdentityProviderServiceAzureADTenant.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_azure_ad_tenant_type.py b/zitadel_client/models/identity_provider_service_azure_ad_tenant_type.py index f0973c35..3dfd16cd 100644 --- a/zitadel_client/models/identity_provider_service_azure_ad_tenant_type.py +++ b/zitadel_client/models/identity_provider_service_azure_ad_tenant_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceAzureADTenantType(str, Enum): @@ -23,16 +13,6 @@ class IdentityProviderServiceAzureADTenantType(str, Enum): IdentityProviderServiceAzureADTenantType """ - """ - allowed enum values - """ - AZURE_AD_TENANT_TYPE_COMMON = 'AZURE_AD_TENANT_TYPE_COMMON' - AZURE_AD_TENANT_TYPE_ORGANISATIONS = 'AZURE_AD_TENANT_TYPE_ORGANISATIONS' - AZURE_AD_TENANT_TYPE_CONSUMERS = 'AZURE_AD_TENANT_TYPE_CONSUMERS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceAzureADTenantType from a JSON string""" - return cls(json.loads(json_str)) - - + AZURE_AD_TENANT_TYPE_COMMON = "AZURE_AD_TENANT_TYPE_COMMON" + AZURE_AD_TENANT_TYPE_ORGANISATIONS = "AZURE_AD_TENANT_TYPE_ORGANISATIONS" + AZURE_AD_TENANT_TYPE_CONSUMERS = "AZURE_AD_TENANT_TYPE_CONSUMERS" diff --git a/zitadel_client/models/identity_provider_service_connect_error.py b/zitadel_client/models/identity_provider_service_connect_error.py index 7d83ad1b..2d220ab5 100644 --- a/zitadel_client/models/identity_provider_service_connect_error.py +++ b/zitadel_client/models/identity_provider_service_connect_error.py @@ -1,122 +1,171 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.identity_provider_service_any import IdentityProviderServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class IdentityProviderServiceConnectErrorCodeEnum(str, Enum): + """IdentityProviderServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class IdentityProviderServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[IdentityProviderServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[IdentityProviderServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[IdentityProviderServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [IdentityProviderServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.identity_provider_service_any import ( + IdentityProviderServiceAny, +) +IdentityProviderServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_details.py b/zitadel_client/models/identity_provider_service_details.py index 0f722054..abffed24 100644 --- a/zitadel_client/models/identity_provider_service_details.py +++ b/zitadel_client/models/identity_provider_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceDetails(BaseModel): """ IdentityProviderServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class IdentityProviderServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +IdentityProviderServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_generic_oidc_config.py b/zitadel_client/models/identity_provider_service_generic_oidc_config.py index 7e6a35fa..087f727d 100644 --- a/zitadel_client/models/identity_provider_service_generic_oidc_config.py +++ b/zitadel_client/models/identity_provider_service_generic_oidc_config.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class IdentityProviderServiceGenericOIDCConfig(BaseModel): """ IdentityProviderServiceGenericOIDCConfig - """ # noqa: E501 - issuer: Optional[StrictStr] = Field(default=None, description="The OIDC issuer of the identity provider.") - client_id: Optional[StrictStr] = Field(default=None, description="Client id generated by the identity provider.", alias="clientId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request on the identity provider.") - is_id_token_mapping: Optional[StrictBool] = Field(default=None, description="If true, provider information get mapped from the id token, not from the userinfo endpoint.", alias="isIdTokenMapping") - __properties: ClassVar[List[str]] = ["issuer", "clientId", "scopes", "isIdTokenMapping"] + """ + + issuer: Optional[StrictStr] = Field( + default=None, + alias="issuer", + description="The OIDC issuer of the identity provider.", + ) + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id generated by the identity provider.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request on the identity provider.", + ) + is_id_token_mapping: Optional[StrictBool] = Field( + default=None, + alias="isIdTokenMapping", + description="If true, provider information get mapped from the id token, not from the userinfo endpoint.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +49,4 @@ class IdentityProviderServiceGenericOIDCConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGenericOIDCConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGenericOIDCConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "issuer": obj.get("issuer"), - "clientId": obj.get("clientId"), - "scopes": obj.get("scopes"), - "isIdTokenMapping": obj.get("isIdTokenMapping") - }) - return _obj - - +IdentityProviderServiceGenericOIDCConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_get_idpby_id_request.py b/zitadel_client/models/identity_provider_service_get_idpby_id_request.py index 48f56b16..e090ceaf 100644 --- a/zitadel_client/models/identity_provider_service_get_idpby_id_request.py +++ b/zitadel_client/models/identity_provider_service_get_idpby_id_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceGetIDPByIDRequest(BaseModel): """ IdentityProviderServiceGetIDPByIDRequest - """ # noqa: E501 - id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class IdentityProviderServiceGetIDPByIDRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGetIDPByIDRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGetIDPByIDRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +IdentityProviderServiceGetIDPByIDRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_get_idpby_id_response.py b/zitadel_client/models/identity_provider_service_get_idpby_id_response.py index 29055ac8..e9c4c3d2 100644 --- a/zitadel_client/models/identity_provider_service_get_idpby_id_response.py +++ b/zitadel_client/models/identity_provider_service_get_idpby_id_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.identity_provider_service_idp import IdentityProviderServiceIDP -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class IdentityProviderServiceGetIDPByIDResponse(BaseModel): """ IdentityProviderServiceGetIDPByIDResponse - """ # noqa: E501 - idp: Optional[IdentityProviderServiceIDP] = None - __properties: ClassVar[List[str]] = ["idp"] + """ + idp: Optional[IdentityProviderServiceIDP] = Field(default=None, alias="idp") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class IdentityProviderServiceGetIDPByIDResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGetIDPByIDResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of idp - if self.idp: - _dict['idp'] = self.idp.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGetIDPByIDResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idp": IdentityProviderServiceIDP.from_dict(obj["idp"]) if obj.get("idp") is not None else None - }) - return _obj - +from zitadel_client.models.identity_provider_service_idp import ( + IdentityProviderServiceIDP, +) +IdentityProviderServiceGetIDPByIDResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_git_hub_config.py b/zitadel_client/models/identity_provider_service_git_hub_config.py index 4b90c64b..2dff3df2 100644 --- a/zitadel_client/models/identity_provider_service_git_hub_config.py +++ b/zitadel_client/models/identity_provider_service_git_hub_config.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceGitHubConfig(BaseModel): """ IdentityProviderServiceGitHubConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The client ID of the GitHub App.", alias="clientId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to GitHub.") - __properties: ClassVar[List[str]] = ["clientId", "scopes"] + """ + client_id: Optional[StrictStr] = Field( + default=None, alias="clientId", description="The client ID of the GitHub App." + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to GitHub.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class IdentityProviderServiceGitHubConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitHubConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitHubConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceGitHubConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_git_hub_enterprise_server_config.py b/zitadel_client/models/identity_provider_service_git_hub_enterprise_server_config.py index c538ca90..64d61db8 100644 --- a/zitadel_client/models/identity_provider_service_git_hub_enterprise_server_config.py +++ b/zitadel_client/models/identity_provider_service_git_hub_enterprise_server_config.py @@ -1,38 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceGitHubEnterpriseServerConfig(BaseModel): """ IdentityProviderServiceGitHubEnterpriseServerConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="The client ID of the GitHub App.", alias="clientId") - authorization_endpoint: Optional[StrictStr] = Field(default=None, alias="authorizationEndpoint") + """ + + client_id: Optional[StrictStr] = Field( + default=None, alias="clientId", description="The client ID of the GitHub App." + ) + authorization_endpoint: Optional[StrictStr] = Field( + default=None, alias="authorizationEndpoint" + ) token_endpoint: Optional[StrictStr] = Field(default=None, alias="tokenEndpoint") user_endpoint: Optional[StrictStr] = Field(default=None, alias="userEndpoint") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to GitHub.") - __properties: ClassVar[List[str]] = ["clientId", "authorizationEndpoint", "tokenEndpoint", "userEndpoint", "scopes"] + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to GitHub.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +42,4 @@ class IdentityProviderServiceGitHubEnterpriseServerConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitHubEnterpriseServerConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitHubEnterpriseServerConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "authorizationEndpoint": obj.get("authorizationEndpoint"), - "tokenEndpoint": obj.get("tokenEndpoint"), - "userEndpoint": obj.get("userEndpoint"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceGitHubEnterpriseServerConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_git_lab_config.py b/zitadel_client/models/identity_provider_service_git_lab_config.py index d5e8a628..d2b8a475 100644 --- a/zitadel_client/models/identity_provider_service_git_lab_config.py +++ b/zitadel_client/models/identity_provider_service_git_lab_config.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceGitLabConfig(BaseModel): """ IdentityProviderServiceGitLabConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="Client id of the GitLab application.", alias="clientId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to GitLab.") - __properties: ClassVar[List[str]] = ["clientId", "scopes"] + """ + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id of the GitLab application.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to GitLab.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class IdentityProviderServiceGitLabConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitLabConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitLabConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceGitLabConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_git_lab_self_hosted_config.py b/zitadel_client/models/identity_provider_service_git_lab_self_hosted_config.py index 64e9ceed..b7f4ea46 100644 --- a/zitadel_client/models/identity_provider_service_git_lab_self_hosted_config.py +++ b/zitadel_client/models/identity_provider_service_git_lab_self_hosted_config.py @@ -1,36 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceGitLabSelfHostedConfig(BaseModel): """ IdentityProviderServiceGitLabSelfHostedConfig - """ # noqa: E501 - issuer: Optional[StrictStr] = None - client_id: Optional[StrictStr] = Field(default=None, description="Client id of the GitLab application.", alias="clientId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to GitLab.") - __properties: ClassVar[List[str]] = ["issuer", "clientId", "scopes"] + """ + issuer: Optional[StrictStr] = Field(default=None, alias="issuer") + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id of the GitLab application.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to GitLab.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +40,4 @@ class IdentityProviderServiceGitLabSelfHostedConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitLabSelfHostedConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGitLabSelfHostedConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "issuer": obj.get("issuer"), - "clientId": obj.get("clientId"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceGitLabSelfHostedConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_google_config.py b/zitadel_client/models/identity_provider_service_google_config.py index 39cb1bab..36b61bf2 100644 --- a/zitadel_client/models/identity_provider_service_google_config.py +++ b/zitadel_client/models/identity_provider_service_google_config.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceGoogleConfig(BaseModel): """ IdentityProviderServiceGoogleConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="Client id of the Google application.", alias="clientId") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request to Google.") - __properties: ClassVar[List[str]] = ["clientId", "scopes"] + """ + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id of the Google application.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request to Google.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class IdentityProviderServiceGoogleConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGoogleConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceGoogleConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "scopes": obj.get("scopes") - }) - return _obj - - +IdentityProviderServiceGoogleConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_idp.py b/zitadel_client/models/identity_provider_service_idp.py index 9947b18d..6a95f9e0 100644 --- a/zitadel_client/models/identity_provider_service_idp.py +++ b/zitadel_client/models/identity_provider_service_idp.py @@ -1,43 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.identity_provider_service_details import IdentityProviderServiceDetails -from zitadel_client.models.identity_provider_service_idp_config import IdentityProviderServiceIDPConfig -from zitadel_client.models.identity_provider_service_idp_state import IdentityProviderServiceIDPState -from zitadel_client.models.identity_provider_service_idp_type import IdentityProviderServiceIDPType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceIDP(BaseModel): """ IdentityProviderServiceIDP - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier for the identity provider.") - details: Optional[IdentityProviderServiceDetails] = None - state: Optional[IdentityProviderServiceIDPState] = None - name: Optional[StrictStr] = None - type: Optional[IdentityProviderServiceIDPType] = None - config: Optional[IdentityProviderServiceIDPConfig] = None - __properties: ClassVar[List[str]] = ["id", "details", "state", "name", "type", "config"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Unique identifier for the identity provider.", + ) + details: Optional[IdentityProviderServiceDetails] = Field( + default=None, alias="details" + ) + state: Optional[IdentityProviderServiceIDPState] = Field( + default=None, alias="state" + ) + name: Optional[StrictStr] = Field(default=None, alias="name") + type: Optional[IdentityProviderServiceIDPType] = Field(default=None, alias="type") + config: Optional[IdentityProviderServiceIDPConfig] = Field( + default=None, alias="config" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,63 +45,17 @@ class IdentityProviderServiceIDP(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceIDP from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of config - if self.config: - _dict['config'] = self.config.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceIDP from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "details": IdentityProviderServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "state": obj.get("state"), - "name": obj.get("name"), - "type": obj.get("type"), - "config": IdentityProviderServiceIDPConfig.from_dict(obj["config"]) if obj.get("config") is not None else None - }) - return _obj - - +from zitadel_client.models.identity_provider_service_details import ( + IdentityProviderServiceDetails, +) +from zitadel_client.models.identity_provider_service_idp_config import ( + IdentityProviderServiceIDPConfig, +) +from zitadel_client.models.identity_provider_service_idp_state import ( + IdentityProviderServiceIDPState, +) +from zitadel_client.models.identity_provider_service_idp_type import ( + IdentityProviderServiceIDPType, +) + +IdentityProviderServiceIDP.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_idp_config.py b/zitadel_client/models/identity_provider_service_idp_config.py index e48a029e..dfb7b151 100644 --- a/zitadel_client/models/identity_provider_service_idp_config.py +++ b/zitadel_client/models/identity_provider_service_idp_config.py @@ -1,59 +1,63 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.identity_provider_service_apple_config import IdentityProviderServiceAppleConfig -from zitadel_client.models.identity_provider_service_azure_ad_config import IdentityProviderServiceAzureADConfig -from zitadel_client.models.identity_provider_service_generic_oidc_config import IdentityProviderServiceGenericOIDCConfig -from zitadel_client.models.identity_provider_service_git_hub_config import IdentityProviderServiceGitHubConfig -from zitadel_client.models.identity_provider_service_git_hub_enterprise_server_config import IdentityProviderServiceGitHubEnterpriseServerConfig -from zitadel_client.models.identity_provider_service_git_lab_config import IdentityProviderServiceGitLabConfig -from zitadel_client.models.identity_provider_service_git_lab_self_hosted_config import IdentityProviderServiceGitLabSelfHostedConfig -from zitadel_client.models.identity_provider_service_google_config import IdentityProviderServiceGoogleConfig -from zitadel_client.models.identity_provider_service_jwt_config import IdentityProviderServiceJWTConfig -from zitadel_client.models.identity_provider_service_ldap_config import IdentityProviderServiceLDAPConfig -from zitadel_client.models.identity_provider_service_o_auth_config import IdentityProviderServiceOAuthConfig -from zitadel_client.models.identity_provider_service_options import IdentityProviderServiceOptions -from zitadel_client.models.identity_provider_service_saml_config import IdentityProviderServiceSAMLConfig -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class IdentityProviderServiceIDPConfig(BaseModel): """ IdentityProviderServiceIDPConfig - """ # noqa: E501 - options: Optional[IdentityProviderServiceOptions] = None - apple: Optional[IdentityProviderServiceAppleConfig] = None - azure_ad: Optional[IdentityProviderServiceAzureADConfig] = Field(default=None, alias="azureAd") - github: Optional[IdentityProviderServiceGitHubConfig] = None - github_es: Optional[IdentityProviderServiceGitHubEnterpriseServerConfig] = Field(default=None, alias="githubEs") - gitlab: Optional[IdentityProviderServiceGitLabConfig] = None - gitlab_self_hosted: Optional[IdentityProviderServiceGitLabSelfHostedConfig] = Field(default=None, alias="gitlabSelfHosted") - google: Optional[IdentityProviderServiceGoogleConfig] = None - jwt: Optional[IdentityProviderServiceJWTConfig] = None - ldap: Optional[IdentityProviderServiceLDAPConfig] = None - oauth: Optional[IdentityProviderServiceOAuthConfig] = None - oidc: Optional[IdentityProviderServiceGenericOIDCConfig] = None - saml: Optional[IdentityProviderServiceSAMLConfig] = None - __properties: ClassVar[List[str]] = ["options", "apple", "azureAd", "github", "githubEs", "gitlab", "gitlabSelfHosted", "google", "jwt", "ldap", "oauth", "oidc", "saml"] + """ + options: Optional[IdentityProviderServiceOptions] = Field( + default=None, alias="options" + ) + apple: Optional[IdentityProviderServiceAppleConfig] = Field( + default=None, alias="apple" + ) + azure_ad: Optional[IdentityProviderServiceAzureADConfig] = Field( + default=None, alias="azureAd" + ) + github: Optional[IdentityProviderServiceGitHubConfig] = Field( + default=None, alias="github" + ) + github_es: Optional[IdentityProviderServiceGitHubEnterpriseServerConfig] = Field( + default=None, alias="githubEs" + ) + gitlab: Optional[IdentityProviderServiceGitLabConfig] = Field( + default=None, alias="gitlab" + ) + gitlab_self_hosted: Optional[IdentityProviderServiceGitLabSelfHostedConfig] = Field( + default=None, alias="gitlabSelfHosted" + ) + google: Optional[IdentityProviderServiceGoogleConfig] = Field( + default=None, alias="google" + ) + jwt: Optional[IdentityProviderServiceJWTConfig] = Field(default=None, alias="jwt") + ldap: Optional[IdentityProviderServiceLDAPConfig] = Field( + default=None, alias="ldap" + ) + oauth: Optional[IdentityProviderServiceOAuthConfig] = Field( + default=None, alias="oauth" + ) + oidc: Optional[IdentityProviderServiceGenericOIDCConfig] = Field( + default=None, alias="oidc" + ) + saml: Optional[IdentityProviderServiceSAMLConfig] = Field( + default=None, alias="saml" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -61,103 +65,44 @@ class IdentityProviderServiceIDPConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceIDPConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of options - if self.options: - _dict['options'] = self.options.to_dict() - # override the default output from pydantic by calling `to_dict()` of apple - if self.apple: - _dict['apple'] = self.apple.to_dict() - # override the default output from pydantic by calling `to_dict()` of azure_ad - if self.azure_ad: - _dict['azureAd'] = self.azure_ad.to_dict() - # override the default output from pydantic by calling `to_dict()` of github - if self.github: - _dict['github'] = self.github.to_dict() - # override the default output from pydantic by calling `to_dict()` of github_es - if self.github_es: - _dict['githubEs'] = self.github_es.to_dict() - # override the default output from pydantic by calling `to_dict()` of gitlab - if self.gitlab: - _dict['gitlab'] = self.gitlab.to_dict() - # override the default output from pydantic by calling `to_dict()` of gitlab_self_hosted - if self.gitlab_self_hosted: - _dict['gitlabSelfHosted'] = self.gitlab_self_hosted.to_dict() - # override the default output from pydantic by calling `to_dict()` of google - if self.google: - _dict['google'] = self.google.to_dict() - # override the default output from pydantic by calling `to_dict()` of jwt - if self.jwt: - _dict['jwt'] = self.jwt.to_dict() - # override the default output from pydantic by calling `to_dict()` of ldap - if self.ldap: - _dict['ldap'] = self.ldap.to_dict() - # override the default output from pydantic by calling `to_dict()` of oauth - if self.oauth: - _dict['oauth'] = self.oauth.to_dict() - # override the default output from pydantic by calling `to_dict()` of oidc - if self.oidc: - _dict['oidc'] = self.oidc.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml - if self.saml: - _dict['saml'] = self.saml.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceIDPConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "options": IdentityProviderServiceOptions.from_dict(obj["options"]) if obj.get("options") is not None else None, - "apple": IdentityProviderServiceAppleConfig.from_dict(obj["apple"]) if obj.get("apple") is not None else None, - "azureAd": IdentityProviderServiceAzureADConfig.from_dict(obj["azureAd"]) if obj.get("azureAd") is not None else None, - "github": IdentityProviderServiceGitHubConfig.from_dict(obj["github"]) if obj.get("github") is not None else None, - "githubEs": IdentityProviderServiceGitHubEnterpriseServerConfig.from_dict(obj["githubEs"]) if obj.get("githubEs") is not None else None, - "gitlab": IdentityProviderServiceGitLabConfig.from_dict(obj["gitlab"]) if obj.get("gitlab") is not None else None, - "gitlabSelfHosted": IdentityProviderServiceGitLabSelfHostedConfig.from_dict(obj["gitlabSelfHosted"]) if obj.get("gitlabSelfHosted") is not None else None, - "google": IdentityProviderServiceGoogleConfig.from_dict(obj["google"]) if obj.get("google") is not None else None, - "jwt": IdentityProviderServiceJWTConfig.from_dict(obj["jwt"]) if obj.get("jwt") is not None else None, - "ldap": IdentityProviderServiceLDAPConfig.from_dict(obj["ldap"]) if obj.get("ldap") is not None else None, - "oauth": IdentityProviderServiceOAuthConfig.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, - "oidc": IdentityProviderServiceGenericOIDCConfig.from_dict(obj["oidc"]) if obj.get("oidc") is not None else None, - "saml": IdentityProviderServiceSAMLConfig.from_dict(obj["saml"]) if obj.get("saml") is not None else None - }) - return _obj - - +from zitadel_client.models.identity_provider_service_apple_config import ( + IdentityProviderServiceAppleConfig, +) +from zitadel_client.models.identity_provider_service_azure_ad_config import ( + IdentityProviderServiceAzureADConfig, +) +from zitadel_client.models.identity_provider_service_generic_oidc_config import ( + IdentityProviderServiceGenericOIDCConfig, +) +from zitadel_client.models.identity_provider_service_git_hub_config import ( + IdentityProviderServiceGitHubConfig, +) +from zitadel_client.models.identity_provider_service_git_hub_enterprise_server_config import ( + IdentityProviderServiceGitHubEnterpriseServerConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_config import ( + IdentityProviderServiceGitLabConfig, +) +from zitadel_client.models.identity_provider_service_git_lab_self_hosted_config import ( + IdentityProviderServiceGitLabSelfHostedConfig, +) +from zitadel_client.models.identity_provider_service_google_config import ( + IdentityProviderServiceGoogleConfig, +) +from zitadel_client.models.identity_provider_service_jwt_config import ( + IdentityProviderServiceJWTConfig, +) +from zitadel_client.models.identity_provider_service_ldap_config import ( + IdentityProviderServiceLDAPConfig, +) +from zitadel_client.models.identity_provider_service_o_auth_config import ( + IdentityProviderServiceOAuthConfig, +) +from zitadel_client.models.identity_provider_service_options import ( + IdentityProviderServiceOptions, +) +from zitadel_client.models.identity_provider_service_saml_config import ( + IdentityProviderServiceSAMLConfig, +) + +IdentityProviderServiceIDPConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_idp_state.py b/zitadel_client/models/identity_provider_service_idp_state.py index 96093bf7..7ff5ec0c 100644 --- a/zitadel_client/models/identity_provider_service_idp_state.py +++ b/zitadel_client/models/identity_provider_service_idp_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceIDPState(str, Enum): @@ -23,18 +13,8 @@ class IdentityProviderServiceIDPState(str, Enum): IdentityProviderServiceIDPState """ - """ - allowed enum values - """ - IDP_STATE_UNSPECIFIED = 'IDP_STATE_UNSPECIFIED' - IDP_STATE_ACTIVE = 'IDP_STATE_ACTIVE' - IDP_STATE_INACTIVE = 'IDP_STATE_INACTIVE' - IDP_STATE_REMOVED = 'IDP_STATE_REMOVED' - IDP_STATE_MIGRATED = 'IDP_STATE_MIGRATED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceIDPState from a JSON string""" - return cls(json.loads(json_str)) - - + IDP_STATE_UNSPECIFIED = "IDP_STATE_UNSPECIFIED" + IDP_STATE_ACTIVE = "IDP_STATE_ACTIVE" + IDP_STATE_INACTIVE = "IDP_STATE_INACTIVE" + IDP_STATE_REMOVED = "IDP_STATE_REMOVED" + IDP_STATE_MIGRATED = "IDP_STATE_MIGRATED" diff --git a/zitadel_client/models/identity_provider_service_idp_type.py b/zitadel_client/models/identity_provider_service_idp_type.py index 5baf6634..be442bf2 100644 --- a/zitadel_client/models/identity_provider_service_idp_type.py +++ b/zitadel_client/models/identity_provider_service_idp_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceIDPType(str, Enum): @@ -23,26 +13,16 @@ class IdentityProviderServiceIDPType(str, Enum): IdentityProviderServiceIDPType """ - """ - allowed enum values - """ - IDP_TYPE_UNSPECIFIED = 'IDP_TYPE_UNSPECIFIED' - IDP_TYPE_OIDC = 'IDP_TYPE_OIDC' - IDP_TYPE_JWT = 'IDP_TYPE_JWT' - IDP_TYPE_LDAP = 'IDP_TYPE_LDAP' - IDP_TYPE_OAUTH = 'IDP_TYPE_OAUTH' - IDP_TYPE_AZURE_AD = 'IDP_TYPE_AZURE_AD' - IDP_TYPE_GITHUB = 'IDP_TYPE_GITHUB' - IDP_TYPE_GITHUB_ES = 'IDP_TYPE_GITHUB_ES' - IDP_TYPE_GITLAB = 'IDP_TYPE_GITLAB' - IDP_TYPE_GITLAB_SELF_HOSTED = 'IDP_TYPE_GITLAB_SELF_HOSTED' - IDP_TYPE_GOOGLE = 'IDP_TYPE_GOOGLE' - IDP_TYPE_APPLE = 'IDP_TYPE_APPLE' - IDP_TYPE_SAML = 'IDP_TYPE_SAML' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceIDPType from a JSON string""" - return cls(json.loads(json_str)) - - + IDP_TYPE_UNSPECIFIED = "IDP_TYPE_UNSPECIFIED" + IDP_TYPE_OIDC = "IDP_TYPE_OIDC" + IDP_TYPE_JWT = "IDP_TYPE_JWT" + IDP_TYPE_LDAP = "IDP_TYPE_LDAP" + IDP_TYPE_OAUTH = "IDP_TYPE_OAUTH" + IDP_TYPE_AZURE_AD = "IDP_TYPE_AZURE_AD" + IDP_TYPE_GITHUB = "IDP_TYPE_GITHUB" + IDP_TYPE_GITHUB_ES = "IDP_TYPE_GITHUB_ES" + IDP_TYPE_GITLAB = "IDP_TYPE_GITLAB" + IDP_TYPE_GITLAB_SELF_HOSTED = "IDP_TYPE_GITLAB_SELF_HOSTED" + IDP_TYPE_GOOGLE = "IDP_TYPE_GOOGLE" + IDP_TYPE_APPLE = "IDP_TYPE_APPLE" + IDP_TYPE_SAML = "IDP_TYPE_SAML" diff --git a/zitadel_client/models/identity_provider_service_jwt_config.py b/zitadel_client/models/identity_provider_service_jwt_config.py index 19302d25..b54a2638 100644 --- a/zitadel_client/models/identity_provider_service_jwt_config.py +++ b/zitadel_client/models/identity_provider_service_jwt_config.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceJWTConfig(BaseModel): """ IdentityProviderServiceJWTConfig - """ # noqa: E501 - jwt_endpoint: Optional[StrictStr] = Field(default=None, description="The endpoint where the JWT can be extracted.", alias="jwtEndpoint") - issuer: Optional[StrictStr] = Field(default=None, description="The issuer of the JWT (for validation).") - keys_endpoint: Optional[StrictStr] = Field(default=None, description="The endpoint to the key (JWK) which is used to sign the JWT with.", alias="keysEndpoint") - header_name: Optional[StrictStr] = Field(default=None, description="The name of the header where the JWT is sent in, default is authorization.", alias="headerName") - __properties: ClassVar[List[str]] = ["jwtEndpoint", "issuer", "keysEndpoint", "headerName"] + """ + + jwt_endpoint: Optional[StrictStr] = Field( + default=None, + alias="jwtEndpoint", + description="The endpoint where the JWT can be extracted.", + ) + issuer: Optional[StrictStr] = Field( + default=None, + alias="issuer", + description="The issuer of the JWT (for validation).", + ) + keys_endpoint: Optional[StrictStr] = Field( + default=None, + alias="keysEndpoint", + description="The endpoint to the key (JWK) which is used to sign the JWT with.", + ) + header_name: Optional[StrictStr] = Field( + default=None, + alias="headerName", + description="The name of the header where the JWT is sent in, default is authorization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +49,4 @@ class IdentityProviderServiceJWTConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceJWTConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceJWTConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "jwtEndpoint": obj.get("jwtEndpoint"), - "issuer": obj.get("issuer"), - "keysEndpoint": obj.get("keysEndpoint"), - "headerName": obj.get("headerName") - }) - return _obj - - +IdentityProviderServiceJWTConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_ldap_attributes.py b/zitadel_client/models/identity_provider_service_ldap_attributes.py index 84aefd34..2b21fb52 100644 --- a/zitadel_client/models/identity_provider_service_ldap_attributes.py +++ b/zitadel_client/models/identity_provider_service_ldap_attributes.py @@ -1,47 +1,61 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class IdentityProviderServiceLDAPAttributes(BaseModel): """ IdentityProviderServiceLDAPAttributes - """ # noqa: E501 + """ + id_attribute: Optional[StrictStr] = Field(default=None, alias="idAttribute") - first_name_attribute: Optional[StrictStr] = Field(default=None, alias="firstNameAttribute") - last_name_attribute: Optional[StrictStr] = Field(default=None, alias="lastNameAttribute") - display_name_attribute: Optional[StrictStr] = Field(default=None, alias="displayNameAttribute") - nick_name_attribute: Optional[StrictStr] = Field(default=None, alias="nickNameAttribute") - preferred_username_attribute: Optional[StrictStr] = Field(default=None, alias="preferredUsernameAttribute") + first_name_attribute: Optional[StrictStr] = Field( + default=None, alias="firstNameAttribute" + ) + last_name_attribute: Optional[StrictStr] = Field( + default=None, alias="lastNameAttribute" + ) + display_name_attribute: Optional[StrictStr] = Field( + default=None, alias="displayNameAttribute" + ) + nick_name_attribute: Optional[StrictStr] = Field( + default=None, alias="nickNameAttribute" + ) + preferred_username_attribute: Optional[StrictStr] = Field( + default=None, alias="preferredUsernameAttribute" + ) email_attribute: Optional[StrictStr] = Field(default=None, alias="emailAttribute") - email_verified_attribute: Optional[StrictStr] = Field(default=None, alias="emailVerifiedAttribute") + email_verified_attribute: Optional[StrictStr] = Field( + default=None, alias="emailVerifiedAttribute" + ) phone_attribute: Optional[StrictStr] = Field(default=None, alias="phoneAttribute") - phone_verified_attribute: Optional[StrictStr] = Field(default=None, alias="phoneVerifiedAttribute") - preferred_language_attribute: Optional[StrictStr] = Field(default=None, alias="preferredLanguageAttribute") - avatar_url_attribute: Optional[StrictStr] = Field(default=None, alias="avatarUrlAttribute") - profile_attribute: Optional[StrictStr] = Field(default=None, alias="profileAttribute") + phone_verified_attribute: Optional[StrictStr] = Field( + default=None, alias="phoneVerifiedAttribute" + ) + preferred_language_attribute: Optional[StrictStr] = Field( + default=None, alias="preferredLanguageAttribute" + ) + avatar_url_attribute: Optional[StrictStr] = Field( + default=None, alias="avatarUrlAttribute" + ) + profile_attribute: Optional[StrictStr] = Field( + default=None, alias="profileAttribute" + ) root_ca: Optional[StrictStr] = Field(default=None, alias="rootCa") - __properties: ClassVar[List[str]] = ["idAttribute", "firstNameAttribute", "lastNameAttribute", "displayNameAttribute", "nickNameAttribute", "preferredUsernameAttribute", "emailAttribute", "emailVerifiedAttribute", "phoneAttribute", "phoneVerifiedAttribute", "preferredLanguageAttribute", "avatarUrlAttribute", "profileAttribute", "rootCa"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -49,65 +63,4 @@ class IdentityProviderServiceLDAPAttributes(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceLDAPAttributes from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceLDAPAttributes from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idAttribute": obj.get("idAttribute"), - "firstNameAttribute": obj.get("firstNameAttribute"), - "lastNameAttribute": obj.get("lastNameAttribute"), - "displayNameAttribute": obj.get("displayNameAttribute"), - "nickNameAttribute": obj.get("nickNameAttribute"), - "preferredUsernameAttribute": obj.get("preferredUsernameAttribute"), - "emailAttribute": obj.get("emailAttribute"), - "emailVerifiedAttribute": obj.get("emailVerifiedAttribute"), - "phoneAttribute": obj.get("phoneAttribute"), - "phoneVerifiedAttribute": obj.get("phoneVerifiedAttribute"), - "preferredLanguageAttribute": obj.get("preferredLanguageAttribute"), - "avatarUrlAttribute": obj.get("avatarUrlAttribute"), - "profileAttribute": obj.get("profileAttribute"), - "rootCa": obj.get("rootCa") - }) - return _obj - - +IdentityProviderServiceLDAPAttributes.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_ldap_config.py b/zitadel_client/models/identity_provider_service_ldap_config.py index 3c8ca625..3be20d63 100644 --- a/zitadel_client/models/identity_provider_service_ldap_config.py +++ b/zitadel_client/models/identity_provider_service_ldap_config.py @@ -1,44 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from zitadel_client.models.identity_provider_service_ldap_attributes import IdentityProviderServiceLDAPAttributes -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class IdentityProviderServiceLDAPConfig(BaseModel): """ IdentityProviderServiceLDAPConfig - """ # noqa: E501 - servers: Optional[List[StrictStr]] = None + """ + + servers: Optional[List[StrictStr]] = Field(default=None, alias="servers") start_tls: Optional[StrictBool] = Field(default=None, alias="startTls") base_dn: Optional[StrictStr] = Field(default=None, alias="baseDn") bind_dn: Optional[StrictStr] = Field(default=None, alias="bindDn") user_base: Optional[StrictStr] = Field(default=None, alias="userBase") - user_object_classes: Optional[List[StrictStr]] = Field(default=None, alias="userObjectClasses") + user_object_classes: Optional[List[StrictStr]] = Field( + default=None, alias="userObjectClasses" + ) user_filters: Optional[List[StrictStr]] = Field(default=None, alias="userFilters") - timeout: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - attributes: Optional[IdentityProviderServiceLDAPAttributes] = None - root_ca: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, alias="rootCa") - __properties: ClassVar[List[str]] = ["servers", "startTls", "baseDn", "bindDn", "userBase", "userObjectClasses", "userFilters", "timeout", "attributes", "rootCa"] + timeout: Optional[ProtobufDuration] = Field( + default=None, + alias="timeout", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + attributes: Optional[IdentityProviderServiceLDAPAttributes] = Field( + default=None, alias="attributes" + ) + root_ca: Optional[Base64Bytes] = Field(default=None, alias="rootCa") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,64 +47,10 @@ class IdentityProviderServiceLDAPConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceLDAPConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of attributes - if self.attributes: - _dict['attributes'] = self.attributes.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceLDAPConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "servers": obj.get("servers"), - "startTls": obj.get("startTls"), - "baseDn": obj.get("baseDn"), - "bindDn": obj.get("bindDn"), - "userBase": obj.get("userBase"), - "userObjectClasses": obj.get("userObjectClasses"), - "userFilters": obj.get("userFilters"), - "timeout": obj.get("timeout"), - "attributes": IdentityProviderServiceLDAPAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None, - "rootCa": obj.get("rootCa") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.identity_provider_service_ldap_attributes import ( + IdentityProviderServiceLDAPAttributes, +) +IdentityProviderServiceLDAPConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_o_auth_config.py b/zitadel_client/models/identity_provider_service_o_auth_config.py index ce938a2b..7cc81226 100644 --- a/zitadel_client/models/identity_provider_service_o_auth_config.py +++ b/zitadel_client/models/identity_provider_service_o_auth_config.py @@ -1,39 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class IdentityProviderServiceOAuthConfig(BaseModel): """ IdentityProviderServiceOAuthConfig - """ # noqa: E501 - client_id: Optional[StrictStr] = Field(default=None, description="Client id generated by the identity provider.", alias="clientId") - authorization_endpoint: Optional[StrictStr] = Field(default=None, description="The endpoint where ZITADEL send the user to authenticate.", alias="authorizationEndpoint") - token_endpoint: Optional[StrictStr] = Field(default=None, description="The endpoint where ZITADEL can get the token.", alias="tokenEndpoint") - user_endpoint: Optional[StrictStr] = Field(default=None, description="The endpoint where ZITADEL can get the user information.", alias="userEndpoint") - scopes: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by ZITADEL during the request on the identity provider.") - id_attribute: Optional[StrictStr] = Field(default=None, description="Defines how the attribute is called where ZITADEL can get the id of the user.", alias="idAttribute") - __properties: ClassVar[List[str]] = ["clientId", "authorizationEndpoint", "tokenEndpoint", "userEndpoint", "scopes", "idAttribute"] + """ + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="Client id generated by the identity provider.", + ) + authorization_endpoint: Optional[StrictStr] = Field( + default=None, + alias="authorizationEndpoint", + description="The endpoint where ZITADEL send the user to authenticate.", + ) + token_endpoint: Optional[StrictStr] = Field( + default=None, + alias="tokenEndpoint", + description="The endpoint where ZITADEL can get the token.", + ) + user_endpoint: Optional[StrictStr] = Field( + default=None, + alias="userEndpoint", + description="The endpoint where ZITADEL can get the user information.", + ) + scopes: Optional[List[StrictStr]] = Field( + default=None, + alias="scopes", + description="The scopes requested by ZITADEL during the request on the identity provider.", + ) + id_attribute: Optional[StrictStr] = Field( + default=None, + alias="idAttribute", + description="Defines how the attribute is called where ZITADEL can get the id of the user.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,57 +59,4 @@ class IdentityProviderServiceOAuthConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceOAuthConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceOAuthConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "clientId": obj.get("clientId"), - "authorizationEndpoint": obj.get("authorizationEndpoint"), - "tokenEndpoint": obj.get("tokenEndpoint"), - "userEndpoint": obj.get("userEndpoint"), - "scopes": obj.get("scopes"), - "idAttribute": obj.get("idAttribute") - }) - return _obj - - +IdentityProviderServiceOAuthConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_options.py b/zitadel_client/models/identity_provider_service_options.py index e8eff938..2e790334 100644 --- a/zitadel_client/models/identity_provider_service_options.py +++ b/zitadel_client/models/identity_provider_service_options.py @@ -1,39 +1,50 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.identity_provider_service_auto_linking_option import IdentityProviderServiceAutoLinkingOption -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class IdentityProviderServiceOptions(BaseModel): """ IdentityProviderServiceOptions - """ # noqa: E501 - is_linking_allowed: Optional[StrictBool] = Field(default=None, description="Enable if users should be able to link an existing ZITADEL user with an external account.", alias="isLinkingAllowed") - is_creation_allowed: Optional[StrictBool] = Field(default=None, description="Enable if users should be able to create a new account in ZITADEL when using an external account.", alias="isCreationAllowed") - is_auto_creation: Optional[StrictBool] = Field(default=None, description="Enable if a new account in ZITADEL should be created automatically when login with an external account.", alias="isAutoCreation") - is_auto_update: Optional[StrictBool] = Field(default=None, description="Enable if a the ZITADEL account fields should be updated automatically on each login.", alias="isAutoUpdate") - auto_linking: Optional[IdentityProviderServiceAutoLinkingOption] = Field(default=None, alias="autoLinking") - __properties: ClassVar[List[str]] = ["isLinkingAllowed", "isCreationAllowed", "isAutoCreation", "isAutoUpdate", "autoLinking"] + """ + is_linking_allowed: Optional[StrictBool] = Field( + default=None, + alias="isLinkingAllowed", + description="Enable if users should be able to link an existing ZITADEL user with an external account.", + ) + is_creation_allowed: Optional[StrictBool] = Field( + default=None, + alias="isCreationAllowed", + description="Enable if users should be able to create a new account in ZITADEL when using an external account.", + ) + is_auto_creation: Optional[StrictBool] = Field( + default=None, + alias="isAutoCreation", + description="Enable if a new account in ZITADEL should be created automatically when login with an external account.", + ) + is_auto_update: Optional[StrictBool] = Field( + default=None, + alias="isAutoUpdate", + description="Enable if a the ZITADEL account fields should be updated automatically on each login.", + ) + auto_linking: Optional[IdentityProviderServiceAutoLinkingOption] = Field( + default=None, alias="autoLinking" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +52,8 @@ class IdentityProviderServiceOptions(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceOptions from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceOptions from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "isLinkingAllowed": obj.get("isLinkingAllowed"), - "isCreationAllowed": obj.get("isCreationAllowed"), - "isAutoCreation": obj.get("isAutoCreation"), - "isAutoUpdate": obj.get("isAutoUpdate"), - "autoLinking": obj.get("autoLinking") - }) - return _obj - +from zitadel_client.models.identity_provider_service_auto_linking_option import ( + IdentityProviderServiceAutoLinkingOption, +) +IdentityProviderServiceOptions.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_saml_binding.py b/zitadel_client/models/identity_provider_service_saml_binding.py index 4e2eb900..b4119fc1 100644 --- a/zitadel_client/models/identity_provider_service_saml_binding.py +++ b/zitadel_client/models/identity_provider_service_saml_binding.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceSAMLBinding(str, Enum): @@ -23,17 +13,7 @@ class IdentityProviderServiceSAMLBinding(str, Enum): IdentityProviderServiceSAMLBinding """ - """ - allowed enum values - """ - SAML_BINDING_UNSPECIFIED = 'SAML_BINDING_UNSPECIFIED' - SAML_BINDING_POST = 'SAML_BINDING_POST' - SAML_BINDING_REDIRECT = 'SAML_BINDING_REDIRECT' - SAML_BINDING_ARTIFACT = 'SAML_BINDING_ARTIFACT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceSAMLBinding from a JSON string""" - return cls(json.loads(json_str)) - - + SAML_BINDING_UNSPECIFIED = "SAML_BINDING_UNSPECIFIED" + SAML_BINDING_POST = "SAML_BINDING_POST" + SAML_BINDING_REDIRECT = "SAML_BINDING_REDIRECT" + SAML_BINDING_ARTIFACT = "SAML_BINDING_ARTIFACT" diff --git a/zitadel_client/models/identity_provider_service_saml_config.py b/zitadel_client/models/identity_provider_service_saml_config.py index 242a799f..1d6826a7 100644 --- a/zitadel_client/models/identity_provider_service_saml_config.py +++ b/zitadel_client/models/identity_provider_service_saml_config.py @@ -1,43 +1,56 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.identity_provider_service_saml_binding import IdentityProviderServiceSAMLBinding -from zitadel_client.models.identity_provider_service_saml_name_id_format import IdentityProviderServiceSAMLNameIDFormat -from zitadel_client.models.identity_provider_service_saml_signature_algorithm import IdentityProviderServiceSAMLSignatureAlgorithm -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class IdentityProviderServiceSAMLConfig(BaseModel): """ IdentityProviderServiceSAMLConfig - """ # noqa: E501 - metadata_xml: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Metadata of the SAML identity provider.", alias="metadataXml") - binding: Optional[IdentityProviderServiceSAMLBinding] = None - with_signed_request: Optional[StrictBool] = Field(default=None, description="Boolean which defines if the authentication requests are signed.", alias="withSignedRequest") - name_id_format: Optional[IdentityProviderServiceSAMLNameIDFormat] = Field(default=None, alias="nameIdFormat") - transient_mapping_attribute_name: Optional[StrictStr] = Field(default=None, description="Optional name of the attribute, which will be used to map the user in case the nameid-format returned is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`.", alias="transientMappingAttributeName") - federated_logout_enabled: Optional[StrictBool] = Field(default=None, description="Boolean weather federated logout is enabled. If enabled, ZITADEL will send a logout request to the identity provider, if the user terminates the session in ZITADEL. Be sure to provide a SLO endpoint as part of the metadata.", alias="federatedLogoutEnabled") - signature_algorithm: Optional[IdentityProviderServiceSAMLSignatureAlgorithm] = Field(default=None, alias="signatureAlgorithm") - __properties: ClassVar[List[str]] = ["metadataXml", "binding", "withSignedRequest", "nameIdFormat", "transientMappingAttributeName", "federatedLogoutEnabled", "signatureAlgorithm"] + """ + metadata_xml: Optional[Base64Bytes] = Field( + default=None, + alias="metadataXml", + description="Metadata of the SAML identity provider.", + ) + binding: Optional[IdentityProviderServiceSAMLBinding] = Field( + default=None, alias="binding" + ) + with_signed_request: Optional[StrictBool] = Field( + default=None, + alias="withSignedRequest", + description="Boolean which defines if the authentication requests are signed.", + ) + name_id_format: Optional[IdentityProviderServiceSAMLNameIDFormat] = Field( + default=None, alias="nameIdFormat" + ) + transient_mapping_attribute_name: Optional[StrictStr] = Field( + default=None, + alias="transientMappingAttributeName", + description="Optional name of the attribute, which will be used to map the user in case the nameid-format returned is `urn:oasis:names:tc:SAML:2.0:nameid-format:transient`.", + ) + federated_logout_enabled: Optional[StrictBool] = Field( + default=None, + alias="federatedLogoutEnabled", + description="Boolean weather federated logout is enabled. If enabled, ZITADEL will send a logout request to the identity provider, if the user terminates the session in ZITADEL. Be sure to provide a SLO endpoint as part of the metadata.", + ) + signature_algorithm: Optional[IdentityProviderServiceSAMLSignatureAlgorithm] = ( + Field(default=None, alias="signatureAlgorithm") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,68 +58,15 @@ class IdentityProviderServiceSAMLConfig(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of IdentityProviderServiceSAMLConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if transient_mapping_attribute_name (nullable) is None - # and model_fields_set contains the field - if self.transient_mapping_attribute_name is None and "transient_mapping_attribute_name" in self.model_fields_set: - _dict['transientMappingAttributeName'] = None - - # set to None if federated_logout_enabled (nullable) is None - # and model_fields_set contains the field - if self.federated_logout_enabled is None and "federated_logout_enabled" in self.model_fields_set: - _dict['federatedLogoutEnabled'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of IdentityProviderServiceSAMLConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "metadataXml": obj.get("metadataXml"), - "binding": obj.get("binding"), - "withSignedRequest": obj.get("withSignedRequest"), - "nameIdFormat": obj.get("nameIdFormat"), - "transientMappingAttributeName": obj.get("transientMappingAttributeName"), - "federatedLogoutEnabled": obj.get("federatedLogoutEnabled"), - "signatureAlgorithm": obj.get("signatureAlgorithm") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.identity_provider_service_saml_binding import ( + IdentityProviderServiceSAMLBinding, +) +from zitadel_client.models.identity_provider_service_saml_name_id_format import ( + IdentityProviderServiceSAMLNameIDFormat, +) +from zitadel_client.models.identity_provider_service_saml_signature_algorithm import ( + IdentityProviderServiceSAMLSignatureAlgorithm, +) +IdentityProviderServiceSAMLConfig.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/identity_provider_service_saml_name_id_format.py b/zitadel_client/models/identity_provider_service_saml_name_id_format.py index 944f7c12..33984caf 100644 --- a/zitadel_client/models/identity_provider_service_saml_name_id_format.py +++ b/zitadel_client/models/identity_provider_service_saml_name_id_format.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceSAMLNameIDFormat(str, Enum): @@ -23,17 +13,7 @@ class IdentityProviderServiceSAMLNameIDFormat(str, Enum): IdentityProviderServiceSAMLNameIDFormat """ - """ - allowed enum values - """ - SAML_NAME_ID_FORMAT_UNSPECIFIED = 'SAML_NAME_ID_FORMAT_UNSPECIFIED' - SAML_NAME_ID_FORMAT_EMAIL_ADDRESS = 'SAML_NAME_ID_FORMAT_EMAIL_ADDRESS' - SAML_NAME_ID_FORMAT_PERSISTENT = 'SAML_NAME_ID_FORMAT_PERSISTENT' - SAML_NAME_ID_FORMAT_TRANSIENT = 'SAML_NAME_ID_FORMAT_TRANSIENT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceSAMLNameIDFormat from a JSON string""" - return cls(json.loads(json_str)) - - + SAML_NAME_ID_FORMAT_UNSPECIFIED = "SAML_NAME_ID_FORMAT_UNSPECIFIED" + SAML_NAME_ID_FORMAT_EMAIL_ADDRESS = "SAML_NAME_ID_FORMAT_EMAIL_ADDRESS" + SAML_NAME_ID_FORMAT_PERSISTENT = "SAML_NAME_ID_FORMAT_PERSISTENT" + SAML_NAME_ID_FORMAT_TRANSIENT = "SAML_NAME_ID_FORMAT_TRANSIENT" diff --git a/zitadel_client/models/identity_provider_service_saml_signature_algorithm.py b/zitadel_client/models/identity_provider_service_saml_signature_algorithm.py index 2cbb7150..fb0fc1cb 100644 --- a/zitadel_client/models/identity_provider_service_saml_signature_algorithm.py +++ b/zitadel_client/models/identity_provider_service_saml_signature_algorithm.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class IdentityProviderServiceSAMLSignatureAlgorithm(str, Enum): @@ -23,17 +13,7 @@ class IdentityProviderServiceSAMLSignatureAlgorithm(str, Enum): IdentityProviderServiceSAMLSignatureAlgorithm """ - """ - allowed enum values - """ - SAML_SIGNATURE_UNSPECIFIED = 'SAML_SIGNATURE_UNSPECIFIED' - SAML_SIGNATURE_RSA_SHA1 = 'SAML_SIGNATURE_RSA_SHA1' - SAML_SIGNATURE_RSA_SHA256 = 'SAML_SIGNATURE_RSA_SHA256' - SAML_SIGNATURE_RSA_SHA512 = 'SAML_SIGNATURE_RSA_SHA512' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of IdentityProviderServiceSAMLSignatureAlgorithm from a JSON string""" - return cls(json.loads(json_str)) - - + SAML_SIGNATURE_UNSPECIFIED = "SAML_SIGNATURE_UNSPECIFIED" + SAML_SIGNATURE_RSA_SHA1 = "SAML_SIGNATURE_RSA_SHA1" + SAML_SIGNATURE_RSA_SHA256 = "SAML_SIGNATURE_RSA_SHA256" + SAML_SIGNATURE_RSA_SHA512 = "SAML_SIGNATURE_RSA_SHA512" diff --git a/zitadel_client/models/instance_service_add_custom_domain_request.py b/zitadel_client/models/instance_service_add_custom_domain_request.py index 9fe0e74e..b227a63d 100644 --- a/zitadel_client/models/instance_service_add_custom_domain_request.py +++ b/zitadel_client/models/instance_service_add_custom_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceAddCustomDomainRequest(BaseModel): """ InstanceServiceAddCustomDomainRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance to which the domain will be added.", alias="instanceId") - custom_domain: Optional[StrictStr] = Field(default=None, description="Custom domain to add to the instance. Must be a valid domain name. Once the domain is added, it will be used to route requests to this instance.", alias="customDomain") - __properties: ClassVar[List[str]] = ["instanceId", "customDomain"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance to which the domain will be added.", + ) + custom_domain: Optional[StrictStr] = Field( + default=None, + alias="customDomain", + description="Custom domain to add to the instance. Must be a valid domain name. Once the domain is added, it will be used to route requests to this instance.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InstanceServiceAddCustomDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceAddCustomDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceAddCustomDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "customDomain": obj.get("customDomain") - }) - return _obj - - +InstanceServiceAddCustomDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_add_custom_domain_response.py b/zitadel_client/models/instance_service_add_custom_domain_response.py index f5face85..912c1c2f 100644 --- a/zitadel_client/models/instance_service_add_custom_domain_response.py +++ b/zitadel_client/models/instance_service_add_custom_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceAddCustomDomainResponse(BaseModel): """ InstanceServiceAddCustomDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceAddCustomDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceAddCustomDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceAddCustomDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceAddCustomDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_add_trusted_domain_request.py b/zitadel_client/models/instance_service_add_trusted_domain_request.py index 5050bed3..84d36772 100644 --- a/zitadel_client/models/instance_service_add_trusted_domain_request.py +++ b/zitadel_client/models/instance_service_add_trusted_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceAddTrustedDomainRequest(BaseModel): """ InstanceServiceAddTrustedDomainRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance to which the trusted domain will be added. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", alias="instanceId") - trusted_domain: Optional[StrictStr] = Field(default=None, description="Trusted domain to be added to the instance. Must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domains, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance.", alias="trustedDomain") - __properties: ClassVar[List[str]] = ["instanceId", "trustedDomain"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance to which the trusted domain will be added. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", + ) + trusted_domain: Optional[StrictStr] = Field( + default=None, + alias="trustedDomain", + description="Trusted domain to be added to the instance. Must be a valid domain name. Once the domain is added, it can be used in API responses like OIDC discovery, email templates, and more. This can be used in cases where the API is accessed through a different domain than the instance domain, e.g. proxy setups and custom login UIs. Unlike custom domains, trusted domains are not used to route requests to this instance and therefore do not need to be uniquely assigned to an instance.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InstanceServiceAddTrustedDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceAddTrustedDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceAddTrustedDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "trustedDomain": obj.get("trustedDomain") - }) - return _obj - - +InstanceServiceAddTrustedDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_add_trusted_domain_response.py b/zitadel_client/models/instance_service_add_trusted_domain_response.py index dbb9e32a..ad6f5418 100644 --- a/zitadel_client/models/instance_service_add_trusted_domain_response.py +++ b/zitadel_client/models/instance_service_add_trusted_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceAddTrustedDomainResponse(BaseModel): """ InstanceServiceAddTrustedDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceAddTrustedDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceAddTrustedDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceAddTrustedDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceAddTrustedDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_any.py b/zitadel_client/models/instance_service_any.py index 1833dead..17916efa 100644 --- a/zitadel_client/models/instance_service_any.py +++ b/zitadel_client/models/instance_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class InstanceServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +InstanceServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_connect_error.py b/zitadel_client/models/instance_service_connect_error.py index 47312ee6..6d965f0f 100644 --- a/zitadel_client/models/instance_service_connect_error.py +++ b/zitadel_client/models/instance_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_any import InstanceServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class InstanceServiceConnectErrorCodeEnum(str, Enum): + """InstanceServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class InstanceServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[InstanceServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[InstanceServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[InstanceServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [InstanceServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.instance_service_any import InstanceServiceAny +InstanceServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_custom_domain.py b/zitadel_client/models/instance_service_custom_domain.py index d51e5bf4..69396726 100644 --- a/zitadel_client/models/instance_service_custom_domain.py +++ b/zitadel_client/models/instance_service_custom_domain.py @@ -1,39 +1,52 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class InstanceServiceCustomDomain(BaseModel): """ InstanceServiceCustomDomain - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique identifier of the instance the domain belongs to.", alias="instanceId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the fully qualified domain name. It must be unique across all instances in the system.") - primary: Optional[StrictBool] = Field(default=None, description="Primary states whether this domain is the primary domain of the instance. Each instance must have exactly one primary domain. The primary domain is used for various purposes and acts as fallback in those cases, e.g if no explicit domain is specified.") - generated: Optional[StrictBool] = Field(default=None, description="Generate states whether this domain was auto-generated by the system. Auto-generated domains follow a specific pattern and are created when a new instance is created. They cannot be deleted, but the primary domain can be changed to a manually added domain.") - __properties: ClassVar[List[str]] = ["instanceId", "creationDate", "domain", "primary", "generated"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique identifier of the instance the domain belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the fully qualified domain name. It must be unique across all instances in the system.", + ) + primary: Optional[StrictBool] = Field( + default=None, + alias="primary", + description="Primary states whether this domain is the primary domain of the instance. Each instance must have exactly one primary domain. The primary domain is used for various purposes and acts as fallback in those cases, e.g if no explicit domain is specified.", + ) + generated: Optional[StrictBool] = Field( + default=None, + alias="generated", + description="Generate states whether this domain was auto-generated by the system. Auto-generated domains follow a specific pattern and are created when a new instance is created. They cannot be deleted, but the primary domain can be changed to a manually added domain.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +54,6 @@ class InstanceServiceCustomDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "creationDate": obj.get("creationDate"), - "domain": obj.get("domain"), - "primary": obj.get("primary"), - "generated": obj.get("generated") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceCustomDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_custom_domain_filter.py b/zitadel_client/models/instance_service_custom_domain_filter.py index 7a19434b..14fabf1f 100644 --- a/zitadel_client/models/instance_service_custom_domain_filter.py +++ b/zitadel_client/models/instance_service_custom_domain_filter.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.instance_service_domain_filter import InstanceServiceDomainFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class InstanceServiceCustomDomainFilter(BaseModel): """ InstanceServiceCustomDomainFilter - """ # noqa: E501 - domain_filter: Optional[InstanceServiceDomainFilter] = Field(default=None, alias="domainFilter") - generated_filter: Optional[StrictBool] = Field(default=None, description="Filter whether the domain is auto-generated.", alias="generatedFilter") - primary_filter: Optional[StrictBool] = Field(default=None, description="Filter whether the domain is the primary domain of the instance.", alias="primaryFilter") - __properties: ClassVar[List[str]] = ["domainFilter", "generatedFilter", "primaryFilter"] + """ + + domain_filter: Optional[InstanceServiceDomainFilter] = Field( + default=None, alias="domainFilter" + ) + generated_filter: Optional[StrictBool] = Field( + default=None, + alias="generatedFilter", + description="Filter whether the domain is auto-generated.", + ) + primary_filter: Optional[StrictBool] = Field( + default=None, + alias="primaryFilter", + description="Filter whether the domain is the primary domain of the instance.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,8 @@ class InstanceServiceCustomDomainFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomainFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_filter - if self.domain_filter: - _dict['domainFilter'] = self.domain_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomainFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainFilter": InstanceServiceDomainFilter.from_dict(obj["domainFilter"]) if obj.get("domainFilter") is not None else None, - "generatedFilter": obj.get("generatedFilter"), - "primaryFilter": obj.get("primaryFilter") - }) - return _obj - +from zitadel_client.models.instance_service_domain_filter import ( + InstanceServiceDomainFilter, +) +InstanceServiceCustomDomainFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_custom_domains_filter.py b/zitadel_client/models/instance_service_custom_domains_filter.py index 62600e86..12a443dc 100644 --- a/zitadel_client/models/instance_service_custom_domains_filter.py +++ b/zitadel_client/models/instance_service_custom_domains_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InstanceServiceCustomDomainsFilter(BaseModel): """ InstanceServiceCustomDomainsFilter - """ # noqa: E501 - domains: Optional[List[StrictStr]] = Field(default=None, description="The domains to query for. All instances that have at least one of the specified domains will be returned. A maximum of 20 domains can be specified.") - __properties: ClassVar[List[str]] = ["domains"] + """ + domains: Optional[List[StrictStr]] = Field( + default=None, + alias="domains", + description="The domains to query for. All instances that have at least one of the specified domains will be returned. A maximum of 20 domains can be specified.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class InstanceServiceCustomDomainsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomainsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceCustomDomainsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domains": obj.get("domains") - }) - return _obj - - +InstanceServiceCustomDomainsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_delete_instance_request.py b/zitadel_client/models/instance_service_delete_instance_request.py index a8174339..e65abd1f 100644 --- a/zitadel_client/models/instance_service_delete_instance_request.py +++ b/zitadel_client/models/instance_service_delete_instance_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceDeleteInstanceRequest(BaseModel): """ InstanceServiceDeleteInstanceRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance to be deleted.", alias="instanceId") - __properties: ClassVar[List[str]] = ["instanceId"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance to be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class InstanceServiceDeleteInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceDeleteInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceDeleteInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId") - }) - return _obj - - +InstanceServiceDeleteInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_delete_instance_response.py b/zitadel_client/models/instance_service_delete_instance_response.py index 7926a528..80dec1c7 100644 --- a/zitadel_client/models/instance_service_delete_instance_response.py +++ b/zitadel_client/models/instance_service_delete_instance_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceDeleteInstanceResponse(BaseModel): """ InstanceServiceDeleteInstanceResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceDeleteInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceDeleteInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceDeleteInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceDeleteInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_domain_field_name.py b/zitadel_client/models/instance_service_domain_field_name.py index 8dfb4547..46104c39 100644 --- a/zitadel_client/models/instance_service_domain_field_name.py +++ b/zitadel_client/models/instance_service_domain_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InstanceServiceDomainFieldName(str, Enum): @@ -23,18 +13,8 @@ class InstanceServiceDomainFieldName(str, Enum): InstanceServiceDomainFieldName """ - """ - allowed enum values - """ - DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' - DOMAIN_FIELD_NAME_DOMAIN = 'DOMAIN_FIELD_NAME_DOMAIN' - DOMAIN_FIELD_NAME_PRIMARY = 'DOMAIN_FIELD_NAME_PRIMARY' - DOMAIN_FIELD_NAME_GENERATED = 'DOMAIN_FIELD_NAME_GENERATED' - DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InstanceServiceDomainFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED" + DOMAIN_FIELD_NAME_DOMAIN = "DOMAIN_FIELD_NAME_DOMAIN" + DOMAIN_FIELD_NAME_PRIMARY = "DOMAIN_FIELD_NAME_PRIMARY" + DOMAIN_FIELD_NAME_GENERATED = "DOMAIN_FIELD_NAME_GENERATED" + DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/instance_service_domain_filter.py b/zitadel_client/models/instance_service_domain_filter.py index 8de868eb..62bffe6a 100644 --- a/zitadel_client/models/instance_service_domain_filter.py +++ b/zitadel_client/models/instance_service_domain_filter.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.instance_service_text_query_method import InstanceServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceDomainFilter(BaseModel): """ InstanceServiceDomainFilter - """ # noqa: E501 - domain: Optional[StrictStr] = Field(default=None, description="The domain to filter for.") - method: Optional[InstanceServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["domain", "method"] + """ + + domain: Optional[StrictStr] = Field( + default=None, alias="domain", description="The domain to filter for." + ) + method: Optional[InstanceServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,8 @@ class InstanceServiceDomainFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceDomainFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceDomainFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.instance_service_text_query_method import ( + InstanceServiceTextQueryMethod, +) +InstanceServiceDomainFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_field_name.py b/zitadel_client/models/instance_service_field_name.py index edcd9038..7a020703 100644 --- a/zitadel_client/models/instance_service_field_name.py +++ b/zitadel_client/models/instance_service_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InstanceServiceFieldName(str, Enum): @@ -23,17 +13,7 @@ class InstanceServiceFieldName(str, Enum): InstanceServiceFieldName """ - """ - allowed enum values - """ - FIELD_NAME_UNSPECIFIED = 'FIELD_NAME_UNSPECIFIED' - FIELD_NAME_ID = 'FIELD_NAME_ID' - FIELD_NAME_NAME = 'FIELD_NAME_NAME' - FIELD_NAME_CREATION_DATE = 'FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InstanceServiceFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + FIELD_NAME_UNSPECIFIED = "FIELD_NAME_UNSPECIFIED" + FIELD_NAME_ID = "FIELD_NAME_ID" + FIELD_NAME_NAME = "FIELD_NAME_NAME" + FIELD_NAME_CREATION_DATE = "FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/instance_service_filter.py b/zitadel_client/models/instance_service_filter.py index b801b6fd..30105733 100644 --- a/zitadel_client/models/instance_service_filter.py +++ b/zitadel_client/models/instance_service_filter.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.instance_service_custom_domains_filter import InstanceServiceCustomDomainsFilter -from zitadel_client.models.instance_service_in_ids_filter import InstanceServiceInIDsFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceFilter(BaseModel): """ InstanceServiceFilter - """ # noqa: E501 - custom_domains_filter: Optional[InstanceServiceCustomDomainsFilter] = Field(default=None, alias="customDomainsFilter") - in_ids_filter: Optional[InstanceServiceInIDsFilter] = Field(default=None, alias="inIdsFilter") - __properties: ClassVar[List[str]] = ["customDomainsFilter", "inIdsFilter"] + """ + + custom_domains_filter: Optional[InstanceServiceCustomDomainsFilter] = Field( + default=None, alias="customDomainsFilter" + ) + in_ids_filter: Optional[InstanceServiceInIDsFilter] = Field( + default=None, alias="inIdsFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class InstanceServiceFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of custom_domains_filter - if self.custom_domains_filter: - _dict['customDomainsFilter'] = self.custom_domains_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_ids_filter - if self.in_ids_filter: - _dict['inIdsFilter'] = self.in_ids_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "customDomainsFilter": InstanceServiceCustomDomainsFilter.from_dict(obj["customDomainsFilter"]) if obj.get("customDomainsFilter") is not None else None, - "inIdsFilter": InstanceServiceInIDsFilter.from_dict(obj["inIdsFilter"]) if obj.get("inIdsFilter") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_custom_domains_filter import ( + InstanceServiceCustomDomainsFilter, +) +from zitadel_client.models.instance_service_in_ids_filter import ( + InstanceServiceInIDsFilter, +) +InstanceServiceFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_get_instance_request.py b/zitadel_client/models/instance_service_get_instance_request.py index 228a9bdb..87bc4d94 100644 --- a/zitadel_client/models/instance_service_get_instance_request.py +++ b/zitadel_client/models/instance_service_get_instance_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceGetInstanceRequest(BaseModel): """ InstanceServiceGetInstanceRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance to be retrieved. If not set, the instance in the current context (e.g. identified by the host header) will be returned. If an ID is set, the caller must have additional permissions.", alias="instanceId") - __properties: ClassVar[List[str]] = ["instanceId"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance to be retrieved. If not set, the instance in the current context (e.g. identified by the host header) will be returned. If an ID is set, the caller must have additional permissions.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class InstanceServiceGetInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceGetInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceGetInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId") - }) - return _obj - - +InstanceServiceGetInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_get_instance_response.py b/zitadel_client/models/instance_service_get_instance_response.py index dcd30533..6ed64a33 100644 --- a/zitadel_client/models/instance_service_get_instance_response.py +++ b/zitadel_client/models/instance_service_get_instance_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.instance_service_instance import InstanceServiceInstance -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class InstanceServiceGetInstanceResponse(BaseModel): """ InstanceServiceGetInstanceResponse - """ # noqa: E501 - instance: Optional[InstanceServiceInstance] = None - __properties: ClassVar[List[str]] = ["instance"] + """ + instance: Optional[InstanceServiceInstance] = Field(default=None, alias="instance") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class InstanceServiceGetInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceGetInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of instance - if self.instance: - _dict['instance'] = self.instance.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceGetInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": InstanceServiceInstance.from_dict(obj["instance"]) if obj.get("instance") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_instance import InstanceServiceInstance +InstanceServiceGetInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_in_ids_filter.py b/zitadel_client/models/instance_service_in_ids_filter.py index 7ecdd18d..c41c3bdb 100644 --- a/zitadel_client/models/instance_service_in_ids_filter.py +++ b/zitadel_client/models/instance_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InstanceServiceInIDsFilter(BaseModel): """ InstanceServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class InstanceServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +InstanceServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_instance.py b/zitadel_client/models/instance_service_instance.py index 0ea14837..592a9253 100644 --- a/zitadel_client/models/instance_service_instance.py +++ b/zitadel_client/models/instance_service_instance.py @@ -1,43 +1,58 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_custom_domain import InstanceServiceCustomDomain -from zitadel_client.models.instance_service_state import InstanceServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InstanceServiceInstance(BaseModel): """ InstanceServiceInstance - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the instance.") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - state: Optional[InstanceServiceState] = None - name: Optional[StrictStr] = Field(default=None, description="Name is the display name of the instance. This can be changed by the instance administrator.") - version: Optional[StrictStr] = Field(default=None, description="Version of the system the instance is running on. This is managed by the system and cannot be changed by the instance administrator.") - custom_domains: Optional[List[InstanceServiceCustomDomain]] = Field(default=None, description="CustomDomains are the domains that are assigned to the instance. The list includes auto-generated and manually added domains. They are all unique across all instances in the system. They're used to route requests to the correct instance.", alias="customDomains") - __properties: ClassVar[List[str]] = ["id", "changeDate", "creationDate", "state", "name", "version", "customDomains"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the instance.", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[InstanceServiceState] = Field(default=None, alias="state") + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the display name of the instance. This can be changed by the instance administrator.", + ) + version: Optional[StrictStr] = Field( + default=None, + alias="version", + description="Version of the system the instance is running on. This is managed by the system and cannot be changed by the instance administrator.", + ) + custom_domains: Optional[List[InstanceServiceCustomDomain]] = Field( + default=None, + alias="customDomains", + description="CustomDomains are the domains that are assigned to the instance. The list includes auto-generated and manually added domains. They are all unique across all instances in the system. They're used to route requests to the correct instance.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,65 +60,10 @@ class InstanceServiceInstance(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceInstance from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in custom_domains (list) - _items = [] - if self.custom_domains: - for _item_custom_domains in self.custom_domains: - if _item_custom_domains: - _items.append(_item_custom_domains.to_dict()) - _dict['customDomains'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceInstance from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "changeDate": obj.get("changeDate"), - "creationDate": obj.get("creationDate"), - "state": obj.get("state"), - "name": obj.get("name"), - "version": obj.get("version"), - "customDomains": [InstanceServiceCustomDomain.from_dict(_item) for _item in obj["customDomains"]] if obj.get("customDomains") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.instance_service_custom_domain import ( + InstanceServiceCustomDomain, +) +from zitadel_client.models.instance_service_state import InstanceServiceState +InstanceServiceInstance.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_custom_domains_request.py b/zitadel_client/models/instance_service_list_custom_domains_request.py index 8dd3d887..42e5ee10 100644 --- a/zitadel_client/models/instance_service_list_custom_domains_request.py +++ b/zitadel_client/models/instance_service_list_custom_domains_request.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_custom_domain_filter import InstanceServiceCustomDomainFilter -from zitadel_client.models.instance_service_domain_field_name import InstanceServiceDomainFieldName -from zitadel_client.models.instance_service_pagination_request import InstanceServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InstanceServiceListCustomDomainsRequest(BaseModel): """ InstanceServiceListCustomDomainsRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance whose domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", alias="instanceId") - pagination: Optional[InstanceServicePaginationRequest] = None - sorting_column: Optional[InstanceServiceDomainFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[InstanceServiceCustomDomainFilter]] = Field(default=None, description="Filter the domains to be returned.") - __properties: ClassVar[List[str]] = ["instanceId", "pagination", "sortingColumn", "filters"] + """ + + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance whose domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", + ) + pagination: Optional[InstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[InstanceServiceDomainFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[InstanceServiceCustomDomainFilter]] = Field( + default=None, alias="filters", description="Filter the domains to be returned." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +43,14 @@ class InstanceServiceListCustomDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListCustomDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListCustomDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "pagination": InstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [InstanceServiceCustomDomainFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_custom_domain_filter import ( + InstanceServiceCustomDomainFilter, +) +from zitadel_client.models.instance_service_domain_field_name import ( + InstanceServiceDomainFieldName, +) +from zitadel_client.models.instance_service_pagination_request import ( + InstanceServicePaginationRequest, +) +InstanceServiceListCustomDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_custom_domains_response.py b/zitadel_client/models/instance_service_list_custom_domains_response.py index 09372136..0c7276b3 100644 --- a/zitadel_client/models/instance_service_list_custom_domains_response.py +++ b/zitadel_client/models/instance_service_list_custom_domains_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_custom_domain import InstanceServiceCustomDomain -from zitadel_client.models.instance_service_pagination_response import InstanceServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InstanceServiceListCustomDomainsResponse(BaseModel): """ InstanceServiceListCustomDomainsResponse - """ # noqa: E501 - domains: Optional[List[InstanceServiceCustomDomain]] = Field(default=None, description="The list of custom domains matching the query.") - pagination: Optional[InstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["domains", "pagination"] + """ + + domains: Optional[List[InstanceServiceCustomDomain]] = Field( + default=None, + alias="domains", + description="The list of custom domains matching the query.", + ) + pagination: Optional[InstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class InstanceServiceListCustomDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListCustomDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in domains (list) - _items = [] - if self.domains: - for _item_domains in self.domains: - if _item_domains: - _items.append(_item_domains.to_dict()) - _dict['domains'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListCustomDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domains": [InstanceServiceCustomDomain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None, - "pagination": InstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_custom_domain import ( + InstanceServiceCustomDomain, +) +from zitadel_client.models.instance_service_pagination_response import ( + InstanceServicePaginationResponse, +) +InstanceServiceListCustomDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_instances_request.py b/zitadel_client/models/instance_service_list_instances_request.py index 2a5d9c1c..dcb798f1 100644 --- a/zitadel_client/models/instance_service_list_instances_request.py +++ b/zitadel_client/models/instance_service_list_instances_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_field_name import InstanceServiceFieldName -from zitadel_client.models.instance_service_filter import InstanceServiceFilter -from zitadel_client.models.instance_service_pagination_request import InstanceServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InstanceServiceListInstancesRequest(BaseModel): """ InstanceServiceListInstancesRequest - """ # noqa: E501 - pagination: Optional[InstanceServicePaginationRequest] = None - sorting_column: Optional[InstanceServiceFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[InstanceServiceFilter]] = Field(default=None, description="Filter the instances to be returned.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[InstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[InstanceServiceFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[InstanceServiceFilter]] = Field( + default=None, + alias="filters", + description="Filter the instances to be returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,10 @@ class InstanceServiceListInstancesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListInstancesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListInstancesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": InstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [InstanceServiceFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_field_name import InstanceServiceFieldName +from zitadel_client.models.instance_service_filter import InstanceServiceFilter +from zitadel_client.models.instance_service_pagination_request import ( + InstanceServicePaginationRequest, +) +InstanceServiceListInstancesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_instances_response.py b/zitadel_client/models/instance_service_list_instances_response.py index 344a8585..7d8c68b0 100644 --- a/zitadel_client/models/instance_service_list_instances_response.py +++ b/zitadel_client/models/instance_service_list_instances_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_instance import InstanceServiceInstance -from zitadel_client.models.instance_service_pagination_response import InstanceServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InstanceServiceListInstancesResponse(BaseModel): """ InstanceServiceListInstancesResponse - """ # noqa: E501 - instances: Optional[List[InstanceServiceInstance]] = Field(default=None, description="The instances matching the query.") - pagination: Optional[InstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["instances", "pagination"] + """ + + instances: Optional[List[InstanceServiceInstance]] = Field( + default=None, alias="instances", description="The instances matching the query." + ) + pagination: Optional[InstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class InstanceServiceListInstancesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListInstancesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in instances (list) - _items = [] - if self.instances: - for _item_instances in self.instances: - if _item_instances: - _items.append(_item_instances.to_dict()) - _dict['instances'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListInstancesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instances": [InstanceServiceInstance.from_dict(_item) for _item in obj["instances"]] if obj.get("instances") is not None else None, - "pagination": InstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_instance import InstanceServiceInstance +from zitadel_client.models.instance_service_pagination_response import ( + InstanceServicePaginationResponse, +) +InstanceServiceListInstancesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_trusted_domains_request.py b/zitadel_client/models/instance_service_list_trusted_domains_request.py index f75dee80..0d52d488 100644 --- a/zitadel_client/models/instance_service_list_trusted_domains_request.py +++ b/zitadel_client/models/instance_service_list_trusted_domains_request.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_pagination_request import InstanceServicePaginationRequest -from zitadel_client.models.instance_service_trusted_domain_field_name import InstanceServiceTrustedDomainFieldName -from zitadel_client.models.instance_service_trusted_domain_filter import InstanceServiceTrustedDomainFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InstanceServiceListTrustedDomainsRequest(BaseModel): """ InstanceServiceListTrustedDomainsRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance whose trusted domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", alias="instanceId") - pagination: Optional[InstanceServicePaginationRequest] = None - sorting_column: Optional[InstanceServiceTrustedDomainFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[InstanceServiceTrustedDomainFilter]] = Field(default=None, description="Filter the domains to be returned.") - __properties: ClassVar[List[str]] = ["instanceId", "pagination", "sortingColumn", "filters"] + """ + + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance whose trusted domains will be listed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", + ) + pagination: Optional[InstanceServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[InstanceServiceTrustedDomainFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[InstanceServiceTrustedDomainFilter]] = Field( + default=None, alias="filters", description="Filter the domains to be returned." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +43,14 @@ class InstanceServiceListTrustedDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListTrustedDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListTrustedDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "pagination": InstanceServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [InstanceServiceTrustedDomainFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_pagination_request import ( + InstanceServicePaginationRequest, +) +from zitadel_client.models.instance_service_trusted_domain_field_name import ( + InstanceServiceTrustedDomainFieldName, +) +from zitadel_client.models.instance_service_trusted_domain_filter import ( + InstanceServiceTrustedDomainFilter, +) +InstanceServiceListTrustedDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_list_trusted_domains_response.py b/zitadel_client/models/instance_service_list_trusted_domains_response.py index a64dce75..6cc95552 100644 --- a/zitadel_client/models/instance_service_list_trusted_domains_response.py +++ b/zitadel_client/models/instance_service_list_trusted_domains_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.instance_service_pagination_response import InstanceServicePaginationResponse -from zitadel_client.models.instance_service_trusted_domain import InstanceServiceTrustedDomain -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InstanceServiceListTrustedDomainsResponse(BaseModel): """ InstanceServiceListTrustedDomainsResponse - """ # noqa: E501 - trusted_domain: Optional[List[InstanceServiceTrustedDomain]] = Field(default=None, description="The list of trusted domains matching the query.", alias="trustedDomain") - pagination: Optional[InstanceServicePaginationResponse] = None - __properties: ClassVar[List[str]] = ["trustedDomain", "pagination"] + """ + + trusted_domain: Optional[List[InstanceServiceTrustedDomain]] = Field( + default=None, + alias="trustedDomain", + description="The list of trusted domains matching the query.", + ) + pagination: Optional[InstanceServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class InstanceServiceListTrustedDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceListTrustedDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in trusted_domain (list) - _items = [] - if self.trusted_domain: - for _item_trusted_domain in self.trusted_domain: - if _item_trusted_domain: - _items.append(_item_trusted_domain.to_dict()) - _dict['trustedDomain'] = _items - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceListTrustedDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "trustedDomain": [InstanceServiceTrustedDomain.from_dict(_item) for _item in obj["trustedDomain"]] if obj.get("trustedDomain") is not None else None, - "pagination": InstanceServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_pagination_response import ( + InstanceServicePaginationResponse, +) +from zitadel_client.models.instance_service_trusted_domain import ( + InstanceServiceTrustedDomain, +) +InstanceServiceListTrustedDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_pagination_request.py b/zitadel_client/models/instance_service_pagination_request.py index add0d4a9..573381fc 100644 --- a/zitadel_client/models/instance_service_pagination_request.py +++ b/zitadel_client/models/instance_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class InstanceServicePaginationRequest(BaseModel): """ InstanceServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class InstanceServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +InstanceServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_pagination_response.py b/zitadel_client/models/instance_service_pagination_response.py index f33c063f..ea28f958 100644 --- a/zitadel_client/models/instance_service_pagination_response.py +++ b/zitadel_client/models/instance_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServicePaginationResponse(BaseModel): """ InstanceServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class InstanceServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +InstanceServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_remove_custom_domain_request.py b/zitadel_client/models/instance_service_remove_custom_domain_request.py index 154510cd..452023c1 100644 --- a/zitadel_client/models/instance_service_remove_custom_domain_request.py +++ b/zitadel_client/models/instance_service_remove_custom_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceRemoveCustomDomainRequest(BaseModel): """ InstanceServiceRemoveCustomDomainRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance from which the domain will be removed.", alias="instanceId") - custom_domain: Optional[StrictStr] = Field(default=None, description="CustomDomain is the the domain to remove from the instance.", alias="customDomain") - __properties: ClassVar[List[str]] = ["instanceId", "customDomain"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance from which the domain will be removed.", + ) + custom_domain: Optional[StrictStr] = Field( + default=None, + alias="customDomain", + description="CustomDomain is the the domain to remove from the instance.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InstanceServiceRemoveCustomDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveCustomDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveCustomDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "customDomain": obj.get("customDomain") - }) - return _obj - - +InstanceServiceRemoveCustomDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_remove_custom_domain_response.py b/zitadel_client/models/instance_service_remove_custom_domain_response.py index a06d797a..297f6a7d 100644 --- a/zitadel_client/models/instance_service_remove_custom_domain_response.py +++ b/zitadel_client/models/instance_service_remove_custom_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceRemoveCustomDomainResponse(BaseModel): """ InstanceServiceRemoveCustomDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceRemoveCustomDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveCustomDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveCustomDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceRemoveCustomDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_remove_trusted_domain_request.py b/zitadel_client/models/instance_service_remove_trusted_domain_request.py index 8b1d755b..79028e0b 100644 --- a/zitadel_client/models/instance_service_remove_trusted_domain_request.py +++ b/zitadel_client/models/instance_service_remove_trusted_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceRemoveTrustedDomainRequest(BaseModel): """ InstanceServiceRemoveTrustedDomainRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance from which the trusted domain will be removed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", alias="instanceId") - trusted_domain: Optional[StrictStr] = Field(default=None, description="The trusted domain to remove from the instance.", alias="trustedDomain") - __properties: ClassVar[List[str]] = ["instanceId", "trustedDomain"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance from which the trusted domain will be removed. If not set, the instance in the current context (e.g. identified by the host header) will be used. If an ID is set, the caller must have additional permissions.", + ) + trusted_domain: Optional[StrictStr] = Field( + default=None, + alias="trustedDomain", + description="The trusted domain to remove from the instance.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InstanceServiceRemoveTrustedDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveTrustedDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveTrustedDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "trustedDomain": obj.get("trustedDomain") - }) - return _obj - - +InstanceServiceRemoveTrustedDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_remove_trusted_domain_response.py b/zitadel_client/models/instance_service_remove_trusted_domain_response.py index f04adfd8..130b6091 100644 --- a/zitadel_client/models/instance_service_remove_trusted_domain_response.py +++ b/zitadel_client/models/instance_service_remove_trusted_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceRemoveTrustedDomainResponse(BaseModel): """ InstanceServiceRemoveTrustedDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceRemoveTrustedDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveTrustedDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceRemoveTrustedDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceRemoveTrustedDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_state.py b/zitadel_client/models/instance_service_state.py index 5d9e10bc..d1ed424e 100644 --- a/zitadel_client/models/instance_service_state.py +++ b/zitadel_client/models/instance_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InstanceServiceState(str, Enum): @@ -23,18 +13,8 @@ class InstanceServiceState(str, Enum): InstanceServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_CREATING = 'STATE_CREATING' - STATE_RUNNING = 'STATE_RUNNING' - STATE_STOPPING = 'STATE_STOPPING' - STATE_STOPPED = 'STATE_STOPPED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InstanceServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_CREATING = "STATE_CREATING" + STATE_RUNNING = "STATE_RUNNING" + STATE_STOPPING = "STATE_STOPPING" + STATE_STOPPED = "STATE_STOPPED" diff --git a/zitadel_client/models/instance_service_text_query_method.py b/zitadel_client/models/instance_service_text_query_method.py index 004144ab..6af6ee63 100644 --- a/zitadel_client/models/instance_service_text_query_method.py +++ b/zitadel_client/models/instance_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InstanceServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class InstanceServiceTextQueryMethod(str, Enum): InstanceServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InstanceServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/instance_service_trusted_domain.py b/zitadel_client/models/instance_service_trusted_domain.py index 12dcc46c..7192d191 100644 --- a/zitadel_client/models/instance_service_trusted_domain.py +++ b/zitadel_client/models/instance_service_trusted_domain.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceTrustedDomain(BaseModel): """ InstanceServiceTrustedDomain - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique identifier of the instance the domain belongs to.", alias="instanceId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the fully qualified domain name.") - __properties: ClassVar[List[str]] = ["instanceId", "creationDate", "domain"] + """ + + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique identifier of the instance the domain belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the fully qualified domain name.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +44,6 @@ class InstanceServiceTrustedDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceTrustedDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceTrustedDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "creationDate": obj.get("creationDate"), - "domain": obj.get("domain") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceTrustedDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_trusted_domain_field_name.py b/zitadel_client/models/instance_service_trusted_domain_field_name.py index 0bf0771a..1e45f85c 100644 --- a/zitadel_client/models/instance_service_trusted_domain_field_name.py +++ b/zitadel_client/models/instance_service_trusted_domain_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InstanceServiceTrustedDomainFieldName(str, Enum): @@ -23,16 +13,6 @@ class InstanceServiceTrustedDomainFieldName(str, Enum): InstanceServiceTrustedDomainFieldName """ - """ - allowed enum values - """ - TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = 'TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED' - TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = 'TRUSTED_DOMAIN_FIELD_NAME_DOMAIN' - TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = 'TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InstanceServiceTrustedDomainFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED = "TRUSTED_DOMAIN_FIELD_NAME_UNSPECIFIED" + TRUSTED_DOMAIN_FIELD_NAME_DOMAIN = "TRUSTED_DOMAIN_FIELD_NAME_DOMAIN" + TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE = "TRUSTED_DOMAIN_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/instance_service_trusted_domain_filter.py b/zitadel_client/models/instance_service_trusted_domain_filter.py index 793e6309..21410f26 100644 --- a/zitadel_client/models/instance_service_trusted_domain_filter.py +++ b/zitadel_client/models/instance_service_trusted_domain_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.instance_service_domain_filter import InstanceServiceDomainFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceTrustedDomainFilter(BaseModel): """ InstanceServiceTrustedDomainFilter - """ # noqa: E501 - domain_filter: Optional[InstanceServiceDomainFilter] = Field(default=None, alias="domainFilter") - __properties: ClassVar[List[str]] = ["domainFilter"] + """ + domain_filter: Optional[InstanceServiceDomainFilter] = Field( + default=None, alias="domainFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class InstanceServiceTrustedDomainFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceTrustedDomainFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_filter - if self.domain_filter: - _dict['domainFilter'] = self.domain_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceTrustedDomainFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainFilter": InstanceServiceDomainFilter.from_dict(obj["domainFilter"]) if obj.get("domainFilter") is not None else None - }) - return _obj - +from zitadel_client.models.instance_service_domain_filter import ( + InstanceServiceDomainFilter, +) +InstanceServiceTrustedDomainFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_update_instance_request.py b/zitadel_client/models/instance_service_update_instance_request.py index 36946b03..403001bc 100644 --- a/zitadel_client/models/instance_service_update_instance_request.py +++ b/zitadel_client/models/instance_service_update_instance_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InstanceServiceUpdateInstanceRequest(BaseModel): """ InstanceServiceUpdateInstanceRequest - """ # noqa: E501 - instance_id: Optional[StrictStr] = Field(default=None, description="InstanceID is the unique ID of the instance to be updated. If not set, the instance in the current context (e.g. identified by the host header) will be changed. If an ID is set, the caller must have additional permissions.", alias="instanceId") - instance_name: Optional[StrictStr] = Field(default=None, description="InstanceName is the new name of the instance to be set.", alias="instanceName") - __properties: ClassVar[List[str]] = ["instanceId", "instanceName"] + """ + instance_id: Optional[StrictStr] = Field( + default=None, + alias="instanceId", + description="InstanceID is the unique ID of the instance to be updated. If not set, the instance in the current context (e.g. identified by the host header) will be changed. If an ID is set, the caller must have additional permissions.", + ) + instance_name: Optional[StrictStr] = Field( + default=None, + alias="instanceName", + description="InstanceName is the new name of the instance to be set.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InstanceServiceUpdateInstanceRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceUpdateInstanceRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceUpdateInstanceRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instanceId": obj.get("instanceId"), - "instanceName": obj.get("instanceName") - }) - return _obj - - +InstanceServiceUpdateInstanceRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/instance_service_update_instance_response.py b/zitadel_client/models/instance_service_update_instance_response.py index 5438e25d..325836ca 100644 --- a/zitadel_client/models/instance_service_update_instance_response.py +++ b/zitadel_client/models/instance_service_update_instance_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InstanceServiceUpdateInstanceResponse(BaseModel): """ InstanceServiceUpdateInstanceResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InstanceServiceUpdateInstanceResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InstanceServiceUpdateInstanceResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InstanceServiceUpdateInstanceResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +InstanceServiceUpdateInstanceResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_administrator.py b/zitadel_client/models/internal_permission_service_administrator.py index 96ed1133..d91efc4a 100644 --- a/zitadel_client/models/internal_permission_service_administrator.py +++ b/zitadel_client/models/internal_permission_service_administrator.py @@ -1,46 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_organization import InternalPermissionServiceOrganization -from zitadel_client.models.internal_permission_service_project import InternalPermissionServiceProject -from zitadel_client.models.internal_permission_service_project_grant import InternalPermissionServiceProjectGrant -from zitadel_client.models.internal_permission_service_user import InternalPermissionServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class InternalPermissionServiceAdministrator(BaseModel): """ InternalPermissionServiceAdministrator - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - user: Optional[InternalPermissionServiceUser] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that were granted to the user for the specified resource.") - instance: Optional[StrictBool] = Field(default=None, description="Instance is returned if the administrator roles were granted on the instance level.") - organization: Optional[InternalPermissionServiceOrganization] = None - project: Optional[InternalPermissionServiceProject] = None - project_grant: Optional[InternalPermissionServiceProjectGrant] = Field(default=None, alias="projectGrant") - __properties: ClassVar[List[str]] = ["creationDate", "changeDate", "user", "roles", "instance", "organization", "project", "projectGrant"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + user: Optional[InternalPermissionServiceUser] = Field(default=None, alias="user") + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that were granted to the user for the specified resource.", + ) + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Instance is returned if the administrator roles were granted on the instance level.", + ) + organization: Optional[InternalPermissionServiceOrganization] = Field( + default=None, alias="organization" + ) + project: Optional[InternalPermissionServiceProject] = Field( + default=None, alias="project" + ) + project_grant: Optional[InternalPermissionServiceProjectGrant] = Field( + default=None, alias="projectGrant" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -48,71 +59,18 @@ class InternalPermissionServiceAdministrator(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAdministrator from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of project - if self.project: - _dict['project'] = self.project.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_grant - if self.project_grant: - _dict['projectGrant'] = self.project_grant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAdministrator from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "user": InternalPermissionServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "roles": obj.get("roles"), - "instance": obj.get("instance"), - "organization": InternalPermissionServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "project": InternalPermissionServiceProject.from_dict(obj["project"]) if obj.get("project") is not None else None, - "projectGrant": InternalPermissionServiceProjectGrant.from_dict(obj["projectGrant"]) if obj.get("projectGrant") is not None else None - }) - return _obj - - +from pydantic import AwareDatetime +from zitadel_client.models.internal_permission_service_organization import ( + InternalPermissionServiceOrganization, +) +from zitadel_client.models.internal_permission_service_project import ( + InternalPermissionServiceProject, +) +from zitadel_client.models.internal_permission_service_project_grant import ( + InternalPermissionServiceProjectGrant, +) +from zitadel_client.models.internal_permission_service_user import ( + InternalPermissionServiceUser, +) + +InternalPermissionServiceAdministrator.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_administrator_field_name.py b/zitadel_client/models/internal_permission_service_administrator_field_name.py index 592f381f..32cf676d 100644 --- a/zitadel_client/models/internal_permission_service_administrator_field_name.py +++ b/zitadel_client/models/internal_permission_service_administrator_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InternalPermissionServiceAdministratorFieldName(str, Enum): @@ -23,17 +13,7 @@ class InternalPermissionServiceAdministratorFieldName(str, Enum): InternalPermissionServiceAdministratorFieldName """ - """ - allowed enum values - """ - ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = 'ADMINISTRATOR_FIELD_NAME_UNSPECIFIED' - ADMINISTRATOR_FIELD_NAME_USER_ID = 'ADMINISTRATOR_FIELD_NAME_USER_ID' - ADMINISTRATOR_FIELD_NAME_CREATION_DATE = 'ADMINISTRATOR_FIELD_NAME_CREATION_DATE' - ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = 'ADMINISTRATOR_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InternalPermissionServiceAdministratorFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + ADMINISTRATOR_FIELD_NAME_UNSPECIFIED = "ADMINISTRATOR_FIELD_NAME_UNSPECIFIED" + ADMINISTRATOR_FIELD_NAME_USER_ID = "ADMINISTRATOR_FIELD_NAME_USER_ID" + ADMINISTRATOR_FIELD_NAME_CREATION_DATE = "ADMINISTRATOR_FIELD_NAME_CREATION_DATE" + ADMINISTRATOR_FIELD_NAME_CHANGE_DATE = "ADMINISTRATOR_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/internal_permission_service_administrator_search_filter.py b/zitadel_client/models/internal_permission_service_administrator_search_filter.py index 497e0574..596f9164 100644 --- a/zitadel_client/models/internal_permission_service_administrator_search_filter.py +++ b/zitadel_client/models/internal_permission_service_administrator_search_filter.py @@ -1,51 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_id_filter import InternalPermissionServiceIDFilter -from zitadel_client.models.internal_permission_service_in_ids_filter import InternalPermissionServiceInIDsFilter -from zitadel_client.models.internal_permission_service_resource_filter import InternalPermissionServiceResourceFilter -from zitadel_client.models.internal_permission_service_role_filter import InternalPermissionServiceRoleFilter -from zitadel_client.models.internal_permission_service_timestamp_filter import InternalPermissionServiceTimestampFilter -from zitadel_client.models.internal_permission_service_user_display_name_filter import InternalPermissionServiceUserDisplayNameFilter -from zitadel_client.models.internal_permission_service_user_preferred_login_name_filter import InternalPermissionServiceUserPreferredLoginNameFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServiceAdministratorSearchFilter(BaseModel): """ InternalPermissionServiceAdministratorSearchFilter - """ # noqa: E501 - var_and: Optional[InternalPermissionServiceAndFilter] = Field(default=None, alias="and") - change_date: Optional[InternalPermissionServiceTimestampFilter] = Field(default=None, alias="changeDate") - creation_date: Optional[InternalPermissionServiceTimestampFilter] = Field(default=None, alias="creationDate") - in_user_ids_filter: Optional[InternalPermissionServiceInIDsFilter] = Field(default=None, alias="inUserIdsFilter") - var_not: Optional[InternalPermissionServiceNotFilter] = Field(default=None, alias="not") - var_or: Optional[InternalPermissionServiceOrFilter] = Field(default=None, alias="or") - resource: Optional[InternalPermissionServiceResourceFilter] = None - role: Optional[InternalPermissionServiceRoleFilter] = None - user_display_name: Optional[InternalPermissionServiceUserDisplayNameFilter] = Field(default=None, alias="userDisplayName") - user_organization_id: Optional[InternalPermissionServiceIDFilter] = Field(default=None, alias="userOrganizationId") - user_preferred_login_name: Optional[InternalPermissionServiceUserPreferredLoginNameFilter] = Field(default=None, alias="userPreferredLoginName") - __properties: ClassVar[List[str]] = ["and", "changeDate", "creationDate", "inUserIdsFilter", "not", "or", "resource", "role", "userDisplayName", "userOrganizationId", "userPreferredLoginName"] + """ + and_: Optional[InternalPermissionServiceAndFilter] = Field( + default=None, alias="and" + ) + change_date: Optional[InternalPermissionServiceTimestampFilter] = Field( + default=None, alias="changeDate" + ) + creation_date: Optional[InternalPermissionServiceTimestampFilter] = Field( + default=None, alias="creationDate" + ) + in_user_ids_filter: Optional[InternalPermissionServiceInIDsFilter] = Field( + default=None, alias="inUserIdsFilter" + ) + not_: Optional[InternalPermissionServiceNotFilter] = Field( + default=None, alias="not" + ) + or_: Optional[InternalPermissionServiceOrFilter] = Field(default=None, alias="or") + resource: Optional[InternalPermissionServiceResourceFilter] = Field( + default=None, alias="resource" + ) + role: Optional[InternalPermissionServiceRoleFilter] = Field( + default=None, alias="role" + ) + user_display_name: Optional[InternalPermissionServiceUserDisplayNameFilter] = Field( + default=None, alias="userDisplayName" + ) + user_organization_id: Optional[InternalPermissionServiceIDFilter] = Field( + default=None, alias="userOrganizationId" + ) + user_preferred_login_name: Optional[ + InternalPermissionServiceUserPreferredLoginNameFilter + ] = Field(default=None, alias="userPreferredLoginName") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -53,100 +59,35 @@ class InternalPermissionServiceAdministratorSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAdministratorSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: +from zitadel_client.models.internal_permission_service_and_filter import ( + InternalPermissionServiceAndFilter, +) +from zitadel_client.models.internal_permission_service_id_filter import ( + InternalPermissionServiceIDFilter, +) +from zitadel_client.models.internal_permission_service_in_ids_filter import ( + InternalPermissionServiceInIDsFilter, +) +from zitadel_client.models.internal_permission_service_not_filter import ( + InternalPermissionServiceNotFilter, +) +from zitadel_client.models.internal_permission_service_or_filter import ( + InternalPermissionServiceOrFilter, +) +from zitadel_client.models.internal_permission_service_resource_filter import ( + InternalPermissionServiceResourceFilter, +) +from zitadel_client.models.internal_permission_service_role_filter import ( + InternalPermissionServiceRoleFilter, +) +from zitadel_client.models.internal_permission_service_timestamp_filter import ( + InternalPermissionServiceTimestampFilter, +) +from zitadel_client.models.internal_permission_service_user_display_name_filter import ( + InternalPermissionServiceUserDisplayNameFilter, +) +from zitadel_client.models.internal_permission_service_user_preferred_login_name_filter import ( + InternalPermissionServiceUserPreferredLoginNameFilter, +) - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of var_and - if self.var_and: - _dict['and'] = self.var_and.to_dict() - # override the default output from pydantic by calling `to_dict()` of change_date - if self.change_date: - _dict['changeDate'] = self.change_date.to_dict() - # override the default output from pydantic by calling `to_dict()` of creation_date - if self.creation_date: - _dict['creationDate'] = self.creation_date.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids_filter - if self.in_user_ids_filter: - _dict['inUserIdsFilter'] = self.in_user_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of var_not - if self.var_not: - _dict['not'] = self.var_not.to_dict() - # override the default output from pydantic by calling `to_dict()` of var_or - if self.var_or: - _dict['or'] = self.var_or.to_dict() - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - # override the default output from pydantic by calling `to_dict()` of role - if self.role: - _dict['role'] = self.role.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_display_name - if self.user_display_name: - _dict['userDisplayName'] = self.user_display_name.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_organization_id - if self.user_organization_id: - _dict['userOrganizationId'] = self.user_organization_id.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_preferred_login_name - if self.user_preferred_login_name: - _dict['userPreferredLoginName'] = self.user_preferred_login_name.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAdministratorSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "and": InternalPermissionServiceAndFilter.from_dict(obj["and"]) if obj.get("and") is not None else None, - "changeDate": InternalPermissionServiceTimestampFilter.from_dict(obj["changeDate"]) if obj.get("changeDate") is not None else None, - "creationDate": InternalPermissionServiceTimestampFilter.from_dict(obj["creationDate"]) if obj.get("creationDate") is not None else None, - "inUserIdsFilter": InternalPermissionServiceInIDsFilter.from_dict(obj["inUserIdsFilter"]) if obj.get("inUserIdsFilter") is not None else None, - "not": InternalPermissionServiceNotFilter.from_dict(obj["not"]) if obj.get("not") is not None else None, - "or": InternalPermissionServiceOrFilter.from_dict(obj["or"]) if obj.get("or") is not None else None, - "resource": InternalPermissionServiceResourceFilter.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "role": InternalPermissionServiceRoleFilter.from_dict(obj["role"]) if obj.get("role") is not None else None, - "userDisplayName": InternalPermissionServiceUserDisplayNameFilter.from_dict(obj["userDisplayName"]) if obj.get("userDisplayName") is not None else None, - "userOrganizationId": InternalPermissionServiceIDFilter.from_dict(obj["userOrganizationId"]) if obj.get("userOrganizationId") is not None else None, - "userPreferredLoginName": InternalPermissionServiceUserPreferredLoginNameFilter.from_dict(obj["userPreferredLoginName"]) if obj.get("userPreferredLoginName") is not None else None - }) - return _obj - -from zitadel_client.models.internal_permission_service_and_filter import InternalPermissionServiceAndFilter -from zitadel_client.models.internal_permission_service_not_filter import InternalPermissionServiceNotFilter -from zitadel_client.models.internal_permission_service_or_filter import InternalPermissionServiceOrFilter -# TODO: Rewrite to not use raise_errors InternalPermissionServiceAdministratorSearchFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/internal_permission_service_and_filter.py b/zitadel_client/models/internal_permission_service_and_filter.py index fca50709..e909ecea 100644 --- a/zitadel_client/models/internal_permission_service_and_filter.py +++ b/zitadel_client/models/internal_permission_service_and_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class InternalPermissionServiceAndFilter(BaseModel): """ InternalPermissionServiceAndFilter - """ # noqa: E501 - queries: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = Field( + default=None, alias="queries" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class InternalPermissionServiceAndFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAndFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAndFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [InternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.internal_permission_service_administrator_search_filter import InternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors InternalPermissionServiceAndFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/internal_permission_service_any.py b/zitadel_client/models/internal_permission_service_any.py index d75462ec..2fcc8bf7 100644 --- a/zitadel_client/models/internal_permission_service_any.py +++ b/zitadel_client/models/internal_permission_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class InternalPermissionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +InternalPermissionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_connect_error.py b/zitadel_client/models/internal_permission_service_connect_error.py index f8486a2a..219e3e05 100644 --- a/zitadel_client/models/internal_permission_service_connect_error.py +++ b/zitadel_client/models/internal_permission_service_connect_error.py @@ -1,122 +1,171 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_any import InternalPermissionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class InternalPermissionServiceConnectErrorCodeEnum(str, Enum): + """InternalPermissionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class InternalPermissionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[InternalPermissionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[InternalPermissionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[InternalPermissionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [InternalPermissionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.internal_permission_service_any import ( + InternalPermissionServiceAny, +) +InternalPermissionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_create_administrator_request.py b/zitadel_client/models/internal_permission_service_create_administrator_request.py index b4bbaecc..f9b4dfe1 100644 --- a/zitadel_client/models/internal_permission_service_create_administrator_request.py +++ b/zitadel_client/models/internal_permission_service_create_administrator_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_resource_type import InternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InternalPermissionServiceCreateAdministratorRequest(BaseModel): """ InternalPermissionServiceCreateAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user who should be granted the administrator role.", alias="userId") - resource: Optional[InternalPermissionServiceResourceType] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles.") - __properties: ClassVar[List[str]] = ["userId", "resource", "roles"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user who should be granted the administrator role.", + ) + resource: Optional[InternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that should be granted to the user for the specified resource. Note that roles are currently specific to the resource type. This means that if you want to grant a user the administrator role for an organization and a project, you need to create two administrator roles.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,8 @@ class InternalPermissionServiceCreateAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceCreateAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceCreateAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": InternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "roles": obj.get("roles") - }) - return _obj - +from zitadel_client.models.internal_permission_service_resource_type import ( + InternalPermissionServiceResourceType, +) +InternalPermissionServiceCreateAdministratorRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_create_administrator_response.py b/zitadel_client/models/internal_permission_service_create_administrator_response.py index 9b445682..7fbae0ac 100644 --- a/zitadel_client/models/internal_permission_service_create_administrator_response.py +++ b/zitadel_client/models/internal_permission_service_create_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServiceCreateAdministratorResponse(BaseModel): """ InternalPermissionServiceCreateAdministratorResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InternalPermissionServiceCreateAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceCreateAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceCreateAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +InternalPermissionServiceCreateAdministratorResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_delete_administrator_request.py b/zitadel_client/models/internal_permission_service_delete_administrator_request.py index 33ecea0b..99377fb5 100644 --- a/zitadel_client/models/internal_permission_service_delete_administrator_request.py +++ b/zitadel_client/models/internal_permission_service_delete_administrator_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_resource_type import InternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceDeleteAdministratorRequest(BaseModel): """ InternalPermissionServiceDeleteAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user whose administrator roles should be removed.", alias="userId") - resource: Optional[InternalPermissionServiceResourceType] = None - __properties: ClassVar[List[str]] = ["userId", "resource"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user whose administrator roles should be removed.", + ) + resource: Optional[InternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +37,8 @@ class InternalPermissionServiceDeleteAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceDeleteAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceDeleteAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": InternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None - }) - return _obj - +from zitadel_client.models.internal_permission_service_resource_type import ( + InternalPermissionServiceResourceType, +) +InternalPermissionServiceDeleteAdministratorRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_delete_administrator_response.py b/zitadel_client/models/internal_permission_service_delete_administrator_response.py index a5fc88b3..7fadb95c 100644 --- a/zitadel_client/models/internal_permission_service_delete_administrator_response.py +++ b/zitadel_client/models/internal_permission_service_delete_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServiceDeleteAdministratorResponse(BaseModel): """ InternalPermissionServiceDeleteAdministratorResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InternalPermissionServiceDeleteAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceDeleteAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceDeleteAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +InternalPermissionServiceDeleteAdministratorResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_id_filter.py b/zitadel_client/models/internal_permission_service_id_filter.py index 98a1f865..e23eea01 100644 --- a/zitadel_client/models/internal_permission_service_id_filter.py +++ b/zitadel_client/models/internal_permission_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceIDFilter(BaseModel): """ InternalPermissionServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class InternalPermissionServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +InternalPermissionServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_in_ids_filter.py b/zitadel_client/models/internal_permission_service_in_ids_filter.py index 34495f1b..09459d0b 100644 --- a/zitadel_client/models/internal_permission_service_in_ids_filter.py +++ b/zitadel_client/models/internal_permission_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InternalPermissionServiceInIDsFilter(BaseModel): """ InternalPermissionServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class InternalPermissionServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +InternalPermissionServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_list_administrators_request.py b/zitadel_client/models/internal_permission_service_list_administrators_request.py index b155013c..51d35b29 100644 --- a/zitadel_client/models/internal_permission_service_list_administrators_request.py +++ b/zitadel_client/models/internal_permission_service_list_administrators_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_administrator_field_name import InternalPermissionServiceAdministratorFieldName -from zitadel_client.models.internal_permission_service_administrator_search_filter import InternalPermissionServiceAdministratorSearchFilter -from zitadel_client.models.internal_permission_service_pagination_request import InternalPermissionServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InternalPermissionServiceListAdministratorsRequest(BaseModel): """ InternalPermissionServiceListAdministratorsRequest - """ # noqa: E501 - pagination: Optional[InternalPermissionServicePaginationRequest] = None - sorting_column: Optional[InternalPermissionServiceAdministratorFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = Field(default=None, description="Filter the administrator roles to be returned.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[InternalPermissionServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[InternalPermissionServiceAdministratorFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = Field( + default=None, + alias="filters", + description="Filter the administrator roles to be returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class InternalPermissionServiceListAdministratorsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceListAdministratorsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceListAdministratorsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": InternalPermissionServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [InternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.internal_permission_service_administrator_field_name import ( + InternalPermissionServiceAdministratorFieldName, +) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter, +) +from zitadel_client.models.internal_permission_service_pagination_request import ( + InternalPermissionServicePaginationRequest, +) +InternalPermissionServiceListAdministratorsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_list_administrators_response.py b/zitadel_client/models/internal_permission_service_list_administrators_response.py index 8f7c561c..679c2b2b 100644 --- a/zitadel_client/models/internal_permission_service_list_administrators_response.py +++ b/zitadel_client/models/internal_permission_service_list_administrators_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_administrator import InternalPermissionServiceAdministrator -from zitadel_client.models.internal_permission_service_pagination_response import InternalPermissionServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class InternalPermissionServiceListAdministratorsResponse(BaseModel): """ InternalPermissionServiceListAdministratorsResponse - """ # noqa: E501 - pagination: Optional[InternalPermissionServicePaginationResponse] = None - administrators: Optional[List[InternalPermissionServiceAdministrator]] = Field(default=None, description="Administrators contains the list of administrators matching the request.") - __properties: ClassVar[List[str]] = ["pagination", "administrators"] + """ + + pagination: Optional[InternalPermissionServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + administrators: Optional[List[InternalPermissionServiceAdministrator]] = Field( + default=None, + alias="administrators", + description="Administrators contains the list of administrators matching the request.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class InternalPermissionServiceListAdministratorsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceListAdministratorsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in administrators (list) - _items = [] - if self.administrators: - for _item_administrators in self.administrators: - if _item_administrators: - _items.append(_item_administrators.to_dict()) - _dict['administrators'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceListAdministratorsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": InternalPermissionServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "administrators": [InternalPermissionServiceAdministrator.from_dict(_item) for _item in obj["administrators"]] if obj.get("administrators") is not None else None - }) - return _obj - +from zitadel_client.models.internal_permission_service_administrator import ( + InternalPermissionServiceAdministrator, +) +from zitadel_client.models.internal_permission_service_pagination_response import ( + InternalPermissionServicePaginationResponse, +) +InternalPermissionServiceListAdministratorsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_not_filter.py b/zitadel_client/models/internal_permission_service_not_filter.py index bc79fcfe..8f712752 100644 --- a/zitadel_client/models/internal_permission_service_not_filter.py +++ b/zitadel_client/models/internal_permission_service_not_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class InternalPermissionServiceNotFilter(BaseModel): """ InternalPermissionServiceNotFilter - """ # noqa: E501 - query: Optional[InternalPermissionServiceAdministratorSearchFilter] = None - __properties: ClassVar[List[str]] = ["query"] + """ + query: Optional[InternalPermissionServiceAdministratorSearchFilter] = Field( + default=None, alias="query" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,58 +31,8 @@ class InternalPermissionServiceNotFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceNotFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceNotFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": InternalPermissionServiceAdministratorSearchFilter.from_dict(obj["query"]) if obj.get("query") is not None else None - }) - return _obj - -from zitadel_client.models.internal_permission_service_administrator_search_filter import InternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors InternalPermissionServiceNotFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/internal_permission_service_or_filter.py b/zitadel_client/models/internal_permission_service_or_filter.py index 98683179..c1048e75 100644 --- a/zitadel_client/models/internal_permission_service_or_filter.py +++ b/zitadel_client/models/internal_permission_service_or_filter.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class InternalPermissionServiceOrFilter(BaseModel): """ InternalPermissionServiceOrFilter - """ # noqa: E501 - queries: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + queries: Optional[List[InternalPermissionServiceAdministratorSearchFilter]] = Field( + default=None, alias="queries" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,8 @@ class InternalPermissionServiceOrFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) +from zitadel_client.models.internal_permission_service_administrator_search_filter import ( + InternalPermissionServiceAdministratorSearchFilter, +) - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceOrFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceOrFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [InternalPermissionServiceAdministratorSearchFilter.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - -from zitadel_client.models.internal_permission_service_administrator_search_filter import InternalPermissionServiceAdministratorSearchFilter -# TODO: Rewrite to not use raise_errors InternalPermissionServiceOrFilter.model_rebuild(raise_errors=False) - diff --git a/zitadel_client/models/internal_permission_service_organization.py b/zitadel_client/models/internal_permission_service_organization.py index 62a8a308..75a70768 100644 --- a/zitadel_client/models/internal_permission_service_organization.py +++ b/zitadel_client/models/internal_permission_service_organization.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceOrganization(BaseModel): """ InternalPermissionServiceOrganization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the organization the user was granted the administrator role for.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the organization the user was granted the administrator role for.") - __properties: ClassVar[List[str]] = ["id", "name"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the organization the user was granted the administrator role for.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the name of the organization the user was granted the administrator role for.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InternalPermissionServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - return _obj - - +InternalPermissionServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_pagination_request.py b/zitadel_client/models/internal_permission_service_pagination_request.py index bf2d3a20..4597ff47 100644 --- a/zitadel_client/models/internal_permission_service_pagination_request.py +++ b/zitadel_client/models/internal_permission_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class InternalPermissionServicePaginationRequest(BaseModel): """ InternalPermissionServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class InternalPermissionServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +InternalPermissionServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_pagination_response.py b/zitadel_client/models/internal_permission_service_pagination_response.py index 05c87add..4237372c 100644 --- a/zitadel_client/models/internal_permission_service_pagination_response.py +++ b/zitadel_client/models/internal_permission_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServicePaginationResponse(BaseModel): """ InternalPermissionServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class InternalPermissionServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +InternalPermissionServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_project.py b/zitadel_client/models/internal_permission_service_project.py index 56263140..8c0550e0 100644 --- a/zitadel_client/models/internal_permission_service_project.py +++ b/zitadel_client/models/internal_permission_service_project.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceProject(BaseModel): """ InternalPermissionServiceProject - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the project the user was granted the administrator role for.") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the project the user was granted the administrator role for.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the ID of the organization the project belongs to.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "name", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the project the user was granted the administrator role for.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the name of the project the user was granted the administrator role for.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the ID of the organization the project belongs to.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class InternalPermissionServiceProject(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceProject from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceProject from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +InternalPermissionServiceProject.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_project_grant.py b/zitadel_client/models/internal_permission_service_project_grant.py index 0c43aaa1..a3d30155 100644 --- a/zitadel_client/models/internal_permission_service_project_grant.py +++ b/zitadel_client/models/internal_permission_service_project_grant.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceProjectGrant(BaseModel): """ InternalPermissionServiceProjectGrant - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project the project grant belongs to.", alias="projectId") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization the project was granted to and on which the administrator role should be granted.", alias="organizationId") - __properties: ClassVar[List[str]] = ["projectId", "organizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project the project grant belongs to.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization the project was granted to and on which the administrator role should be granted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class InternalPermissionServiceProjectGrant(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceProjectGrant from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceProjectGrant from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +InternalPermissionServiceProjectGrant.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_resource_filter.py b/zitadel_client/models/internal_permission_service_resource_filter.py index 365583cc..4d0f3f1c 100644 --- a/zitadel_client/models/internal_permission_service_resource_filter.py +++ b/zitadel_client/models/internal_permission_service_resource_filter.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_project_grant import InternalPermissionServiceProjectGrant -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class InternalPermissionServiceResourceFilter(BaseModel): """ InternalPermissionServiceResourceFilter - """ # noqa: E501 - instance: Optional[StrictBool] = Field(default=None, description="Search for administrators granted on the instance level.") - organization_id: Optional[StrictStr] = Field(default=None, description="Search for administrators granted on a specific organization.", alias="organizationId") - project_grant: Optional[InternalPermissionServiceProjectGrant] = Field(default=None, alias="projectGrant") - project_id: Optional[StrictStr] = Field(default=None, description="Search for administrators granted on a specific project.", alias="projectId") - __properties: ClassVar[List[str]] = ["instance", "organizationId", "projectGrant", "projectId"] + """ + + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Search for administrators granted on the instance level.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Search for administrators granted on a specific organization.", + ) + project_grant: Optional[InternalPermissionServiceProjectGrant] = Field( + default=None, alias="projectGrant" + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="Search for administrators granted on a specific project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +47,8 @@ class InternalPermissionServiceResourceFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceResourceFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project_grant - if self.project_grant: - _dict['projectGrant'] = self.project_grant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceResourceFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId"), - "projectGrant": InternalPermissionServiceProjectGrant.from_dict(obj["projectGrant"]) if obj.get("projectGrant") is not None else None, - "projectId": obj.get("projectId") - }) - return _obj - +from zitadel_client.models.internal_permission_service_project_grant import ( + InternalPermissionServiceProjectGrant, +) +InternalPermissionServiceResourceFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_resource_type.py b/zitadel_client/models/internal_permission_service_resource_type.py index a086db26..3fde6af2 100644 --- a/zitadel_client/models/internal_permission_service_resource_type.py +++ b/zitadel_client/models/internal_permission_service_resource_type.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_project_grant import InternalPermissionServiceProjectGrant -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class InternalPermissionServiceResourceType(BaseModel): """ InternalPermissionServiceResourceType - """ # noqa: E501 - instance: Optional[StrictBool] = Field(default=None, description="Instance is the resource type for granting administrator privileges on the instance level.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is required to grant administrator privileges for a specific organization.", alias="organizationId") - project_grant: Optional[InternalPermissionServiceProjectGrant] = Field(default=None, alias="projectGrant") - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is required to grant administrator privileges for a specific project.", alias="projectId") - __properties: ClassVar[List[str]] = ["instance", "organizationId", "projectGrant", "projectId"] + """ + + instance: Optional[StrictBool] = Field( + default=None, + alias="instance", + description="Instance is the resource type for granting administrator privileges on the instance level.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is required to grant administrator privileges for a specific organization.", + ) + project_grant: Optional[InternalPermissionServiceProjectGrant] = Field( + default=None, alias="projectGrant" + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is required to grant administrator privileges for a specific project.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +47,8 @@ class InternalPermissionServiceResourceType(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceResourceType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project_grant - if self.project_grant: - _dict['projectGrant'] = self.project_grant.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceResourceType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId"), - "projectGrant": InternalPermissionServiceProjectGrant.from_dict(obj["projectGrant"]) if obj.get("projectGrant") is not None else None, - "projectId": obj.get("projectId") - }) - return _obj - +from zitadel_client.models.internal_permission_service_project_grant import ( + InternalPermissionServiceProjectGrant, +) +InternalPermissionServiceResourceType.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_role_filter.py b/zitadel_client/models/internal_permission_service_role_filter.py index bb3000cd..f795fd04 100644 --- a/zitadel_client/models/internal_permission_service_role_filter.py +++ b/zitadel_client/models/internal_permission_service_role_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceRoleFilter(BaseModel): """ InternalPermissionServiceRoleFilter - """ # noqa: E501 - role_key: Optional[StrictStr] = Field(default=None, description="Search for administrators by the granted role.", alias="roleKey") - __properties: ClassVar[List[str]] = ["roleKey"] + """ + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="Search for administrators by the granted role.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class InternalPermissionServiceRoleFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceRoleFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceRoleFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "roleKey": obj.get("roleKey") - }) - return _obj - - +InternalPermissionServiceRoleFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_text_filter_method.py b/zitadel_client/models/internal_permission_service_text_filter_method.py index 31e10073..001c1fe9 100644 --- a/zitadel_client/models/internal_permission_service_text_filter_method.py +++ b/zitadel_client/models/internal_permission_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InternalPermissionServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class InternalPermissionServiceTextFilterMethod(str, Enum): InternalPermissionServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InternalPermissionServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/internal_permission_service_timestamp_filter.py b/zitadel_client/models/internal_permission_service_timestamp_filter.py index 70dd40d6..3bbae0d1 100644 --- a/zitadel_client/models/internal_permission_service_timestamp_filter.py +++ b/zitadel_client/models/internal_permission_service_timestamp_filter.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_timestamp_filter_method import InternalPermissionServiceTimestampFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServiceTimestampFilter(BaseModel): """ InternalPermissionServiceTimestampFilter - """ # noqa: E501 - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - method: Optional[InternalPermissionServiceTimestampFilterMethod] = None - __properties: ClassVar[List[str]] = ["timestamp", "method"] + """ + + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[InternalPermissionServiceTimestampFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class InternalPermissionServiceTimestampFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceTimestampFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceTimestampFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.internal_permission_service_timestamp_filter_method import ( + InternalPermissionServiceTimestampFilterMethod, +) +InternalPermissionServiceTimestampFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_timestamp_filter_method.py b/zitadel_client/models/internal_permission_service_timestamp_filter_method.py index 88b57618..d8eebb13 100644 --- a/zitadel_client/models/internal_permission_service_timestamp_filter_method.py +++ b/zitadel_client/models/internal_permission_service_timestamp_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class InternalPermissionServiceTimestampFilterMethod(str, Enum): @@ -23,18 +13,10 @@ class InternalPermissionServiceTimestampFilterMethod(str, Enum): InternalPermissionServiceTimestampFilterMethod """ - """ - allowed enum values - """ - TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' - TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' - TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of InternalPermissionServiceTimestampFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS" + TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER" + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS" + TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE" + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = ( + "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS" + ) diff --git a/zitadel_client/models/internal_permission_service_update_administrator_request.py b/zitadel_client/models/internal_permission_service_update_administrator_request.py index bab2038a..2d538fc6 100644 --- a/zitadel_client/models/internal_permission_service_update_administrator_request.py +++ b/zitadel_client/models/internal_permission_service_update_administrator_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.internal_permission_service_resource_type import InternalPermissionServiceResourceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class InternalPermissionServiceUpdateAdministratorRequest(BaseModel): """ InternalPermissionServiceUpdateAdministratorRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="UserID is the ID of the user whose administrator roles should be updated.", alias="userId") - resource: Optional[InternalPermissionServiceResourceType] = None - roles: Optional[List[StrictStr]] = Field(default=None, description="Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked.") - __properties: ClassVar[List[str]] = ["userId", "resource", "roles"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="UserID is the ID of the user whose administrator roles should be updated.", + ) + resource: Optional[InternalPermissionServiceResourceType] = Field( + default=None, alias="resource" + ) + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="Roles are the roles that the user should be granted. Note that any role previously granted to the user and not present in the list will be revoked.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +42,8 @@ class InternalPermissionServiceUpdateAdministratorRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUpdateAdministratorRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of resource - if self.resource: - _dict['resource'] = self.resource.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUpdateAdministratorRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "resource": InternalPermissionServiceResourceType.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "roles": obj.get("roles") - }) - return _obj - +from zitadel_client.models.internal_permission_service_resource_type import ( + InternalPermissionServiceResourceType, +) +InternalPermissionServiceUpdateAdministratorRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_update_administrator_response.py b/zitadel_client/models/internal_permission_service_update_administrator_response.py index f0f34396..3f4d8183 100644 --- a/zitadel_client/models/internal_permission_service_update_administrator_response.py +++ b/zitadel_client/models/internal_permission_service_update_administrator_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class InternalPermissionServiceUpdateAdministratorResponse(BaseModel): """ InternalPermissionServiceUpdateAdministratorResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class InternalPermissionServiceUpdateAdministratorResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUpdateAdministratorResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUpdateAdministratorResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +InternalPermissionServiceUpdateAdministratorResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_user.py b/zitadel_client/models/internal_permission_service_user.py index 6c1f653e..2402241d 100644 --- a/zitadel_client/models/internal_permission_service_user.py +++ b/zitadel_client/models/internal_permission_service_user.py @@ -1,37 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceUser(BaseModel): """ InternalPermissionServiceUser - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the user.") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance.", alias="preferredLoginName") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address.", alias="displayName") - organization_id: Optional[StrictStr] = Field(default=None, description="The organization the user belong to.", alias="organizationId") - __properties: ClassVar[List[str]] = ["id", "preferredLoginName", "displayName", "organizationId"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="ID is the unique identifier of the user." + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="PreferredLoginName is the preferred login name of the user. This value is unique across the whole instance.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName is the public display name of the user. By default it's the user's given name and family name, their username or their email address.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The organization the user belong to.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +47,4 @@ class InternalPermissionServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "preferredLoginName": obj.get("preferredLoginName"), - "displayName": obj.get("displayName"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +InternalPermissionServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_user_display_name_filter.py b/zitadel_client/models/internal_permission_service_user_display_name_filter.py index 785c04d4..ecaff99f 100644 --- a/zitadel_client/models/internal_permission_service_user_display_name_filter.py +++ b/zitadel_client/models/internal_permission_service_user_display_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_text_filter_method import InternalPermissionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceUserDisplayNameFilter(BaseModel): """ InternalPermissionServiceUserDisplayNameFilter - """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="Search for administrators by the display name of the user.", alias="displayName") - method: Optional[InternalPermissionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + """ + + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="Search for administrators by the display name of the user.", + ) + method: Optional[InternalPermissionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class InternalPermissionServiceUserDisplayNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUserDisplayNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUserDisplayNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.internal_permission_service_text_filter_method import ( + InternalPermissionServiceTextFilterMethod, +) +InternalPermissionServiceUserDisplayNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/internal_permission_service_user_preferred_login_name_filter.py b/zitadel_client/models/internal_permission_service_user_preferred_login_name_filter.py index 83e03ffd..9ce0b463 100644 --- a/zitadel_client/models/internal_permission_service_user_preferred_login_name_filter.py +++ b/zitadel_client/models/internal_permission_service_user_preferred_login_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.internal_permission_service_text_filter_method import InternalPermissionServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class InternalPermissionServiceUserPreferredLoginNameFilter(BaseModel): """ InternalPermissionServiceUserPreferredLoginNameFilter - """ # noqa: E501 - preferred_login_name: Optional[StrictStr] = Field(default=None, description="Search for administrators by the preferred login name of the user.", alias="preferredLoginName") - method: Optional[InternalPermissionServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["preferredLoginName", "method"] + """ + + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="Search for administrators by the preferred login name of the user.", + ) + method: Optional[InternalPermissionServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class InternalPermissionServiceUserPreferredLoginNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUserPreferredLoginNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of InternalPermissionServiceUserPreferredLoginNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "preferredLoginName": obj.get("preferredLoginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.internal_permission_service_text_filter_method import ( + InternalPermissionServiceTextFilterMethod, +) +InternalPermissionServiceUserPreferredLoginNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_any.py b/zitadel_client/models/oidc_service_any.py index 01577513..00addf92 100644 --- a/zitadel_client/models/oidc_service_any.py +++ b/zitadel_client/models/oidc_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class OIDCServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +OIDCServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_auth_request.py b/zitadel_client/models/oidc_service_auth_request.py index 3968c949..667fe648 100644 --- a/zitadel_client/models/oidc_service_auth_request.py +++ b/zitadel_client/models/oidc_service_auth_request.py @@ -1,45 +1,77 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.oidc_service_prompt import OIDCServicePrompt -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OIDCServiceAuthRequest(BaseModel): """ AuthRequest represents an OpenID Connect Authorization Request as defined in https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the authorization request.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - client_id: Optional[StrictStr] = Field(default=None, description="The OAuth2/OIDC client_id of the application that initiated the authorization request.", alias="clientId") - scope: Optional[List[StrictStr]] = Field(default=None, description="The scopes by the application that the user must consent to.") - redirect_uri: Optional[StrictStr] = Field(default=None, description="The redirect_uri used in the authorization request. This must exactly match one of the redirect URIs registered for the client. This uri is used to send the authorization code or tokens back to the application.", alias="redirectUri") - prompt: Optional[List[OIDCServicePrompt]] = Field(default=None, description="Prompts that must be displayed to the user.") - ui_locales: Optional[List[StrictStr]] = Field(default=None, description="End-User's preferred languages and scripts for the user interface, represented as a list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value [fr-CA, fr, en] represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported.", alias="uiLocales") - login_hint: Optional[StrictStr] = Field(default=None, description="Login hint can be set by the application with a user identifier such as an email or phone number.", alias="loginHint") - max_age: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="maxAge") - hint_user_id: Optional[StrictStr] = Field(default=None, description="User ID taken from a ID Token Hint if it was present and valid.", alias="hintUserId") - __properties: ClassVar[List[str]] = ["id", "creationDate", "clientId", "scope", "redirectUri", "prompt", "uiLocales", "loginHint", "maxAge", "hintUserId"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the authorization request.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The OAuth2/OIDC client_id of the application that initiated the authorization request.", + ) + scope: Optional[List[StrictStr]] = Field( + default=None, + alias="scope", + description="The scopes by the application that the user must consent to.", + ) + redirect_uri: Optional[StrictStr] = Field( + default=None, + alias="redirectUri", + description="The redirect_uri used in the authorization request. This must exactly match one of the redirect URIs registered for the client. This uri is used to send the authorization code or tokens back to the application.", + ) + prompt: Optional[List[OIDCServicePrompt]] = Field( + default=None, + alias="prompt", + description="Prompts that must be displayed to the user.", + ) + ui_locales: Optional[List[StrictStr]] = Field( + default=None, + alias="uiLocales", + description="End-User's preferred languages and scripts for the user interface, represented as a list of BCP47 [RFC5646] language tag values, ordered by preference. For instance, the value [fr-CA, fr, en] represents a preference for French as spoken in Canada, then French (without a region designation), followed by English (without a region designation). An error SHOULD NOT result if some or all of the requested locales are not supported.", + ) + login_hint: Optional[StrictStr] = Field( + default=None, + alias="loginHint", + description="Login hint can be set by the application with a user identifier such as an email or phone number.", + ) + max_age: Optional[ProtobufDuration] = Field( + default=None, + alias="maxAge", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + hint_user_id: Optional[StrictStr] = Field( + default=None, + alias="hintUserId", + description="User ID taken from a ID Token Hint if it was present and valid.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,71 +79,8 @@ class OIDCServiceAuthRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceAuthRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if login_hint (nullable) is None - # and model_fields_set contains the field - if self.login_hint is None and "login_hint" in self.model_fields_set: - _dict['loginHint'] = None - - # set to None if hint_user_id (nullable) is None - # and model_fields_set contains the field - if self.hint_user_id is None and "hint_user_id" in self.model_fields_set: - _dict['hintUserId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceAuthRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "clientId": obj.get("clientId"), - "scope": obj.get("scope"), - "redirectUri": obj.get("redirectUri"), - "prompt": obj.get("prompt"), - "uiLocales": obj.get("uiLocales"), - "loginHint": obj.get("loginHint"), - "maxAge": obj.get("maxAge"), - "hintUserId": obj.get("hintUserId") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.oidc_service_prompt import OIDCServicePrompt +OIDCServiceAuthRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_authorization_error.py b/zitadel_client/models/oidc_service_authorization_error.py index 6b5e2056..d1b74d09 100644 --- a/zitadel_client/models/oidc_service_authorization_error.py +++ b/zitadel_client/models/oidc_service_authorization_error.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_error_reason import OIDCServiceErrorReason -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceAuthorizationError(BaseModel): """ OIDCServiceAuthorizationError - """ # noqa: E501 - error: Optional[OIDCServiceErrorReason] = None - error_description: Optional[StrictStr] = Field(default=None, alias="errorDescription") + """ + + error: Optional[OIDCServiceErrorReason] = Field(default=None, alias="error") + error_description: Optional[StrictStr] = Field( + default=None, alias="errorDescription" + ) error_uri: Optional[StrictStr] = Field(default=None, alias="errorUri") - __properties: ClassVar[List[str]] = ["error", "errorDescription", "errorUri"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +34,6 @@ class OIDCServiceAuthorizationError(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceAuthorizationError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if error_description (nullable) is None - # and model_fields_set contains the field - if self.error_description is None and "error_description" in self.model_fields_set: - _dict['errorDescription'] = None - - # set to None if error_uri (nullable) is None - # and model_fields_set contains the field - if self.error_uri is None and "error_uri" in self.model_fields_set: - _dict['errorUri'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceAuthorizationError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "error": obj.get("error"), - "errorDescription": obj.get("errorDescription"), - "errorUri": obj.get("errorUri") - }) - return _obj - +from zitadel_client.models.oidc_service_error_reason import OIDCServiceErrorReason +OIDCServiceAuthorizationError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_authorize_or_deny_device_authorization_request.py b/zitadel_client/models/oidc_service_authorize_or_deny_device_authorization_request.py index acdd4ce2..2c85aad5 100644 --- a/zitadel_client/models/oidc_service_authorize_or_deny_device_authorization_request.py +++ b/zitadel_client/models/oidc_service_authorize_or_deny_device_authorization_request.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_session import OIDCServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest(BaseModel): """ OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest - """ # noqa: E501 - device_authorization_id: Optional[StrictStr] = Field(default=None, description="The device authorization id returned when submitting the user code.", alias="deviceAuthorizationId") - deny: Optional[Dict[str, Any]] = None - session: Optional[OIDCServiceSession] = None - __properties: ClassVar[List[str]] = ["deviceAuthorizationId", "deny", "session"] + """ + device_authorization_id: Optional[StrictStr] = Field( + default=None, + alias="deviceAuthorizationId", + description="The device authorization id returned when submitting the user code.", + ) + deny: Optional[object] = Field(default=None, alias="deny") + session: Optional[OIDCServiceSession] = Field(default=None, alias="session") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +36,6 @@ class OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deviceAuthorizationId": obj.get("deviceAuthorizationId"), - "deny": obj.get("deny"), - "session": OIDCServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.oidc_service_session import OIDCServiceSession +OIDCServiceAuthorizeOrDenyDeviceAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_connect_error.py b/zitadel_client/models/oidc_service_connect_error.py index b3e8739a..6c902141 100644 --- a/zitadel_client/models/oidc_service_connect_error.py +++ b/zitadel_client/models/oidc_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.oidc_service_any import OIDCServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class OIDCServiceConnectErrorCodeEnum(str, Enum): + """OIDCServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class OIDCServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[OIDCServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[OIDCServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[OIDCServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [OIDCServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.oidc_service_any import OIDCServiceAny +OIDCServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_create_callback_request.py b/zitadel_client/models/oidc_service_create_callback_request.py index 8777b8d7..c7275616 100644 --- a/zitadel_client/models/oidc_service_create_callback_request.py +++ b/zitadel_client/models/oidc_service_create_callback_request.py @@ -1,38 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_authorization_error import OIDCServiceAuthorizationError -from zitadel_client.models.oidc_service_session import OIDCServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceCreateCallbackRequest(BaseModel): """ OIDCServiceCreateCallbackRequest - """ # noqa: E501 - auth_request_id: Optional[StrictStr] = Field(default=None, description="The ID of the Auth Request to finalize.", alias="authRequestId") - error: Optional[OIDCServiceAuthorizationError] = None - session: Optional[OIDCServiceSession] = None - __properties: ClassVar[List[str]] = ["authRequestId", "error", "session"] + """ + auth_request_id: Optional[StrictStr] = Field( + default=None, + alias="authRequestId", + description="The ID of the Auth Request to finalize.", + ) + error: Optional[OIDCServiceAuthorizationError] = Field(default=None, alias="error") + session: Optional[OIDCServiceSession] = Field(default=None, alias="session") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +36,9 @@ class OIDCServiceCreateCallbackRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceCreateCallbackRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of error - if self.error: - _dict['error'] = self.error.to_dict() - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceCreateCallbackRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequestId": obj.get("authRequestId"), - "error": OIDCServiceAuthorizationError.from_dict(obj["error"]) if obj.get("error") is not None else None, - "session": OIDCServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.oidc_service_authorization_error import ( + OIDCServiceAuthorizationError, +) +from zitadel_client.models.oidc_service_session import OIDCServiceSession +OIDCServiceCreateCallbackRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_create_callback_response.py b/zitadel_client/models/oidc_service_create_callback_response.py index cea9e974..6018f067 100644 --- a/zitadel_client/models/oidc_service_create_callback_response.py +++ b/zitadel_client/models/oidc_service_create_callback_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_details import OIDCServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceCreateCallbackResponse(BaseModel): """ OIDCServiceCreateCallbackResponse - """ # noqa: E501 - details: Optional[OIDCServiceDetails] = None - callback_url: Optional[StrictStr] = Field(default=None, description="The callback URL where the user should be redirected using an HTTP \"302 FOUND\" status. This contains details for the application to obtain the tokens on success, or error details on failure. Note that this field must be treated as credentials, as the contained code can be used to obtain tokens on behalf of the user.\"", alias="callbackUrl") - __properties: ClassVar[List[str]] = ["details", "callbackUrl"] + """ + details: Optional[OIDCServiceDetails] = Field(default=None, alias="details") + callback_url: Optional[StrictStr] = Field( + default=None, + alias="callbackUrl", + description='The callback URL where the user should be redirected using an HTTP "302 FOUND" status. This contains details for the application to obtain the tokens on success, or error details on failure. Note that this field must be treated as credentials, as the contained code can be used to obtain tokens on behalf of the user."', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +35,6 @@ class OIDCServiceCreateCallbackResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceCreateCallbackResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceCreateCallbackResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": OIDCServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "callbackUrl": obj.get("callbackUrl") - }) - return _obj - +from zitadel_client.models.oidc_service_details import OIDCServiceDetails +OIDCServiceCreateCallbackResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_details.py b/zitadel_client/models/oidc_service_details.py index eb6407bb..81fac2e6 100644 --- a/zitadel_client/models/oidc_service_details.py +++ b/zitadel_client/models/oidc_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceDetails(BaseModel): """ OIDCServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class OIDCServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +OIDCServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_device_authorization_request.py b/zitadel_client/models/oidc_service_device_authorization_request.py index 471d95a5..47932c48 100644 --- a/zitadel_client/models/oidc_service_device_authorization_request.py +++ b/zitadel_client/models/oidc_service_device_authorization_request.py @@ -1,38 +1,50 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OIDCServiceDeviceAuthorizationRequest(BaseModel): """ OIDCServiceDeviceAuthorizationRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the device authorization request to be used for authorizing or denying the request.") - client_id: Optional[StrictStr] = Field(default=None, description="The client_id of the application that initiated the device authorization request.", alias="clientId") - scope: Optional[List[StrictStr]] = Field(default=None, description="The scopes requested by the application.") - app_name: Optional[StrictStr] = Field(default=None, description="Name of the client application.", alias="appName") - project_name: Optional[StrictStr] = Field(default=None, description="Name of the project the client application is part of.", alias="projectName") - __properties: ClassVar[List[str]] = ["id", "clientId", "scope", "appName", "projectName"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the device authorization request to be used for authorizing or denying the request.", + ) + client_id: Optional[StrictStr] = Field( + default=None, + alias="clientId", + description="The client_id of the application that initiated the device authorization request.", + ) + scope: Optional[List[StrictStr]] = Field( + default=None, + alias="scope", + description="The scopes requested by the application.", + ) + app_name: Optional[StrictStr] = Field( + default=None, alias="appName", description="Name of the client application." + ) + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="Name of the project the client application is part of.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +52,4 @@ class OIDCServiceDeviceAuthorizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceDeviceAuthorizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceDeviceAuthorizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "clientId": obj.get("clientId"), - "scope": obj.get("scope"), - "appName": obj.get("appName"), - "projectName": obj.get("projectName") - }) - return _obj - - +OIDCServiceDeviceAuthorizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_error_reason.py b/zitadel_client/models/oidc_service_error_reason.py index 71e83bb6..e635e130 100644 --- a/zitadel_client/models/oidc_service_error_reason.py +++ b/zitadel_client/models/oidc_service_error_reason.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OIDCServiceErrorReason(str, Enum): @@ -23,30 +13,20 @@ class OIDCServiceErrorReason(str, Enum): OIDCServiceErrorReason """ - """ - allowed enum values - """ - ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' - ERROR_REASON_INVALID_REQUEST = 'ERROR_REASON_INVALID_REQUEST' - ERROR_REASON_UNAUTHORIZED_CLIENT = 'ERROR_REASON_UNAUTHORIZED_CLIENT' - ERROR_REASON_ACCESS_DENIED = 'ERROR_REASON_ACCESS_DENIED' - ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = 'ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE' - ERROR_REASON_INVALID_SCOPE = 'ERROR_REASON_INVALID_SCOPE' - ERROR_REASON_SERVER_ERROR = 'ERROR_REASON_SERVER_ERROR' - ERROR_REASON_TEMPORARY_UNAVAILABLE = 'ERROR_REASON_TEMPORARY_UNAVAILABLE' - ERROR_REASON_INTERACTION_REQUIRED = 'ERROR_REASON_INTERACTION_REQUIRED' - ERROR_REASON_LOGIN_REQUIRED = 'ERROR_REASON_LOGIN_REQUIRED' - ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = 'ERROR_REASON_ACCOUNT_SELECTION_REQUIRED' - ERROR_REASON_CONSENT_REQUIRED = 'ERROR_REASON_CONSENT_REQUIRED' - ERROR_REASON_INVALID_REQUEST_URI = 'ERROR_REASON_INVALID_REQUEST_URI' - ERROR_REASON_INVALID_REQUEST_OBJECT = 'ERROR_REASON_INVALID_REQUEST_OBJECT' - ERROR_REASON_REQUEST_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_NOT_SUPPORTED' - ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = 'ERROR_REASON_REQUEST_URI_NOT_SUPPORTED' - ERROR_REASON_REGISTRATION_NOT_SUPPORTED = 'ERROR_REASON_REGISTRATION_NOT_SUPPORTED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OIDCServiceErrorReason from a JSON string""" - return cls(json.loads(json_str)) - - + ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED" + ERROR_REASON_INVALID_REQUEST = "ERROR_REASON_INVALID_REQUEST" + ERROR_REASON_UNAUTHORIZED_CLIENT = "ERROR_REASON_UNAUTHORIZED_CLIENT" + ERROR_REASON_ACCESS_DENIED = "ERROR_REASON_ACCESS_DENIED" + ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE = "ERROR_REASON_UNSUPPORTED_RESPONSE_TYPE" + ERROR_REASON_INVALID_SCOPE = "ERROR_REASON_INVALID_SCOPE" + ERROR_REASON_SERVER_ERROR = "ERROR_REASON_SERVER_ERROR" + ERROR_REASON_TEMPORARY_UNAVAILABLE = "ERROR_REASON_TEMPORARY_UNAVAILABLE" + ERROR_REASON_INTERACTION_REQUIRED = "ERROR_REASON_INTERACTION_REQUIRED" + ERROR_REASON_LOGIN_REQUIRED = "ERROR_REASON_LOGIN_REQUIRED" + ERROR_REASON_ACCOUNT_SELECTION_REQUIRED = "ERROR_REASON_ACCOUNT_SELECTION_REQUIRED" + ERROR_REASON_CONSENT_REQUIRED = "ERROR_REASON_CONSENT_REQUIRED" + ERROR_REASON_INVALID_REQUEST_URI = "ERROR_REASON_INVALID_REQUEST_URI" + ERROR_REASON_INVALID_REQUEST_OBJECT = "ERROR_REASON_INVALID_REQUEST_OBJECT" + ERROR_REASON_REQUEST_NOT_SUPPORTED = "ERROR_REASON_REQUEST_NOT_SUPPORTED" + ERROR_REASON_REQUEST_URI_NOT_SUPPORTED = "ERROR_REASON_REQUEST_URI_NOT_SUPPORTED" + ERROR_REASON_REGISTRATION_NOT_SUPPORTED = "ERROR_REASON_REGISTRATION_NOT_SUPPORTED" diff --git a/zitadel_client/models/oidc_service_get_auth_request_request.py b/zitadel_client/models/oidc_service_get_auth_request_request.py index 01650a9c..9e2f2035 100644 --- a/zitadel_client/models/oidc_service_get_auth_request_request.py +++ b/zitadel_client/models/oidc_service_get_auth_request_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceGetAuthRequestRequest(BaseModel): """ OIDCServiceGetAuthRequestRequest - """ # noqa: E501 - auth_request_id: Optional[StrictStr] = Field(default=None, description="The ID of the Auth Request, as obtained from the redirect URL.", alias="authRequestId") - __properties: ClassVar[List[str]] = ["authRequestId"] + """ + auth_request_id: Optional[StrictStr] = Field( + default=None, + alias="authRequestId", + description="The ID of the Auth Request, as obtained from the redirect URL.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class OIDCServiceGetAuthRequestRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceGetAuthRequestRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceGetAuthRequestRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequestId": obj.get("authRequestId") - }) - return _obj - - +OIDCServiceGetAuthRequestRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_get_auth_request_response.py b/zitadel_client/models/oidc_service_get_auth_request_response.py index 41486486..9c955656 100644 --- a/zitadel_client/models/oidc_service_get_auth_request_response.py +++ b/zitadel_client/models/oidc_service_get_auth_request_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_auth_request import OIDCServiceAuthRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OIDCServiceGetAuthRequestResponse(BaseModel): """ OIDCServiceGetAuthRequestResponse - """ # noqa: E501 - auth_request: Optional[OIDCServiceAuthRequest] = Field(default=None, alias="authRequest") - __properties: ClassVar[List[str]] = ["authRequest"] + """ + auth_request: Optional[OIDCServiceAuthRequest] = Field( + default=None, alias="authRequest" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,6 @@ class OIDCServiceGetAuthRequestResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceGetAuthRequestResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of auth_request - if self.auth_request: - _dict['authRequest'] = self.auth_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceGetAuthRequestResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "authRequest": OIDCServiceAuthRequest.from_dict(obj["authRequest"]) if obj.get("authRequest") is not None else None - }) - return _obj - +from zitadel_client.models.oidc_service_auth_request import OIDCServiceAuthRequest +OIDCServiceGetAuthRequestResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_get_device_authorization_request_request.py b/zitadel_client/models/oidc_service_get_device_authorization_request_request.py index 00eecc3d..fcd0bbf9 100644 --- a/zitadel_client/models/oidc_service_get_device_authorization_request_request.py +++ b/zitadel_client/models/oidc_service_get_device_authorization_request_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceGetDeviceAuthorizationRequestRequest(BaseModel): """ OIDCServiceGetDeviceAuthorizationRequestRequest - """ # noqa: E501 - user_code: Optional[StrictStr] = Field(default=None, description="The user_code returned by the device authorization request and provided to the user by the device.", alias="userCode") - __properties: ClassVar[List[str]] = ["userCode"] + """ + user_code: Optional[StrictStr] = Field( + default=None, + alias="userCode", + description="The user_code returned by the device authorization request and provided to the user by the device.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class OIDCServiceGetDeviceAuthorizationRequestRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceGetDeviceAuthorizationRequestRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceGetDeviceAuthorizationRequestRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userCode": obj.get("userCode") - }) - return _obj - - +OIDCServiceGetDeviceAuthorizationRequestRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_get_device_authorization_request_response.py b/zitadel_client/models/oidc_service_get_device_authorization_request_response.py index f68e2c33..efd92312 100644 --- a/zitadel_client/models/oidc_service_get_device_authorization_request_response.py +++ b/zitadel_client/models/oidc_service_get_device_authorization_request_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.oidc_service_device_authorization_request import OIDCServiceDeviceAuthorizationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OIDCServiceGetDeviceAuthorizationRequestResponse(BaseModel): """ OIDCServiceGetDeviceAuthorizationRequestResponse - """ # noqa: E501 - device_authorization_request: Optional[OIDCServiceDeviceAuthorizationRequest] = Field(default=None, alias="deviceAuthorizationRequest") - __properties: ClassVar[List[str]] = ["deviceAuthorizationRequest"] + """ + device_authorization_request: Optional[OIDCServiceDeviceAuthorizationRequest] = ( + Field(default=None, alias="deviceAuthorizationRequest") + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class OIDCServiceGetDeviceAuthorizationRequestResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceGetDeviceAuthorizationRequestResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of device_authorization_request - if self.device_authorization_request: - _dict['deviceAuthorizationRequest'] = self.device_authorization_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceGetDeviceAuthorizationRequestResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deviceAuthorizationRequest": OIDCServiceDeviceAuthorizationRequest.from_dict(obj["deviceAuthorizationRequest"]) if obj.get("deviceAuthorizationRequest") is not None else None - }) - return _obj - +from zitadel_client.models.oidc_service_device_authorization_request import ( + OIDCServiceDeviceAuthorizationRequest, +) +OIDCServiceGetDeviceAuthorizationRequestResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/oidc_service_prompt.py b/zitadel_client/models/oidc_service_prompt.py index accf1e4c..84309c34 100644 --- a/zitadel_client/models/oidc_service_prompt.py +++ b/zitadel_client/models/oidc_service_prompt.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OIDCServicePrompt(str, Enum): @@ -23,19 +13,9 @@ class OIDCServicePrompt(str, Enum): OIDCServicePrompt """ - """ - allowed enum values - """ - PROMPT_UNSPECIFIED = 'PROMPT_UNSPECIFIED' - PROMPT_NONE = 'PROMPT_NONE' - PROMPT_LOGIN = 'PROMPT_LOGIN' - PROMPT_CONSENT = 'PROMPT_CONSENT' - PROMPT_SELECT_ACCOUNT = 'PROMPT_SELECT_ACCOUNT' - PROMPT_CREATE = 'PROMPT_CREATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OIDCServicePrompt from a JSON string""" - return cls(json.loads(json_str)) - - + PROMPT_UNSPECIFIED = "PROMPT_UNSPECIFIED" + PROMPT_NONE = "PROMPT_NONE" + PROMPT_LOGIN = "PROMPT_LOGIN" + PROMPT_CONSENT = "PROMPT_CONSENT" + PROMPT_SELECT_ACCOUNT = "PROMPT_SELECT_ACCOUNT" + PROMPT_CREATE = "PROMPT_CREATE" diff --git a/zitadel_client/models/oidc_service_session.py b/zitadel_client/models/oidc_service_session.py index 8d0a96cb..0c1777dc 100644 --- a/zitadel_client/models/oidc_service_session.py +++ b/zitadel_client/models/oidc_service_session.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OIDCServiceSession(BaseModel): """ OIDCServiceSession - """ # noqa: E501 - session_id: Optional[StrictStr] = Field(default=None, description="ID of the session, used to login the user. Connects the session to the Auth Request.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="Token of the session used to login the user. This token verifies that the session is valid.", alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + """ + session_id: Optional[StrictStr] = Field( + default=None, + alias="sessionId", + description="ID of the session, used to login the user. Connects the session to the Auth Request.", + ) + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="Token of the session used to login the user. This token verifies that the session is valid.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OIDCServiceSession(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OIDCServiceSession from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OIDCServiceSession from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +OIDCServiceSession.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_activate_organization_request.py b/zitadel_client/models/organization_service_activate_organization_request.py index 0b753602..311d0cde 100644 --- a/zitadel_client/models/organization_service_activate_organization_request.py +++ b/zitadel_client/models/organization_service_activate_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceActivateOrganizationRequest(BaseModel): """ OrganizationServiceActivateOrganizationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization to be activated.", alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization to be activated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class OrganizationServiceActivateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceActivateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceActivateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +OrganizationServiceActivateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_activate_organization_response.py b/zitadel_client/models/organization_service_activate_organization_response.py index b47ae05c..f91e4154 100644 --- a/zitadel_client/models/organization_service_activate_organization_response.py +++ b/zitadel_client/models/organization_service_activate_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceActivateOrganizationResponse(BaseModel): """ OrganizationServiceActivateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceActivateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceActivateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceActivateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceActivateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_add_human_user_request.py b/zitadel_client/models/organization_service_add_human_user_request.py index fe84e96f..8c3260a7 100644 --- a/zitadel_client/models/organization_service_add_human_user_request.py +++ b/zitadel_client/models/organization_service_add_human_user_request.py @@ -1,52 +1,66 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_hashed_password import OrganizationServiceHashedPassword -from zitadel_client.models.organization_service_idp_link import OrganizationServiceIDPLink -from zitadel_client.models.organization_service_organization import OrganizationServiceOrganization -from zitadel_client.models.organization_service_password import OrganizationServicePassword -from zitadel_client.models.organization_service_set_human_email import OrganizationServiceSetHumanEmail -from zitadel_client.models.organization_service_set_human_phone import OrganizationServiceSetHumanPhone -from zitadel_client.models.organization_service_set_human_profile import OrganizationServiceSetHumanProfile -from zitadel_client.models.organization_service_set_metadata_entry import OrganizationServiceSetMetadataEntry -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceAddHumanUserRequest(BaseModel): """ OrganizationServiceAddHumanUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="optionally set your own id unique for the user.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="optionally set a unique username, if none is provided the email will be used.") - organization: Optional[OrganizationServiceOrganization] = None - profile: Optional[OrganizationServiceSetHumanProfile] = None - email: Optional[OrganizationServiceSetHumanEmail] = None - phone: Optional[OrganizationServiceSetHumanPhone] = None - metadata: Optional[List[OrganizationServiceSetMetadataEntry]] = None - idp_links: Optional[List[OrganizationServiceIDPLink]] = Field(default=None, alias="idpLinks") - totp_secret: Optional[StrictStr] = Field(default=None, description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", alias="totpSecret") - hashed_password: Optional[OrganizationServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[OrganizationServicePassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "organization", "profile", "email", "phone", "metadata", "idpLinks", "totpSecret", "hashedPassword", "password"] + """ + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="optionally set your own id unique for the user.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="optionally set a unique username, if none is provided the email will be used.", + ) + organization: Optional[OrganizationServiceOrganization] = Field( + default=None, alias="organization" + ) + profile: Optional[OrganizationServiceSetHumanProfile] = Field( + default=None, alias="profile" + ) + email: Optional[OrganizationServiceSetHumanEmail] = Field( + default=None, alias="email" + ) + phone: Optional[OrganizationServiceSetHumanPhone] = Field( + default=None, alias="phone" + ) + metadata: Optional[List[OrganizationServiceSetMetadataEntry]] = Field( + default=None, alias="metadata" + ) + idp_links: Optional[List[OrganizationServiceIDPLink]] = Field( + default=None, alias="idpLinks" + ) + totp_secret: Optional[StrictStr] = Field( + default=None, + alias="totpSecret", + description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", + ) + hashed_password: Optional[OrganizationServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[OrganizationServicePassword] = Field( + default=None, alias="password" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -54,109 +68,29 @@ class OrganizationServiceAddHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAddHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in idp_links (list) - _items = [] - if self.idp_links: - for _item_idp_links in self.idp_links: - if _item_idp_links: - _items.append(_item_idp_links.to_dict()) - _dict['idpLinks'] = _items - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if user_id (nullable) is None - # and model_fields_set contains the field - if self.user_id is None and "user_id" in self.model_fields_set: - _dict['userId'] = None - - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - # set to None if totp_secret (nullable) is None - # and model_fields_set contains the field - if self.totp_secret is None and "totp_secret" in self.model_fields_set: - _dict['totpSecret'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAddHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "organization": OrganizationServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "profile": OrganizationServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": OrganizationServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": OrganizationServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "metadata": [OrganizationServiceSetMetadataEntry.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None, - "idpLinks": [OrganizationServiceIDPLink.from_dict(_item) for _item in obj["idpLinks"]] if obj.get("idpLinks") is not None else None, - "totpSecret": obj.get("totpSecret"), - "hashedPassword": OrganizationServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": OrganizationServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - - +from zitadel_client.models.organization_service_hashed_password import ( + OrganizationServiceHashedPassword, +) +from zitadel_client.models.organization_service_idp_link import ( + OrganizationServiceIDPLink, +) +from zitadel_client.models.organization_service_organization import ( + OrganizationServiceOrganization, +) +from zitadel_client.models.organization_service_password import ( + OrganizationServicePassword, +) +from zitadel_client.models.organization_service_set_human_email import ( + OrganizationServiceSetHumanEmail, +) +from zitadel_client.models.organization_service_set_human_phone import ( + OrganizationServiceSetHumanPhone, +) +from zitadel_client.models.organization_service_set_human_profile import ( + OrganizationServiceSetHumanProfile, +) +from zitadel_client.models.organization_service_set_metadata_entry import ( + OrganizationServiceSetMetadataEntry, +) + +OrganizationServiceAddHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_add_organization_domain_request.py b/zitadel_client/models/organization_service_add_organization_domain_request.py index 739954e0..fca085ef 100644 --- a/zitadel_client/models/organization_service_add_organization_domain_request.py +++ b/zitadel_client/models/organization_service_add_organization_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceAddOrganizationDomainRequest(BaseModel): """ OrganizationServiceAddOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization to which the domain is to be added.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the full qualified domain name to be added to the organization. Note that the domain has to be unique across the instance. Depending on the settings, you might have to verify the domain before it can be used.") - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization to which the domain is to be added.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the full qualified domain name to be added to the organization. Note that the domain has to be unique across the instance. Depending on the settings, you might have to verify the domain before it can be used.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OrganizationServiceAddOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +OrganizationServiceAddOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_add_organization_domain_response.py b/zitadel_client/models/organization_service_add_organization_domain_response.py index b87ac056..211667c2 100644 --- a/zitadel_client/models/organization_service_add_organization_domain_response.py +++ b/zitadel_client/models/organization_service_add_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceAddOrganizationDomainResponse(BaseModel): """ OrganizationServiceAddOrganizationDomainResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceAddOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceAddOrganizationDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_add_organization_request.py b/zitadel_client/models/organization_service_add_organization_request.py index b5f2e60b..a9ce3793 100644 --- a/zitadel_client/models/organization_service_add_organization_request.py +++ b/zitadel_client/models/organization_service_add_organization_request.py @@ -1,38 +1,60 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_admin import OrganizationServiceAdmin -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictStr +from typing import Any, List, Optional + class OrganizationServiceAddOrganizationRequest(BaseModel): """ OrganizationServiceAddOrganizationRequest - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name is the unique name of the organization to be created. This must be unique across the instance.") - admins: Optional[List[OrganizationServiceAdmin]] = Field(default=None, description="Specify users to be assigned as organization admins. If no users are specified here, the organization will be created without any admin users. The organization can still be managed by any instance administrator. If no roles are specified for a user, they will be assigned the role ORG_OWNER.") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization. This field is optional. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response.", alias="organizationId") - org_id: Optional[StrictStr] = Field(default=None, description="Optionally, set a unique id for the organization. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. Deprecated: use 'organization_id' field instead. If both org_id and organization_id are set, organization_id will take precedence.", alias="orgId") - __properties: ClassVar[List[str]] = ["name", "admins", "organizationId", "orgId"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the unique name of the organization to be created. This must be unique across the instance.", + ) + admins: Optional[List[OrganizationServiceAdmin]] = Field( + default=None, + alias="admins", + description="Specify users to be assigned as organization admins. If no users are specified here, the organization will be created without any admin users. The organization can still be managed by any instance administrator. If no roles are specified for a user, they will be assigned the role ORG_OWNER.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization. This field is optional. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response.", + ) + # .. deprecated:: This property is deprecated. + org_id: Optional[StrictStr] = Field( + default=None, + alias="orgId", + description="Optionally, set a unique id for the organization. If omitted, the system will generate one, which is the recommended way. The generated ID will be returned in the response. Deprecated: use 'organization_id' field instead. If both org_id and organization_id are set, organization_id will take precedence.", + ) + @field_validator("org_id") + def org_id_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `org_id` is set.""" + if value is not None: + warnings.warn( + "field 'org_id' on OrganizationServiceAddOrganizationRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,72 +62,6 @@ class OrganizationServiceAddOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in admins (list) - _items = [] - if self.admins: - for _item_admins in self.admins: - if _item_admins: - _items.append(_item_admins.to_dict()) - _dict['admins'] = _items - # set to None if organization_id (nullable) is None - # and model_fields_set contains the field - if self.organization_id is None and "organization_id" in self.model_fields_set: - _dict['organizationId'] = None - - # set to None if org_id (nullable) is None - # and model_fields_set contains the field - if self.org_id is None and "org_id" in self.model_fields_set: - _dict['orgId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "admins": [OrganizationServiceAdmin.from_dict(_item) for _item in obj["admins"]] if obj.get("admins") is not None else None, - "organizationId": obj.get("organizationId"), - "orgId": obj.get("orgId") - }) - return _obj - +from zitadel_client.models.organization_service_admin import OrganizationServiceAdmin +OrganizationServiceAddOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_add_organization_response.py b/zitadel_client/models/organization_service_add_organization_response.py index 931026c1..839de589 100644 --- a/zitadel_client/models/organization_service_add_organization_response.py +++ b/zitadel_client/models/organization_service_add_organization_response.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_created_admin import OrganizationServiceCreatedAdmin -from zitadel_client.models.organization_service_details import OrganizationServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceAddOrganizationResponse(BaseModel): """ OrganizationServiceAddOrganizationResponse - """ # noqa: E501 - details: Optional[OrganizationServiceDetails] = None + """ + + details: Optional[OrganizationServiceDetails] = Field(default=None, alias="details") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - created_admins: Optional[List[OrganizationServiceCreatedAdmin]] = Field(default=None, alias="createdAdmins") - __properties: ClassVar[List[str]] = ["details", "organizationId", "createdAdmins"] + created_admins: Optional[List[OrganizationServiceCreatedAdmin]] = Field( + default=None, alias="createdAdmins" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,64 +34,11 @@ class OrganizationServiceAddOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in created_admins (list) - _items = [] - if self.created_admins: - for _item_created_admins in self.created_admins: - if _item_created_admins: - _items.append(_item_created_admins.to_dict()) - _dict['createdAdmins'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAddOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": OrganizationServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "organizationId": obj.get("organizationId"), - "createdAdmins": [OrganizationServiceCreatedAdmin.from_dict(_item) for _item in obj["createdAdmins"]] if obj.get("createdAdmins") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_created_admin import ( + OrganizationServiceCreatedAdmin, +) +from zitadel_client.models.organization_service_details import ( + OrganizationServiceDetails, +) +OrganizationServiceAddOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_admin.py b/zitadel_client/models/organization_service_admin.py index 92f39e22..51e05a06 100644 --- a/zitadel_client/models/organization_service_admin.py +++ b/zitadel_client/models/organization_service_admin.py @@ -1,37 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_add_human_user_request import OrganizationServiceAddHumanUserRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceAdmin(BaseModel): """ OrganizationServiceAdmin - """ # noqa: E501 - roles: Optional[List[StrictStr]] = Field(default=None, description="specify Org Member Roles for the provided user (default is ORG_OWNER if roles are empty)") - human: Optional[OrganizationServiceAddHumanUserRequest] = None + """ + + roles: Optional[List[StrictStr]] = Field( + default=None, + alias="roles", + description="specify Org Member Roles for the provided user (default is ORG_OWNER if roles are empty)", + ) + human: Optional[OrganizationServiceAddHumanUserRequest] = Field( + default=None, alias="human" + ) user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["roles", "human", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +38,8 @@ class OrganizationServiceAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "roles": obj.get("roles"), - "human": OrganizationServiceAddHumanUserRequest.from_dict(obj["human"]) if obj.get("human") is not None else None, - "userId": obj.get("userId") - }) - return _obj - +from zitadel_client.models.organization_service_add_human_user_request import ( + OrganizationServiceAddHumanUserRequest, +) +OrganizationServiceAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_any.py b/zitadel_client/models/organization_service_any.py index e802940d..b610ad4b 100644 --- a/zitadel_client/models/organization_service_any.py +++ b/zitadel_client/models/organization_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class OrganizationServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +OrganizationServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_connect_error.py b/zitadel_client/models/organization_service_connect_error.py index 4b441b85..097809a1 100644 --- a/zitadel_client/models/organization_service_connect_error.py +++ b/zitadel_client/models/organization_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_any import OrganizationServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class OrganizationServiceConnectErrorCodeEnum(str, Enum): + """OrganizationServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class OrganizationServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[OrganizationServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[OrganizationServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[OrganizationServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [OrganizationServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.organization_service_any import OrganizationServiceAny +OrganizationServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_created_admin.py b/zitadel_client/models/organization_service_created_admin.py index eeeb7a21..0bec9d46 100644 --- a/zitadel_client/models/organization_service_created_admin.py +++ b/zitadel_client/models/organization_service_created_admin.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceCreatedAdmin(BaseModel): """ OrganizationServiceCreatedAdmin - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["userId", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,64 +32,4 @@ class OrganizationServiceCreatedAdmin(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceCreatedAdmin from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceCreatedAdmin from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - - +OrganizationServiceCreatedAdmin.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_deactivate_organization_request.py b/zitadel_client/models/organization_service_deactivate_organization_request.py index c460d5ea..16fa602d 100644 --- a/zitadel_client/models/organization_service_deactivate_organization_request.py +++ b/zitadel_client/models/organization_service_deactivate_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceDeactivateOrganizationRequest(BaseModel): """ OrganizationServiceDeactivateOrganizationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization to be deactivated.", alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization to be deactivated.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class OrganizationServiceDeactivateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeactivateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeactivateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +OrganizationServiceDeactivateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_deactivate_organization_response.py b/zitadel_client/models/organization_service_deactivate_organization_response.py index a04b973f..a38c40ab 100644 --- a/zitadel_client/models/organization_service_deactivate_organization_response.py +++ b/zitadel_client/models/organization_service_deactivate_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceDeactivateOrganizationResponse(BaseModel): """ OrganizationServiceDeactivateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceDeactivateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeactivateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeactivateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceDeactivateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_domain_request.py b/zitadel_client/models/organization_service_delete_organization_domain_request.py index 09cca0d9..130da277 100644 --- a/zitadel_client/models/organization_service_delete_organization_domain_request.py +++ b/zitadel_client/models/organization_service_delete_organization_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceDeleteOrganizationDomainRequest(BaseModel): """ OrganizationServiceDeleteOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization from which the domain is to be deleted.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the full qualified domain name to be deleted from the organization. Note that if the domain is used as suffix for user logins, those users will not be able to log in anymore. They have to use another domain instead. Also if the domain was used for domain discovery, users will not be able to find the organization by the domain anymore.") - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization from which the domain is to be deleted.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the full qualified domain name to be deleted from the organization. Note that if the domain is used as suffix for user logins, those users will not be able to log in anymore. They have to use another domain instead. Also if the domain was used for domain discovery, users will not be able to find the organization by the domain anymore.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OrganizationServiceDeleteOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +OrganizationServiceDeleteOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_domain_response.py b/zitadel_client/models/organization_service_delete_organization_domain_response.py index 1490744b..8c81fbb4 100644 --- a/zitadel_client/models/organization_service_delete_organization_domain_response.py +++ b/zitadel_client/models/organization_service_delete_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceDeleteOrganizationDomainResponse(BaseModel): """ OrganizationServiceDeleteOrganizationDomainResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceDeleteOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceDeleteOrganizationDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_metadata_request.py b/zitadel_client/models/organization_service_delete_organization_metadata_request.py index 60f7613a..4ffd2be1 100644 --- a/zitadel_client/models/organization_service_delete_organization_metadata_request.py +++ b/zitadel_client/models/organization_service_delete_organization_metadata_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceDeleteOrganizationMetadataRequest(BaseModel): """ OrganizationServiceDeleteOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID is the unique identifier of the organization whose metadata is to be deleted.", alias="organizationId") - keys: Optional[List[StrictStr]] = Field(default=None, description="Keys are the organization metadata entries to be deleted by their key.") - __properties: ClassVar[List[str]] = ["organizationId", "keys"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID is the unique identifier of the organization whose metadata is to be deleted.", + ) + keys: Optional[List[StrictStr]] = Field( + default=None, + alias="keys", + description="Keys are the organization metadata entries to be deleted by their key.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OrganizationServiceDeleteOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "keys": obj.get("keys") - }) - return _obj - - +OrganizationServiceDeleteOrganizationMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_metadata_response.py b/zitadel_client/models/organization_service_delete_organization_metadata_response.py index a5ac77c8..60a1cc3a 100644 --- a/zitadel_client/models/organization_service_delete_organization_metadata_response.py +++ b/zitadel_client/models/organization_service_delete_organization_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceDeleteOrganizationMetadataResponse(BaseModel): """ OrganizationServiceDeleteOrganizationMetadataResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceDeleteOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceDeleteOrganizationMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_request.py b/zitadel_client/models/organization_service_delete_organization_request.py index ea5b22dc..ddbf5da4 100644 --- a/zitadel_client/models/organization_service_delete_organization_request.py +++ b/zitadel_client/models/organization_service_delete_organization_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceDeleteOrganizationRequest(BaseModel): """ OrganizationServiceDeleteOrganizationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization to be deleted.", alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization to be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class OrganizationServiceDeleteOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +OrganizationServiceDeleteOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_delete_organization_response.py b/zitadel_client/models/organization_service_delete_organization_response.py index c4c891c7..eb7c207d 100644 --- a/zitadel_client/models/organization_service_delete_organization_response.py +++ b/zitadel_client/models/organization_service_delete_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceDeleteOrganizationResponse(BaseModel): """ OrganizationServiceDeleteOrganizationResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceDeleteOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDeleteOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceDeleteOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_details.py b/zitadel_client/models/organization_service_details.py index f085fdae..7b79ff74 100644 --- a/zitadel_client/models/organization_service_details.py +++ b/zitadel_client/models/organization_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceDetails(BaseModel): """ OrganizationServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class OrganizationServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_domain.py b/zitadel_client/models/organization_service_domain.py index 574d3eaa..824bb7c6 100644 --- a/zitadel_client/models/organization_service_domain.py +++ b/zitadel_client/models/organization_service_domain.py @@ -1,39 +1,50 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_domain_validation_type import OrganizationServiceDomainValidationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class OrganizationServiceDomain(BaseModel): """ OrganizationServiceDomain - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization the domain belongs to.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the fully qualified domain name.") - is_verified: Optional[StrictBool] = Field(default=None, description="IsVerified is a boolean flag indicating if the domain has been verified.", alias="isVerified") - is_primary: Optional[StrictBool] = Field(default=None, description="IsPrimary is a boolean flag indicating if the domain is the primary domain of the organization.", alias="isPrimary") - validation_type: Optional[OrganizationServiceDomainValidationType] = Field(default=None, alias="validationType") - __properties: ClassVar[List[str]] = ["organizationId", "domain", "isVerified", "isPrimary", "validationType"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization the domain belongs to.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the fully qualified domain name.", + ) + is_verified: Optional[StrictBool] = Field( + default=None, + alias="isVerified", + description="IsVerified is a boolean flag indicating if the domain has been verified.", + ) + is_primary: Optional[StrictBool] = Field( + default=None, + alias="isPrimary", + description="IsPrimary is a boolean flag indicating if the domain is the primary domain of the organization.", + ) + validation_type: Optional[OrganizationServiceDomainValidationType] = Field( + default=None, alias="validationType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +52,8 @@ class OrganizationServiceDomain(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDomain from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDomain from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain"), - "isVerified": obj.get("isVerified"), - "isPrimary": obj.get("isPrimary"), - "validationType": obj.get("validationType") - }) - return _obj - +from zitadel_client.models.organization_service_domain_validation_type import ( + OrganizationServiceDomainValidationType, +) +OrganizationServiceDomain.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_domain_field_name.py b/zitadel_client/models/organization_service_domain_field_name.py index 22a3635a..026510cd 100644 --- a/zitadel_client/models/organization_service_domain_field_name.py +++ b/zitadel_client/models/organization_service_domain_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceDomainFieldName(str, Enum): @@ -23,16 +13,6 @@ class OrganizationServiceDomainFieldName(str, Enum): OrganizationServiceDomainFieldName """ - """ - allowed enum values - """ - DOMAIN_FIELD_NAME_UNSPECIFIED = 'DOMAIN_FIELD_NAME_UNSPECIFIED' - DOMAIN_FIELD_NAME_NAME = 'DOMAIN_FIELD_NAME_NAME' - DOMAIN_FIELD_NAME_CREATION_DATE = 'DOMAIN_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceDomainFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + DOMAIN_FIELD_NAME_UNSPECIFIED = "DOMAIN_FIELD_NAME_UNSPECIFIED" + DOMAIN_FIELD_NAME_NAME = "DOMAIN_FIELD_NAME_NAME" + DOMAIN_FIELD_NAME_CREATION_DATE = "DOMAIN_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/organization_service_domain_search_filter.py b/zitadel_client/models/organization_service_domain_search_filter.py index 80d1f598..2813c1ba 100644 --- a/zitadel_client/models/organization_service_domain_search_filter.py +++ b/zitadel_client/models/organization_service_domain_search_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_organization_domain_query import OrganizationServiceOrganizationDomainQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceDomainSearchFilter(BaseModel): """ OrganizationServiceDomainSearchFilter - """ # noqa: E501 - domain_filter: Optional[OrganizationServiceOrganizationDomainQuery] = Field(default=None, alias="domainFilter") - __properties: ClassVar[List[str]] = ["domainFilter"] + """ + domain_filter: Optional[OrganizationServiceOrganizationDomainQuery] = Field( + default=None, alias="domainFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class OrganizationServiceDomainSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceDomainSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_filter - if self.domain_filter: - _dict['domainFilter'] = self.domain_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceDomainSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domainFilter": OrganizationServiceOrganizationDomainQuery.from_dict(obj["domainFilter"]) if obj.get("domainFilter") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_organization_domain_query import ( + OrganizationServiceOrganizationDomainQuery, +) +OrganizationServiceDomainSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_domain_validation_type.py b/zitadel_client/models/organization_service_domain_validation_type.py index 80ea860c..2519f44f 100644 --- a/zitadel_client/models/organization_service_domain_validation_type.py +++ b/zitadel_client/models/organization_service_domain_validation_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceDomainValidationType(str, Enum): @@ -23,16 +13,6 @@ class OrganizationServiceDomainValidationType(str, Enum): OrganizationServiceDomainValidationType """ - """ - allowed enum values - """ - DOMAIN_VALIDATION_TYPE_UNSPECIFIED = 'DOMAIN_VALIDATION_TYPE_UNSPECIFIED' - DOMAIN_VALIDATION_TYPE_HTTP = 'DOMAIN_VALIDATION_TYPE_HTTP' - DOMAIN_VALIDATION_TYPE_DNS = 'DOMAIN_VALIDATION_TYPE_DNS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceDomainValidationType from a JSON string""" - return cls(json.loads(json_str)) - - + DOMAIN_VALIDATION_TYPE_UNSPECIFIED = "DOMAIN_VALIDATION_TYPE_UNSPECIFIED" + DOMAIN_VALIDATION_TYPE_HTTP = "DOMAIN_VALIDATION_TYPE_HTTP" + DOMAIN_VALIDATION_TYPE_DNS = "DOMAIN_VALIDATION_TYPE_DNS" diff --git a/zitadel_client/models/organization_service_gender.py b/zitadel_client/models/organization_service_gender.py index f434374e..ebb760bb 100644 --- a/zitadel_client/models/organization_service_gender.py +++ b/zitadel_client/models/organization_service_gender.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceGender(str, Enum): @@ -23,17 +13,7 @@ class OrganizationServiceGender(str, Enum): OrganizationServiceGender """ - """ - allowed enum values - """ - GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' - GENDER_FEMALE = 'GENDER_FEMALE' - GENDER_MALE = 'GENDER_MALE' - GENDER_DIVERSE = 'GENDER_DIVERSE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceGender from a JSON string""" - return cls(json.loads(json_str)) - - + GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED" + GENDER_FEMALE = "GENDER_FEMALE" + GENDER_MALE = "GENDER_MALE" + GENDER_DIVERSE = "GENDER_DIVERSE" diff --git a/zitadel_client/models/organization_service_generate_organization_domain_validation_request.py b/zitadel_client/models/organization_service_generate_organization_domain_validation_request.py index b8b6f3bd..285f533a 100644 --- a/zitadel_client/models/organization_service_generate_organization_domain_validation_request.py +++ b/zitadel_client/models/organization_service_generate_organization_domain_validation_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_domain_validation_type import OrganizationServiceDomainValidationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceGenerateOrganizationDomainValidationRequest(BaseModel): """ OrganizationServiceGenerateOrganizationDomainValidationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization for which the domain validation is to be generated.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the full qualified domain name for which the validation is to be generated.") - type: Optional[OrganizationServiceDomainValidationType] = None - __properties: ClassVar[List[str]] = ["organizationId", "domain", "type"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization for which the domain validation is to be generated.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the full qualified domain name for which the validation is to be generated.", + ) + type: Optional[OrganizationServiceDomainValidationType] = Field( + default=None, alias="type" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,10 @@ class OrganizationServiceGenerateOrganizationDomainValidationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceGenerateOrganizationDomainValidationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceGenerateOrganizationDomainValidationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain"), - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.organization_service_domain_validation_type import ( + OrganizationServiceDomainValidationType, +) +OrganizationServiceGenerateOrganizationDomainValidationRequest.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/organization_service_generate_organization_domain_validation_response.py b/zitadel_client/models/organization_service_generate_organization_domain_validation_response.py index 059c0c77..365c1c90 100644 --- a/zitadel_client/models/organization_service_generate_organization_domain_validation_response.py +++ b/zitadel_client/models/organization_service_generate_organization_domain_validation_response.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceGenerateOrganizationDomainValidationResponse(BaseModel): """ OrganizationServiceGenerateOrganizationDomainValidationResponse - """ # noqa: E501 - token: Optional[StrictStr] = Field(default=None, description="Token is a verification token that needs to be added to the DNS records or as a file to the webserver. Zitadel will check for this token to verify the domain.") - url: Optional[StrictStr] = Field(default=None, description="URL is the location where the token needs to be placed for HTTP challenge.") - __properties: ClassVar[List[str]] = ["token", "url"] + """ + token: Optional[StrictStr] = Field( + default=None, + alias="token", + description="Token is a verification token that needs to be added to the DNS records or as a file to the webserver. Zitadel will check for this token to verify the domain.", + ) + url: Optional[StrictStr] = Field( + default=None, + alias="url", + description="URL is the location where the token needs to be placed for HTTP challenge.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,6 @@ class OrganizationServiceGenerateOrganizationDomainValidationResponse(BaseModel) ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceGenerateOrganizationDomainValidationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceGenerateOrganizationDomainValidationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "token": obj.get("token"), - "url": obj.get("url") - }) - return _obj - - +OrganizationServiceGenerateOrganizationDomainValidationResponse.model_rebuild( + raise_errors=False +) diff --git a/zitadel_client/models/organization_service_hashed_password.py b/zitadel_client/models/organization_service_hashed_password.py index 5e56b846..b053d7cf 100644 --- a/zitadel_client/models/organization_service_hashed_password.py +++ b/zitadel_client/models/organization_service_hashed_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class OrganizationServiceHashedPassword(BaseModel): """ OrganizationServiceHashedPassword - """ # noqa: E501 - hash: Optional[StrictStr] = None + """ + + hash: Optional[StrictStr] = Field(default=None, alias="hash") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["hash", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class OrganizationServiceHashedPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceHashedPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceHashedPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +OrganizationServiceHashedPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_idp_link.py b/zitadel_client/models/organization_service_idp_link.py index 4a1eb1ba..3ac29a43 100644 --- a/zitadel_client/models/organization_service_idp_link.py +++ b/zitadel_client/models/organization_service_idp_link.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceIDPLink(BaseModel): """ OrganizationServiceIDPLink - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class OrganizationServiceIDPLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceIDPLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceIDPLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName") - }) - return _obj - - +OrganizationServiceIDPLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_details.py b/zitadel_client/models/organization_service_list_details.py index 2ec531d8..87c74709 100644 --- a/zitadel_client/models/organization_service_list_details.py +++ b/zitadel_client/models/organization_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceListDetails(BaseModel): """ OrganizationServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class OrganizationServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organization_domains_request.py b/zitadel_client/models/organization_service_list_organization_domains_request.py index ac820910..410ccb59 100644 --- a/zitadel_client/models/organization_service_list_organization_domains_request.py +++ b/zitadel_client/models/organization_service_list_organization_domains_request.py @@ -1,40 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_domain_field_name import OrganizationServiceDomainFieldName -from zitadel_client.models.organization_service_domain_search_filter import OrganizationServiceDomainSearchFilter -from zitadel_client.models.organization_service_pagination_request import OrganizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceListOrganizationDomainsRequest(BaseModel): """ OrganizationServiceListOrganizationDomainsRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization from which the domains are to be listed.", alias="organizationId") - pagination: Optional[OrganizationServicePaginationRequest] = None - filters: Optional[List[OrganizationServiceDomainSearchFilter]] = Field(default=None, description="Filters define the criteria to query for.") - sorting_column: Optional[OrganizationServiceDomainFieldName] = Field(default=None, alias="sortingColumn") - __properties: ClassVar[List[str]] = ["organizationId", "pagination", "filters", "sortingColumn"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization from which the domains are to be listed.", + ) + pagination: Optional[OrganizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filters: Optional[List[OrganizationServiceDomainSearchFilter]] = Field( + default=None, + alias="filters", + description="Filters define the criteria to query for.", + ) + sorting_column: Optional[OrganizationServiceDomainFieldName] = Field( + default=None, alias="sortingColumn" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +45,14 @@ class OrganizationServiceListOrganizationDomainsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationDomainsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationDomainsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "pagination": OrganizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filters": [OrganizationServiceDomainSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, - "sortingColumn": obj.get("sortingColumn") - }) - return _obj - +from zitadel_client.models.organization_service_domain_field_name import ( + OrganizationServiceDomainFieldName, +) +from zitadel_client.models.organization_service_domain_search_filter import ( + OrganizationServiceDomainSearchFilter, +) +from zitadel_client.models.organization_service_pagination_request import ( + OrganizationServicePaginationRequest, +) +OrganizationServiceListOrganizationDomainsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organization_domains_response.py b/zitadel_client/models/organization_service_list_organization_domains_response.py index 7ea39958..2a9bd32c 100644 --- a/zitadel_client/models/organization_service_list_organization_domains_response.py +++ b/zitadel_client/models/organization_service_list_organization_domains_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_domain import OrganizationServiceDomain -from zitadel_client.models.organization_service_pagination_response import OrganizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class OrganizationServiceListOrganizationDomainsResponse(BaseModel): """ OrganizationServiceListOrganizationDomainsResponse - """ # noqa: E501 - pagination: Optional[OrganizationServicePaginationResponse] = None - domains: Optional[List[OrganizationServiceDomain]] = Field(default=None, description="Domains is a list of fully qualified domain names registered to the organization matching the query.") - __properties: ClassVar[List[str]] = ["pagination", "domains"] + """ + + pagination: Optional[OrganizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + domains: Optional[List[OrganizationServiceDomain]] = Field( + default=None, + alias="domains", + description="Domains is a list of fully qualified domain names registered to the organization matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class OrganizationServiceListOrganizationDomainsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationDomainsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in domains (list) - _items = [] - if self.domains: - for _item_domains in self.domains: - if _item_domains: - _items.append(_item_domains.to_dict()) - _dict['domains'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationDomainsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": OrganizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "domains": [OrganizationServiceDomain.from_dict(_item) for _item in obj["domains"]] if obj.get("domains") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_domain import OrganizationServiceDomain +from zitadel_client.models.organization_service_pagination_response import ( + OrganizationServicePaginationResponse, +) +OrganizationServiceListOrganizationDomainsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organization_metadata_request.py b/zitadel_client/models/organization_service_list_organization_metadata_request.py index fcb5b517..eb146e63 100644 --- a/zitadel_client/models/organization_service_list_organization_metadata_request.py +++ b/zitadel_client/models/organization_service_list_organization_metadata_request.py @@ -1,38 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_metadata_search_filter import OrganizationServiceMetadataSearchFilter -from zitadel_client.models.organization_service_pagination_request import OrganizationServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceListOrganizationMetadataRequest(BaseModel): """ OrganizationServiceListOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID is the unique identifier of the organization whose metadata is to be listed.", alias="organizationId") - pagination: Optional[OrganizationServicePaginationRequest] = None - filters: Optional[List[OrganizationServiceMetadataSearchFilter]] = Field(default=None, description="Filters define the criteria to query the metadata for.") - __properties: ClassVar[List[str]] = ["organizationId", "pagination", "filters"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID is the unique identifier of the organization whose metadata is to be listed.", + ) + pagination: Optional[OrganizationServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filters: Optional[List[OrganizationServiceMetadataSearchFilter]] = Field( + default=None, + alias="filters", + description="Filters define the criteria to query the metadata for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,64 +42,11 @@ class OrganizationServiceListOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "pagination": OrganizationServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filters": [OrganizationServiceMetadataSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_metadata_search_filter import ( + OrganizationServiceMetadataSearchFilter, +) +from zitadel_client.models.organization_service_pagination_request import ( + OrganizationServicePaginationRequest, +) +OrganizationServiceListOrganizationMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organization_metadata_response.py b/zitadel_client/models/organization_service_list_organization_metadata_response.py index f7afd51f..0109db7c 100644 --- a/zitadel_client/models/organization_service_list_organization_metadata_response.py +++ b/zitadel_client/models/organization_service_list_organization_metadata_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_metadata import OrganizationServiceMetadata -from zitadel_client.models.organization_service_pagination_response import OrganizationServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class OrganizationServiceListOrganizationMetadataResponse(BaseModel): """ OrganizationServiceListOrganizationMetadataResponse - """ # noqa: E501 - pagination: Optional[OrganizationServicePaginationResponse] = None - metadata: Optional[List[OrganizationServiceMetadata]] = Field(default=None, description="Metadata is a list of organization metadata that matched the query.") - __properties: ClassVar[List[str]] = ["pagination", "metadata"] + """ + + pagination: Optional[OrganizationServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + metadata: Optional[List[OrganizationServiceMetadata]] = Field( + default=None, + alias="metadata", + description="Metadata is a list of organization metadata that matched the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class OrganizationServiceListOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": OrganizationServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "metadata": [OrganizationServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_metadata import ( + OrganizationServiceMetadata, +) +from zitadel_client.models.organization_service_pagination_response import ( + OrganizationServicePaginationResponse, +) +OrganizationServiceListOrganizationMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organizations_request.py b/zitadel_client/models/organization_service_list_organizations_request.py index 58d2ca54..e955cb4f 100644 --- a/zitadel_client/models/organization_service_list_organizations_request.py +++ b/zitadel_client/models/organization_service_list_organizations_request.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_list_query import OrganizationServiceListQuery -from zitadel_client.models.organization_service_organization_field_name import OrganizationServiceOrganizationFieldName -from zitadel_client.models.organization_service_search_query import OrganizationServiceSearchQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class OrganizationServiceListOrganizationsRequest(BaseModel): """ OrganizationServiceListOrganizationsRequest - """ # noqa: E501 - query: Optional[OrganizationServiceListQuery] = None - sorting_column: Optional[OrganizationServiceOrganizationFieldName] = Field(default=None, alias="sortingColumn") - queries: Optional[List[OrganizationServiceSearchQuery]] = Field(default=None, description="criteria the client is looking for") - __properties: ClassVar[List[str]] = ["query", "sortingColumn", "queries"] + """ + + query: Optional[OrganizationServiceListQuery] = Field(default=None, alias="query") + sorting_column: Optional[OrganizationServiceOrganizationFieldName] = Field( + default=None, alias="sortingColumn" + ) + queries: Optional[List[OrganizationServiceSearchQuery]] = Field( + default=None, alias="queries", description="criteria the client is looking for" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +35,14 @@ class OrganizationServiceListOrganizationsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": OrganizationServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "queries": [OrganizationServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_list_query import ( + OrganizationServiceListQuery, +) +from zitadel_client.models.organization_service_organization_field_name import ( + OrganizationServiceOrganizationFieldName, +) +from zitadel_client.models.organization_service_search_query import ( + OrganizationServiceSearchQuery, +) +OrganizationServiceListOrganizationsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_organizations_response.py b/zitadel_client/models/organization_service_list_organizations_response.py index a044b2a2..c91fab47 100644 --- a/zitadel_client/models/organization_service_list_organizations_response.py +++ b/zitadel_client/models/organization_service_list_organizations_response.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_list_details import OrganizationServiceListDetails -from zitadel_client.models.organization_service_organization import OrganizationServiceOrganization -from zitadel_client.models.organization_service_organization_field_name import OrganizationServiceOrganizationFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class OrganizationServiceListOrganizationsResponse(BaseModel): """ OrganizationServiceListOrganizationsResponse - """ # noqa: E501 - details: Optional[OrganizationServiceListDetails] = None - sorting_column: Optional[OrganizationServiceOrganizationFieldName] = Field(default=None, alias="sortingColumn") - result: Optional[List[OrganizationServiceOrganization]] = Field(default=None, description="The Result is a list of organizations matching the query.") - __properties: ClassVar[List[str]] = ["details", "sortingColumn", "result"] + """ + + details: Optional[OrganizationServiceListDetails] = Field( + default=None, alias="details" + ) + sorting_column: Optional[OrganizationServiceOrganizationFieldName] = Field( + default=None, alias="sortingColumn" + ) + result: Optional[List[OrganizationServiceOrganization]] = Field( + default=None, + alias="result", + description="The Result is a list of organizations matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class OrganizationServiceListOrganizationsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListOrganizationsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": OrganizationServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "result": [OrganizationServiceOrganization.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_list_details import ( + OrganizationServiceListDetails, +) +from zitadel_client.models.organization_service_organization import ( + OrganizationServiceOrganization, +) +from zitadel_client.models.organization_service_organization_field_name import ( + OrganizationServiceOrganizationFieldName, +) +OrganizationServiceListOrganizationsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_list_query.py b/zitadel_client/models/organization_service_list_query.py index d65721ef..cad6b295 100644 --- a/zitadel_client/models/organization_service_list_query.py +++ b/zitadel_client/models/organization_service_list_query.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class OrganizationServiceListQuery(BaseModel): """ OrganizationServiceListQuery - """ # noqa: E501 - offset: Optional[Any] = None - limit: Optional[StrictInt] = None - asc: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field(default=None, alias="offset") + limit: Optional[StrictInt] = Field(default=None, alias="limit") + asc: Optional[StrictBool] = Field(default=None, alias="asc") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +32,4 @@ class OrganizationServiceListQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceListQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceListQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +OrganizationServiceListQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_metadata.py b/zitadel_client/models/organization_service_metadata.py index d78e7fc2..41e4e284 100644 --- a/zitadel_client/models/organization_service_metadata.py +++ b/zitadel_client/models/organization_service_metadata.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceMetadata(BaseModel): """ OrganizationServiceMetadata - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Key is identifier of the metadata entry.") - value: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Value is the values of the metadata entry.") - __properties: ClassVar[List[str]] = ["key", "value"] + """ + + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="Key is identifier of the metadata entry.", + ) + value: Optional[Base64Bytes] = Field( + default=None, + alias="value", + description="Value is the values of the metadata entry.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,6 @@ class OrganizationServiceMetadata(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadata from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +OrganizationServiceMetadata.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_metadata_key_filter.py b/zitadel_client/models/organization_service_metadata_key_filter.py index c1b93251..55f46eda 100644 --- a/zitadel_client/models/organization_service_metadata_key_filter.py +++ b/zitadel_client/models/organization_service_metadata_key_filter.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_text_filter_method import OrganizationServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceMetadataKeyFilter(BaseModel): """ OrganizationServiceMetadataKeyFilter - """ # noqa: E501 - key: Optional[StrictStr] = None - method: Optional[OrganizationServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + method: Optional[OrganizationServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +33,8 @@ class OrganizationServiceMetadataKeyFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadataKeyFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadataKeyFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.organization_service_text_filter_method import ( + OrganizationServiceTextFilterMethod, +) +OrganizationServiceMetadataKeyFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_metadata_search_filter.py b/zitadel_client/models/organization_service_metadata_search_filter.py index 0d0c7d43..5a19a772 100644 --- a/zitadel_client/models/organization_service_metadata_search_filter.py +++ b/zitadel_client/models/organization_service_metadata_search_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_metadata_key_filter import OrganizationServiceMetadataKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceMetadataSearchFilter(BaseModel): """ OrganizationServiceMetadataSearchFilter - """ # noqa: E501 - key_filter: Optional[OrganizationServiceMetadataKeyFilter] = Field(default=None, alias="keyFilter") - __properties: ClassVar[List[str]] = ["keyFilter"] + """ + key_filter: Optional[OrganizationServiceMetadataKeyFilter] = Field( + default=None, alias="keyFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class OrganizationServiceMetadataSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadataSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of key_filter - if self.key_filter: - _dict['keyFilter'] = self.key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceMetadataSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyFilter": OrganizationServiceMetadataKeyFilter.from_dict(obj["keyFilter"]) if obj.get("keyFilter") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_metadata_key_filter import ( + OrganizationServiceMetadataKeyFilter, +) +OrganizationServiceMetadataSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_organization.py b/zitadel_client/models/organization_service_organization.py index 89e4c92d..dfc7ad93 100644 --- a/zitadel_client/models/organization_service_organization.py +++ b/zitadel_client/models/organization_service_organization.py @@ -1,40 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_details import OrganizationServiceDetails -from zitadel_client.models.organization_service_organization_state import OrganizationServiceOrganizationState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceOrganization(BaseModel): """ OrganizationServiceOrganization - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID is the unique identifier of the organization.") - details: Optional[OrganizationServiceDetails] = None - state: Optional[OrganizationServiceOrganizationState] = None - name: Optional[StrictStr] = Field(default=None, description="Name of the organization.") - primary_domain: Optional[StrictStr] = Field(default=None, description="Primary domain used in the organization.", alias="primaryDomain") - __properties: ClassVar[List[str]] = ["id", "details", "state", "name", "primaryDomain"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID is the unique identifier of the organization.", + ) + details: Optional[OrganizationServiceDetails] = Field(default=None, alias="details") + state: Optional[OrganizationServiceOrganizationState] = Field( + default=None, alias="state" + ) + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name of the organization." + ) + primary_domain: Optional[StrictStr] = Field( + default=None, + alias="primaryDomain", + description="Primary domain used in the organization.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,59 +46,11 @@ class OrganizationServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "details": OrganizationServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "state": obj.get("state"), - "name": obj.get("name"), - "primaryDomain": obj.get("primaryDomain") - }) - return _obj - +from zitadel_client.models.organization_service_details import ( + OrganizationServiceDetails, +) +from zitadel_client.models.organization_service_organization_state import ( + OrganizationServiceOrganizationState, +) +OrganizationServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_organization_domain_query.py b/zitadel_client/models/organization_service_organization_domain_query.py index 3be23cfb..20493598 100644 --- a/zitadel_client/models/organization_service_organization_domain_query.py +++ b/zitadel_client/models/organization_service_organization_domain_query.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_text_query_method import OrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceOrganizationDomainQuery(BaseModel): """ OrganizationServiceOrganizationDomainQuery - """ # noqa: E501 - domain: Optional[StrictStr] = Field(default=None, description="Domain used in organization, not necessary primary domain.") - method: Optional[OrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["domain", "method"] + """ + + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain used in organization, not necessary primary domain.", + ) + method: Optional[OrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class OrganizationServiceOrganizationDomainQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationDomainQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationDomainQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.organization_service_text_query_method import ( + OrganizationServiceTextQueryMethod, +) +OrganizationServiceOrganizationDomainQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_organization_field_name.py b/zitadel_client/models/organization_service_organization_field_name.py index e4d24fa3..b7d44091 100644 --- a/zitadel_client/models/organization_service_organization_field_name.py +++ b/zitadel_client/models/organization_service_organization_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceOrganizationFieldName(str, Enum): @@ -23,16 +13,6 @@ class OrganizationServiceOrganizationFieldName(str, Enum): OrganizationServiceOrganizationFieldName """ - """ - allowed enum values - """ - ORGANIZATION_FIELD_NAME_UNSPECIFIED = 'ORGANIZATION_FIELD_NAME_UNSPECIFIED' - ORGANIZATION_FIELD_NAME_NAME = 'ORGANIZATION_FIELD_NAME_NAME' - ORGANIZATION_FIELD_NAME_CREATION_DATE = 'ORGANIZATION_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceOrganizationFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + ORGANIZATION_FIELD_NAME_UNSPECIFIED = "ORGANIZATION_FIELD_NAME_UNSPECIFIED" + ORGANIZATION_FIELD_NAME_NAME = "ORGANIZATION_FIELD_NAME_NAME" + ORGANIZATION_FIELD_NAME_CREATION_DATE = "ORGANIZATION_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/organization_service_organization_id_query.py b/zitadel_client/models/organization_service_organization_id_query.py index 61b1c8b2..e64b6aeb 100644 --- a/zitadel_client/models/organization_service_organization_id_query.py +++ b/zitadel_client/models/organization_service_organization_id_query.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceOrganizationIDQuery(BaseModel): """ OrganizationServiceOrganizationIDQuery - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the organization.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="Unique identifier of the organization." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class OrganizationServiceOrganizationIDQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationIDQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationIDQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +OrganizationServiceOrganizationIDQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_organization_name_query.py b/zitadel_client/models/organization_service_organization_name_query.py index d6b88c53..f6ae7d9f 100644 --- a/zitadel_client/models/organization_service_organization_name_query.py +++ b/zitadel_client/models/organization_service_organization_name_query.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_text_query_method import OrganizationServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceOrganizationNameQuery(BaseModel): """ OrganizationServiceOrganizationNameQuery - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="Name of the organization.") - method: Optional[OrganizationServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["name", "method"] + """ + + name: Optional[StrictStr] = Field( + default=None, alias="name", description="Name of the organization." + ) + method: Optional[OrganizationServiceTextQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,8 @@ class OrganizationServiceOrganizationNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.organization_service_text_query_method import ( + OrganizationServiceTextQueryMethod, +) +OrganizationServiceOrganizationNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_organization_state.py b/zitadel_client/models/organization_service_organization_state.py index e9ec7b22..bb3a14b1 100644 --- a/zitadel_client/models/organization_service_organization_state.py +++ b/zitadel_client/models/organization_service_organization_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceOrganizationState(str, Enum): @@ -23,17 +13,7 @@ class OrganizationServiceOrganizationState(str, Enum): OrganizationServiceOrganizationState """ - """ - allowed enum values - """ - ORGANIZATION_STATE_UNSPECIFIED = 'ORGANIZATION_STATE_UNSPECIFIED' - ORGANIZATION_STATE_ACTIVE = 'ORGANIZATION_STATE_ACTIVE' - ORGANIZATION_STATE_INACTIVE = 'ORGANIZATION_STATE_INACTIVE' - ORGANIZATION_STATE_REMOVED = 'ORGANIZATION_STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceOrganizationState from a JSON string""" - return cls(json.loads(json_str)) - - + ORGANIZATION_STATE_UNSPECIFIED = "ORGANIZATION_STATE_UNSPECIFIED" + ORGANIZATION_STATE_ACTIVE = "ORGANIZATION_STATE_ACTIVE" + ORGANIZATION_STATE_INACTIVE = "ORGANIZATION_STATE_INACTIVE" + ORGANIZATION_STATE_REMOVED = "ORGANIZATION_STATE_REMOVED" diff --git a/zitadel_client/models/organization_service_organization_state_query.py b/zitadel_client/models/organization_service_organization_state_query.py index 93e35569..0158e828 100644 --- a/zitadel_client/models/organization_service_organization_state_query.py +++ b/zitadel_client/models/organization_service_organization_state_query.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_organization_state import OrganizationServiceOrganizationState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class OrganizationServiceOrganizationStateQuery(BaseModel): """ OrganizationServiceOrganizationStateQuery - """ # noqa: E501 - state: Optional[OrganizationServiceOrganizationState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[OrganizationServiceOrganizationState] = Field( + default=None, alias="state" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +31,8 @@ class OrganizationServiceOrganizationStateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationStateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceOrganizationStateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.organization_service_organization_state import ( + OrganizationServiceOrganizationState, +) +OrganizationServiceOrganizationStateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_pagination_request.py b/zitadel_client/models/organization_service_pagination_request.py index 2ddddf16..4056949d 100644 --- a/zitadel_client/models/organization_service_pagination_request.py +++ b/zitadel_client/models/organization_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class OrganizationServicePaginationRequest(BaseModel): """ OrganizationServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class OrganizationServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +OrganizationServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_pagination_response.py b/zitadel_client/models/organization_service_pagination_response.py index 59920c64..22955e29 100644 --- a/zitadel_client/models/organization_service_pagination_response.py +++ b/zitadel_client/models/organization_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServicePaginationResponse(BaseModel): """ OrganizationServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class OrganizationServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +OrganizationServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_password.py b/zitadel_client/models/organization_service_password.py index 25a88980..da67d1d4 100644 --- a/zitadel_client/models/organization_service_password.py +++ b/zitadel_client/models/organization_service_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class OrganizationServicePassword(BaseModel): """ OrganizationServicePassword - """ # noqa: E501 - password: Optional[StrictStr] = None + """ + + password: Optional[StrictStr] = Field(default=None, alias="password") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["password", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class OrganizationServicePassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServicePassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServicePassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +OrganizationServicePassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_search_query.py b/zitadel_client/models/organization_service_search_query.py index 38ec3917..92e571ed 100644 --- a/zitadel_client/models/organization_service_search_query.py +++ b/zitadel_client/models/organization_service_search_query.py @@ -1,42 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_organization_domain_query import OrganizationServiceOrganizationDomainQuery -from zitadel_client.models.organization_service_organization_id_query import OrganizationServiceOrganizationIDQuery -from zitadel_client.models.organization_service_organization_name_query import OrganizationServiceOrganizationNameQuery -from zitadel_client.models.organization_service_organization_state_query import OrganizationServiceOrganizationStateQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceSearchQuery(BaseModel): """ OrganizationServiceSearchQuery - """ # noqa: E501 - default_query: Optional[Dict[str, Any]] = Field(default=None, alias="defaultQuery") - domain_query: Optional[OrganizationServiceOrganizationDomainQuery] = Field(default=None, alias="domainQuery") - id_query: Optional[OrganizationServiceOrganizationIDQuery] = Field(default=None, alias="idQuery") - name_query: Optional[OrganizationServiceOrganizationNameQuery] = Field(default=None, alias="nameQuery") - state_query: Optional[OrganizationServiceOrganizationStateQuery] = Field(default=None, alias="stateQuery") - __properties: ClassVar[List[str]] = ["defaultQuery", "domainQuery", "idQuery", "nameQuery", "stateQuery"] + """ + + default_query: Optional[object] = Field(default=None, alias="defaultQuery") + domain_query: Optional[OrganizationServiceOrganizationDomainQuery] = Field( + default=None, alias="domainQuery" + ) + id_query: Optional[OrganizationServiceOrganizationIDQuery] = Field( + default=None, alias="idQuery" + ) + name_query: Optional[OrganizationServiceOrganizationNameQuery] = Field( + default=None, alias="nameQuery" + ) + state_query: Optional[OrganizationServiceOrganizationStateQuery] = Field( + default=None, alias="stateQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,68 +41,17 @@ class OrganizationServiceSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_query - if self.domain_query: - _dict['domainQuery'] = self.domain_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of id_query - if self.id_query: - _dict['idQuery'] = self.id_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of name_query - if self.name_query: - _dict['nameQuery'] = self.name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of state_query - if self.state_query: - _dict['stateQuery'] = self.state_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "defaultQuery": obj.get("defaultQuery"), - "domainQuery": OrganizationServiceOrganizationDomainQuery.from_dict(obj["domainQuery"]) if obj.get("domainQuery") is not None else None, - "idQuery": OrganizationServiceOrganizationIDQuery.from_dict(obj["idQuery"]) if obj.get("idQuery") is not None else None, - "nameQuery": OrganizationServiceOrganizationNameQuery.from_dict(obj["nameQuery"]) if obj.get("nameQuery") is not None else None, - "stateQuery": OrganizationServiceOrganizationStateQuery.from_dict(obj["stateQuery"]) if obj.get("stateQuery") is not None else None - }) - return _obj - - +from zitadel_client.models.organization_service_organization_domain_query import ( + OrganizationServiceOrganizationDomainQuery, +) +from zitadel_client.models.organization_service_organization_id_query import ( + OrganizationServiceOrganizationIDQuery, +) +from zitadel_client.models.organization_service_organization_name_query import ( + OrganizationServiceOrganizationNameQuery, +) +from zitadel_client.models.organization_service_organization_state_query import ( + OrganizationServiceOrganizationStateQuery, +) + +OrganizationServiceSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_send_email_verification_code.py b/zitadel_client/models/organization_service_send_email_verification_code.py index 6d40cc74..8a6110d9 100644 --- a/zitadel_client/models/organization_service_send_email_verification_code.py +++ b/zitadel_client/models/organization_service_send_email_verification_code.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceSendEmailVerificationCode(BaseModel): """ OrganizationServiceSendEmailVerificationCode - """ # noqa: E501 - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + """ + + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class OrganizationServiceSendEmailVerificationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSendEmailVerificationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSendEmailVerificationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +OrganizationServiceSendEmailVerificationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_human_email.py b/zitadel_client/models/organization_service_set_human_email.py index 844df13c..0a9e8703 100644 --- a/zitadel_client/models/organization_service_set_human_email.py +++ b/zitadel_client/models/organization_service_set_human_email.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_send_email_verification_code import OrganizationServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class OrganizationServiceSetHumanEmail(BaseModel): """ OrganizationServiceSetHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[OrganizationServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[OrganizationServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +35,8 @@ class OrganizationServiceSetHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": OrganizationServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_send_email_verification_code import ( + OrganizationServiceSendEmailVerificationCode, +) +OrganizationServiceSetHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_human_phone.py b/zitadel_client/models/organization_service_set_human_phone.py index e19ae0bd..dd2e31d1 100644 --- a/zitadel_client/models/organization_service_set_human_phone.py +++ b/zitadel_client/models/organization_service_set_human_phone.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class OrganizationServiceSetHumanPhone(BaseModel): """ OrganizationServiceSetHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class OrganizationServiceSetHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +OrganizationServiceSetHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_human_profile.py b/zitadel_client/models/organization_service_set_human_profile.py index 0119db2d..970b6bfe 100644 --- a/zitadel_client/models/organization_service_set_human_profile.py +++ b/zitadel_client/models/organization_service_set_human_profile.py @@ -1,40 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.organization_service_gender import OrganizationServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceSetHumanProfile(BaseModel): """ OrganizationServiceSetHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[OrganizationServiceGender] = None - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender"] + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[OrganizationServiceGender] = Field(default=None, alias="gender") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,72 +37,6 @@ class OrganizationServiceSetHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender") - }) - return _obj - +from zitadel_client.models.organization_service_gender import OrganizationServiceGender +OrganizationServiceSetHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_metadata_entry.py b/zitadel_client/models/organization_service_set_metadata_entry.py index 56285333..711baf71 100644 --- a/zitadel_client/models/organization_service_set_metadata_entry.py +++ b/zitadel_client/models/organization_service_set_metadata_entry.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceSetMetadataEntry(BaseModel): """ OrganizationServiceSetMetadataEntry - """ # noqa: E501 - key: Optional[StrictStr] = None - value: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["key", "value"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + value: Optional[Base64Bytes] = Field(default=None, alias="value") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,6 @@ class OrganizationServiceSetMetadataEntry(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetMetadataEntry from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetMetadataEntry from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +OrganizationServiceSetMetadataEntry.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_organization_metadata_request.py b/zitadel_client/models/organization_service_set_organization_metadata_request.py index 34d002a7..ad37d6c2 100644 --- a/zitadel_client/models/organization_service_set_organization_metadata_request.py +++ b/zitadel_client/models/organization_service_set_organization_metadata_request.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.organization_service_metadata import OrganizationServiceMetadata -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class OrganizationServiceSetOrganizationMetadataRequest(BaseModel): """ OrganizationServiceSetOrganizationMetadataRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID is the unique identifier of the organization whose metadata is to be set.", alias="organizationId") - metadata: Optional[List[OrganizationServiceMetadata]] = Field(default=None, description="Metadata is a list of metadata entries to set.") - __properties: ClassVar[List[str]] = ["organizationId", "metadata"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID is the unique identifier of the organization whose metadata is to be set.", + ) + metadata: Optional[List[OrganizationServiceMetadata]] = Field( + default=None, + alias="metadata", + description="Metadata is a list of metadata entries to set.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,60 +39,8 @@ class OrganizationServiceSetOrganizationMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetOrganizationMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetOrganizationMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "metadata": [OrganizationServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.organization_service_metadata import ( + OrganizationServiceMetadata, +) +OrganizationServiceSetOrganizationMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_set_organization_metadata_response.py b/zitadel_client/models/organization_service_set_organization_metadata_response.py index ccbeca95..fa5969ec 100644 --- a/zitadel_client/models/organization_service_set_organization_metadata_response.py +++ b/zitadel_client/models/organization_service_set_organization_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceSetOrganizationMetadataResponse(BaseModel): """ OrganizationServiceSetOrganizationMetadataResponse - """ # noqa: E501 - set_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="setDate") - __properties: ClassVar[List[str]] = ["setDate"] + """ + set_date: Optional[AwareDatetime] = Field( + default=None, + alias="setDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceSetOrganizationMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceSetOrganizationMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceSetOrganizationMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "setDate": obj.get("setDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceSetOrganizationMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_text_filter_method.py b/zitadel_client/models/organization_service_text_filter_method.py index f9279811..f8d7cbd4 100644 --- a/zitadel_client/models/organization_service_text_filter_method.py +++ b/zitadel_client/models/organization_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class OrganizationServiceTextFilterMethod(str, Enum): OrganizationServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/organization_service_text_query_method.py b/zitadel_client/models/organization_service_text_query_method.py index a6a1b1aa..224abac7 100644 --- a/zitadel_client/models/organization_service_text_query_method.py +++ b/zitadel_client/models/organization_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class OrganizationServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class OrganizationServiceTextQueryMethod(str, Enum): OrganizationServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of OrganizationServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/organization_service_update_organization_request.py b/zitadel_client/models/organization_service_update_organization_request.py index 91a55e5d..ba860034 100644 --- a/zitadel_client/models/organization_service_update_organization_request.py +++ b/zitadel_client/models/organization_service_update_organization_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceUpdateOrganizationRequest(BaseModel): """ OrganizationServiceUpdateOrganizationRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization to be updated.", alias="organizationId") - name: Optional[StrictStr] = Field(default=None, description="Name is the new name for the organization to be set. Note that since the name is used to generate the organization's default domain, changing the name will also change the domain. Additionally, if the domain is used as suffix for user logins, their login names will also change accordingly. It will not affect any custom domains added to the organization.") - __properties: ClassVar[List[str]] = ["organizationId", "name"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization to be updated.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the new name for the organization to be set. Note that since the name is used to generate the organization's default domain, changing the name will also change the domain. Additionally, if the domain is used as suffix for user logins, their login names will also change accordingly. It will not affect any custom domains added to the organization.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OrganizationServiceUpdateOrganizationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceUpdateOrganizationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceUpdateOrganizationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "name": obj.get("name") - }) - return _obj - - +OrganizationServiceUpdateOrganizationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_update_organization_response.py b/zitadel_client/models/organization_service_update_organization_response.py index affa8520..009c6cb2 100644 --- a/zitadel_client/models/organization_service_update_organization_response.py +++ b/zitadel_client/models/organization_service_update_organization_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceUpdateOrganizationResponse(BaseModel): """ OrganizationServiceUpdateOrganizationResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceUpdateOrganizationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceUpdateOrganizationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceUpdateOrganizationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceUpdateOrganizationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_verify_organization_domain_request.py b/zitadel_client/models/organization_service_verify_organization_domain_request.py index f475d43c..a9ee8073 100644 --- a/zitadel_client/models/organization_service_verify_organization_domain_request.py +++ b/zitadel_client/models/organization_service_verify_organization_domain_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class OrganizationServiceVerifyOrganizationDomainRequest(BaseModel): """ OrganizationServiceVerifyOrganizationDomainRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID is the unique identifier of the organization whose domain is to be verified.", alias="organizationId") - domain: Optional[StrictStr] = Field(default=None, description="Domain is the full qualified domain name to be verified.") - __properties: ClassVar[List[str]] = ["organizationId", "domain"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="Organization ID is the unique identifier of the organization whose domain is to be verified.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="Domain is the full qualified domain name to be verified.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class OrganizationServiceVerifyOrganizationDomainRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceVerifyOrganizationDomainRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceVerifyOrganizationDomainRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "domain": obj.get("domain") - }) - return _obj - - +OrganizationServiceVerifyOrganizationDomainRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/organization_service_verify_organization_domain_response.py b/zitadel_client/models/organization_service_verify_organization_domain_response.py index 0ff8103d..d5884fb8 100644 --- a/zitadel_client/models/organization_service_verify_organization_domain_response.py +++ b/zitadel_client/models/organization_service_verify_organization_domain_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class OrganizationServiceVerifyOrganizationDomainResponse(BaseModel): """ OrganizationServiceVerifyOrganizationDomainResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class OrganizationServiceVerifyOrganizationDomainResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of OrganizationServiceVerifyOrganizationDomainResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of OrganizationServiceVerifyOrganizationDomainResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +OrganizationServiceVerifyOrganizationDomainResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_activate_project_grant_request.py b/zitadel_client/models/project_service_activate_project_grant_request.py index dc14dca4..bb6f059a 100644 --- a/zitadel_client/models/project_service_activate_project_grant_request.py +++ b/zitadel_client/models/project_service_activate_project_grant_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceActivateProjectGrantRequest(BaseModel): """ ProjectServiceActivateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ProjectServiceActivateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +ProjectServiceActivateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_activate_project_grant_response.py b/zitadel_client/models/project_service_activate_project_grant_response.py index fc5e6d9a..18eed752 100644 --- a/zitadel_client/models/project_service_activate_project_grant_response.py +++ b/zitadel_client/models/project_service_activate_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceActivateProjectGrantResponse(BaseModel): """ ProjectServiceActivateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceActivateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceActivateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_activate_project_request.py b/zitadel_client/models/project_service_activate_project_request.py index ea6c2259..17c3fdc4 100644 --- a/zitadel_client/models/project_service_activate_project_request.py +++ b/zitadel_client/models/project_service_activate_project_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceActivateProjectRequest(BaseModel): """ ProjectServiceActivateProjectRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ProjectServiceActivateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ProjectServiceActivateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_activate_project_response.py b/zitadel_client/models/project_service_activate_project_response.py index 94557356..86d6cc5d 100644 --- a/zitadel_client/models/project_service_activate_project_response.py +++ b/zitadel_client/models/project_service_activate_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceActivateProjectResponse(BaseModel): """ ProjectServiceActivateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceActivateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceActivateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceActivateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_add_project_role_request.py b/zitadel_client/models/project_service_add_project_role_request.py index 7afad9e5..ec2a4239 100644 --- a/zitadel_client/models/project_service_add_project_role_request.py +++ b/zitadel_client/models/project_service_add_project_role_request.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceAddProjectRoleRequest(BaseModel): """ ProjectServiceAddProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.", alias="roleKey") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName is a human readable name for the role, which might be displayed to users.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users.") - __properties: ClassVar[List[str]] = ["projectId", "roleKey", "displayName", "group"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName is a human readable name for the role, which might be displayed to users.", + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,60 +49,4 @@ class ProjectServiceAddProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceAddProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if group (nullable) is None - # and model_fields_set contains the field - if self.group is None and "group" in self.model_fields_set: - _dict['group'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceAddProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - - +ProjectServiceAddProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_add_project_role_response.py b/zitadel_client/models/project_service_add_project_role_response.py index 26eda7b5..1a29b04a 100644 --- a/zitadel_client/models/project_service_add_project_role_response.py +++ b/zitadel_client/models/project_service_add_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceAddProjectRoleResponse(BaseModel): """ ProjectServiceAddProjectRoleResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceAddProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceAddProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceAddProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceAddProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_any.py b/zitadel_client/models/project_service_any.py index 853817be..7d296fa9 100644 --- a/zitadel_client/models/project_service_any.py +++ b/zitadel_client/models/project_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class ProjectServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +ProjectServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_connect_error.py b/zitadel_client/models/project_service_connect_error.py index 5437101b..434b7b0b 100644 --- a/zitadel_client/models/project_service_connect_error.py +++ b/zitadel_client/models/project_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_any import ProjectServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class ProjectServiceConnectErrorCodeEnum(str, Enum): + """ProjectServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class ProjectServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[ProjectServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[ProjectServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[ProjectServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [ProjectServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.project_service_any import ProjectServiceAny +ProjectServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_create_project_grant_request.py b/zitadel_client/models/project_service_create_project_grant_request.py index 363b05e4..aa89d76c 100644 --- a/zitadel_client/models/project_service_create_project_grant_request.py +++ b/zitadel_client/models/project_service_create_project_grant_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ProjectServiceCreateProjectGrantRequest(BaseModel): """ ProjectServiceCreateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the unique identifier of the organization the project will be granted to.", alias="grantedOrganizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId", "roleKeys"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the unique identifier of the organization the project will be granted to.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ProjectServiceCreateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +ProjectServiceCreateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_create_project_grant_response.py b/zitadel_client/models/project_service_create_project_grant_response.py index 0dd34803..66c58f81 100644 --- a/zitadel_client/models/project_service_create_project_grant_response.py +++ b/zitadel_client/models/project_service_create_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceCreateProjectGrantResponse(BaseModel): """ ProjectServiceCreateProjectGrantResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["creationDate"] + """ + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceCreateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceCreateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_create_project_request.py b/zitadel_client/models/project_service_create_project_request.py index 46e1df6b..65e6709f 100644 --- a/zitadel_client/models/project_service_create_project_request.py +++ b/zitadel_client/models/project_service_create_project_request.py @@ -1,41 +1,60 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_private_labeling_setting import ProjectServicePrivateLabelingSetting -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ProjectServiceCreateProjectRequest(BaseModel): """ ProjectServiceCreateProjectRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization the project belongs to.", alias="organizationId") - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the new project. This field is optional. If omitted, the system will generate a unique ID for you. This is the recommended way. The generated ID will be returned in the response.", alias="projectId") - name: Optional[StrictStr] = Field(default=None, description="Name of the project. This might be presented to users, e.g. in sign-in flows.") - project_role_assertion: Optional[StrictBool] = Field(default=None, description="ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.", alias="projectRoleAssertion") - authorization_required: Optional[StrictBool] = Field(default=None, description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project.", alias="authorizationRequired") - project_access_required: Optional[StrictBool] = Field(default=None, description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", alias="projectAccessRequired") - private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - __properties: ClassVar[List[str]] = ["organizationId", "projectId", "name", "projectRoleAssertion", "authorizationRequired", "projectAccessRequired", "privateLabelingSetting"] + """ + + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization the project belongs to.", + ) + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the new project. This field is optional. If omitted, the system will generate a unique ID for you. This is the recommended way. The generated ID will be returned in the response.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name of the project. This might be presented to users, e.g. in sign-in flows.", + ) + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types.", + ) + authorization_required: Optional[StrictBool] = Field( + default=None, + alias="authorizationRequired", + description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project.", + ) + project_access_required: Optional[StrictBool] = Field( + default=None, + alias="projectAccessRequired", + description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", + ) + private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field( + default=None, alias="privateLabelingSetting" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,63 +62,8 @@ class ProjectServiceCreateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if project_id (nullable) is None - # and model_fields_set contains the field - if self.project_id is None and "project_id" in self.model_fields_set: - _dict['projectId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "projectId": obj.get("projectId"), - "name": obj.get("name"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "authorizationRequired": obj.get("authorizationRequired"), - "projectAccessRequired": obj.get("projectAccessRequired"), - "privateLabelingSetting": obj.get("privateLabelingSetting") - }) - return _obj - +from zitadel_client.models.project_service_private_labeling_setting import ( + ProjectServicePrivateLabelingSetting, +) +ProjectServiceCreateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_create_project_response.py b/zitadel_client/models/project_service_create_project_response.py index 916c4284..1b36a238 100644 --- a/zitadel_client/models/project_service_create_project_response.py +++ b/zitadel_client/models/project_service_create_project_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceCreateProjectResponse(BaseModel): """ ProjectServiceCreateProjectResponse - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the newly created project.", alias="projectId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["projectId", "creationDate"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the newly created project.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class ProjectServiceCreateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceCreateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceCreateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_deactivate_project_grant_request.py b/zitadel_client/models/project_service_deactivate_project_grant_request.py index 3cb90893..89ce7a61 100644 --- a/zitadel_client/models/project_service_deactivate_project_grant_request.py +++ b/zitadel_client/models/project_service_deactivate_project_grant_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceDeactivateProjectGrantRequest(BaseModel): """ ProjectServiceDeactivateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ProjectServiceDeactivateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +ProjectServiceDeactivateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_deactivate_project_grant_response.py b/zitadel_client/models/project_service_deactivate_project_grant_response.py index 5d855aeb..d8ad851e 100644 --- a/zitadel_client/models/project_service_deactivate_project_grant_response.py +++ b/zitadel_client/models/project_service_deactivate_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceDeactivateProjectGrantResponse(BaseModel): """ ProjectServiceDeactivateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceDeactivateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceDeactivateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_deactivate_project_request.py b/zitadel_client/models/project_service_deactivate_project_request.py index ffd4a740..2770c67a 100644 --- a/zitadel_client/models/project_service_deactivate_project_request.py +++ b/zitadel_client/models/project_service_deactivate_project_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceDeactivateProjectRequest(BaseModel): """ ProjectServiceDeactivateProjectRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ProjectServiceDeactivateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ProjectServiceDeactivateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_deactivate_project_response.py b/zitadel_client/models/project_service_deactivate_project_response.py index d8de2e26..6a0d28bc 100644 --- a/zitadel_client/models/project_service_deactivate_project_response.py +++ b/zitadel_client/models/project_service_deactivate_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceDeactivateProjectResponse(BaseModel): """ ProjectServiceDeactivateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceDeactivateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeactivateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceDeactivateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_delete_project_grant_request.py b/zitadel_client/models/project_service_delete_project_grant_request.py index 91996b88..0e4e3b7d 100644 --- a/zitadel_client/models/project_service_delete_project_grant_request.py +++ b/zitadel_client/models/project_service_delete_project_grant_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceDeleteProjectGrantRequest(BaseModel): """ ProjectServiceDeleteProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", alias="grantedOrganizationId") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ProjectServiceDeleteProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId") - }) - return _obj - - +ProjectServiceDeleteProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_delete_project_grant_response.py b/zitadel_client/models/project_service_delete_project_grant_response.py index cb7b20da..0971777c 100644 --- a/zitadel_client/models/project_service_delete_project_grant_response.py +++ b/zitadel_client/models/project_service_delete_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceDeleteProjectGrantResponse(BaseModel): """ ProjectServiceDeleteProjectGrantResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceDeleteProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceDeleteProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_delete_project_request.py b/zitadel_client/models/project_service_delete_project_request.py index bcd922f5..9ec4a28b 100644 --- a/zitadel_client/models/project_service_delete_project_request.py +++ b/zitadel_client/models/project_service_delete_project_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceDeleteProjectRequest(BaseModel): """ ProjectServiceDeleteProjectRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project to be deleted.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project to be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ProjectServiceDeleteProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ProjectServiceDeleteProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_delete_project_response.py b/zitadel_client/models/project_service_delete_project_response.py index fdc1861f..83305802 100644 --- a/zitadel_client/models/project_service_delete_project_response.py +++ b/zitadel_client/models/project_service_delete_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceDeleteProjectResponse(BaseModel): """ ProjectServiceDeleteProjectResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceDeleteProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceDeleteProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceDeleteProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_get_project_request.py b/zitadel_client/models/project_service_get_project_request.py index c1641ade..4508d1bd 100644 --- a/zitadel_client/models/project_service_get_project_request.py +++ b/zitadel_client/models/project_service_get_project_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceGetProjectRequest(BaseModel): """ ProjectServiceGetProjectRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project to be retrieved.", alias="projectId") - __properties: ClassVar[List[str]] = ["projectId"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project to be retrieved.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ProjectServiceGetProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceGetProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceGetProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId") - }) - return _obj - - +ProjectServiceGetProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_get_project_response.py b/zitadel_client/models/project_service_get_project_response.py index 8a92e0ad..a872cca1 100644 --- a/zitadel_client/models/project_service_get_project_response.py +++ b/zitadel_client/models/project_service_get_project_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_project import ProjectServiceProject -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class ProjectServiceGetProjectResponse(BaseModel): """ ProjectServiceGetProjectResponse - """ # noqa: E501 - project: Optional[ProjectServiceProject] = None - __properties: ClassVar[List[str]] = ["project"] + """ + project: Optional[ProjectServiceProject] = Field(default=None, alias="project") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class ProjectServiceGetProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceGetProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of project - if self.project: - _dict['project'] = self.project.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceGetProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "project": ProjectServiceProject.from_dict(obj["project"]) if obj.get("project") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_project import ProjectServiceProject +ProjectServiceGetProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_granted_project_state.py b/zitadel_client/models/project_service_granted_project_state.py index 176dcd99..5dc91ec7 100644 --- a/zitadel_client/models/project_service_granted_project_state.py +++ b/zitadel_client/models/project_service_granted_project_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceGrantedProjectState(str, Enum): @@ -23,16 +13,6 @@ class ProjectServiceGrantedProjectState(str, Enum): ProjectServiceGrantedProjectState """ - """ - allowed enum values - """ - GRANTED_PROJECT_STATE_UNSPECIFIED = 'GRANTED_PROJECT_STATE_UNSPECIFIED' - GRANTED_PROJECT_STATE_ACTIVE = 'GRANTED_PROJECT_STATE_ACTIVE' - GRANTED_PROJECT_STATE_INACTIVE = 'GRANTED_PROJECT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceGrantedProjectState from a JSON string""" - return cls(json.loads(json_str)) - - + GRANTED_PROJECT_STATE_UNSPECIFIED = "GRANTED_PROJECT_STATE_UNSPECIFIED" + GRANTED_PROJECT_STATE_ACTIVE = "GRANTED_PROJECT_STATE_ACTIVE" + GRANTED_PROJECT_STATE_INACTIVE = "GRANTED_PROJECT_STATE_INACTIVE" diff --git a/zitadel_client/models/project_service_id_filter.py b/zitadel_client/models/project_service_id_filter.py index c912db1a..3a161d98 100644 --- a/zitadel_client/models/project_service_id_filter.py +++ b/zitadel_client/models/project_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceIDFilter(BaseModel): """ ProjectServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class ProjectServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +ProjectServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_in_ids_filter.py b/zitadel_client/models/project_service_in_ids_filter.py index 6d2cc38e..c8418db3 100644 --- a/zitadel_client/models/project_service_in_ids_filter.py +++ b/zitadel_client/models/project_service_in_ids_filter.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ProjectServiceInIDsFilter(BaseModel): """ ProjectServiceInIDsFilter - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="Defines the ids to query for.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, alias="ids", description="Defines the ids to query for." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class ProjectServiceInIDsFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceInIDsFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceInIDsFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +ProjectServiceInIDsFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_project_grants_request.py b/zitadel_client/models/project_service_list_project_grants_request.py index b25a62d4..2f219ff0 100644 --- a/zitadel_client/models/project_service_list_project_grants_request.py +++ b/zitadel_client/models/project_service_list_project_grants_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_request import ProjectServicePaginationRequest -from zitadel_client.models.project_service_project_grant_field_name import ProjectServiceProjectGrantFieldName -from zitadel_client.models.project_service_project_grant_search_filter import ProjectServiceProjectGrantSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ProjectServiceListProjectGrantsRequest(BaseModel): """ ProjectServiceListProjectGrantsRequest - """ # noqa: E501 - pagination: Optional[ProjectServicePaginationRequest] = None - sorting_column: Optional[ProjectServiceProjectGrantFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ProjectServiceProjectGrantSearchFilter]] = Field(default=None, description="Filters define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ProjectServiceProjectGrantFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ProjectServiceProjectGrantSearchFilter]] = Field( + default=None, + alias="filters", + description="Filters define the criteria to query for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class ProjectServiceListProjectGrantsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectGrantsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectGrantsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ProjectServiceProjectGrantSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_request import ( + ProjectServicePaginationRequest, +) +from zitadel_client.models.project_service_project_grant_field_name import ( + ProjectServiceProjectGrantFieldName, +) +from zitadel_client.models.project_service_project_grant_search_filter import ( + ProjectServiceProjectGrantSearchFilter, +) +ProjectServiceListProjectGrantsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_project_grants_response.py b/zitadel_client/models/project_service_list_project_grants_response.py index 7a2b55c8..0791d4b1 100644 --- a/zitadel_client/models/project_service_list_project_grants_response.py +++ b/zitadel_client/models/project_service_list_project_grants_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_response import ProjectServicePaginationResponse -from zitadel_client.models.project_service_project_grant import ProjectServiceProjectGrant -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ProjectServiceListProjectGrantsResponse(BaseModel): """ ProjectServiceListProjectGrantsResponse - """ # noqa: E501 - pagination: Optional[ProjectServicePaginationResponse] = None - project_grants: Optional[List[ProjectServiceProjectGrant]] = Field(default=None, description="ProjectGrants is a list of project grants matching the query.", alias="projectGrants") - __properties: ClassVar[List[str]] = ["pagination", "projectGrants"] + """ + + pagination: Optional[ProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + project_grants: Optional[List[ProjectServiceProjectGrant]] = Field( + default=None, + alias="projectGrants", + description="ProjectGrants is a list of project grants matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,11 @@ class ProjectServiceListProjectGrantsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectGrantsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in project_grants (list) - _items = [] - if self.project_grants: - for _item_project_grants in self.project_grants: - if _item_project_grants: - _items.append(_item_project_grants.to_dict()) - _dict['projectGrants'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectGrantsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projectGrants": [ProjectServiceProjectGrant.from_dict(_item) for _item in obj["projectGrants"]] if obj.get("projectGrants") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_response import ( + ProjectServicePaginationResponse, +) +from zitadel_client.models.project_service_project_grant import ( + ProjectServiceProjectGrant, +) +ProjectServiceListProjectGrantsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_project_roles_request.py b/zitadel_client/models/project_service_list_project_roles_request.py index 1ede8b72..10cd45ec 100644 --- a/zitadel_client/models/project_service_list_project_roles_request.py +++ b/zitadel_client/models/project_service_list_project_roles_request.py @@ -1,40 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_request import ProjectServicePaginationRequest -from zitadel_client.models.project_service_project_role_field_name import ProjectServiceProjectRoleFieldName -from zitadel_client.models.project_service_project_role_search_filter import ProjectServiceProjectRoleSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ProjectServiceListProjectRolesRequest(BaseModel): """ ProjectServiceListProjectRolesRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - pagination: Optional[ProjectServicePaginationRequest] = None - sorting_column: Optional[ProjectServiceProjectRoleFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ProjectServiceProjectRoleSearchFilter]] = Field(default=None, description="Filters define the criteria to query for.") - __properties: ClassVar[List[str]] = ["projectId", "pagination", "sortingColumn", "filters"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + pagination: Optional[ProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ProjectServiceProjectRoleFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ProjectServiceProjectRoleSearchFilter]] = Field( + default=None, + alias="filters", + description="Filters define the criteria to query for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,65 +45,14 @@ class ProjectServiceListProjectRolesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectRolesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectRolesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "pagination": ProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ProjectServiceProjectRoleSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_request import ( + ProjectServicePaginationRequest, +) +from zitadel_client.models.project_service_project_role_field_name import ( + ProjectServiceProjectRoleFieldName, +) +from zitadel_client.models.project_service_project_role_search_filter import ( + ProjectServiceProjectRoleSearchFilter, +) +ProjectServiceListProjectRolesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_project_roles_response.py b/zitadel_client/models/project_service_list_project_roles_response.py index 931a325d..51e2b620 100644 --- a/zitadel_client/models/project_service_list_project_roles_response.py +++ b/zitadel_client/models/project_service_list_project_roles_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_response import ProjectServicePaginationResponse -from zitadel_client.models.project_service_project_role import ProjectServiceProjectRole -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ProjectServiceListProjectRolesResponse(BaseModel): """ ProjectServiceListProjectRolesResponse - """ # noqa: E501 - pagination: Optional[ProjectServicePaginationResponse] = None - project_roles: Optional[List[ProjectServiceProjectRole]] = Field(default=None, description="ProjectRoles is a list of roles matching the query.", alias="projectRoles") - __properties: ClassVar[List[str]] = ["pagination", "projectRoles"] + """ + + pagination: Optional[ProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + project_roles: Optional[List[ProjectServiceProjectRole]] = Field( + default=None, + alias="projectRoles", + description="ProjectRoles is a list of roles matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class ProjectServiceListProjectRolesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectRolesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in project_roles (list) - _items = [] - if self.project_roles: - for _item_project_roles in self.project_roles: - if _item_project_roles: - _items.append(_item_project_roles.to_dict()) - _dict['projectRoles'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectRolesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projectRoles": [ProjectServiceProjectRole.from_dict(_item) for _item in obj["projectRoles"]] if obj.get("projectRoles") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_response import ( + ProjectServicePaginationResponse, +) +from zitadel_client.models.project_service_project_role import ProjectServiceProjectRole +ProjectServiceListProjectRolesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_projects_request.py b/zitadel_client/models/project_service_list_projects_request.py index a5ee7a7f..d812334f 100644 --- a/zitadel_client/models/project_service_list_projects_request.py +++ b/zitadel_client/models/project_service_list_projects_request.py @@ -1,39 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_request import ProjectServicePaginationRequest -from zitadel_client.models.project_service_project_field_name import ProjectServiceProjectFieldName -from zitadel_client.models.project_service_project_search_filter import ProjectServiceProjectSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ProjectServiceListProjectsRequest(BaseModel): """ ProjectServiceListProjectsRequest - """ # noqa: E501 - pagination: Optional[ProjectServicePaginationRequest] = None - sorting_column: Optional[ProjectServiceProjectFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[ProjectServiceProjectSearchFilter]] = Field(default=None, description="Filters define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[ProjectServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[ProjectServiceProjectFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[ProjectServiceProjectSearchFilter]] = Field( + default=None, + alias="filters", + description="Filters define the criteria to query for.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +39,14 @@ class ProjectServiceListProjectsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ProjectServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [ProjectServiceProjectSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_request import ( + ProjectServicePaginationRequest, +) +from zitadel_client.models.project_service_project_field_name import ( + ProjectServiceProjectFieldName, +) +from zitadel_client.models.project_service_project_search_filter import ( + ProjectServiceProjectSearchFilter, +) +ProjectServiceListProjectsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_list_projects_response.py b/zitadel_client/models/project_service_list_projects_response.py index 5dac1b57..71f49c4f 100644 --- a/zitadel_client/models/project_service_list_projects_response.py +++ b/zitadel_client/models/project_service_list_projects_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_pagination_response import ProjectServicePaginationResponse -from zitadel_client.models.project_service_project import ProjectServiceProject -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class ProjectServiceListProjectsResponse(BaseModel): """ ProjectServiceListProjectsResponse - """ # noqa: E501 - pagination: Optional[ProjectServicePaginationResponse] = None - projects: Optional[List[ProjectServiceProject]] = Field(default=None, description="Projects is a list of projects matching the query.") - __properties: ClassVar[List[str]] = ["pagination", "projects"] + """ + + pagination: Optional[ProjectServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + projects: Optional[List[ProjectServiceProject]] = Field( + default=None, + alias="projects", + description="Projects is a list of projects matching the query.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +36,9 @@ class ProjectServiceListProjectsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in projects (list) - _items = [] - if self.projects: - for _item_projects in self.projects: - if _item_projects: - _items.append(_item_projects.to_dict()) - _dict['projects'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceListProjectsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": ProjectServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "projects": [ProjectServiceProject.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_pagination_response import ( + ProjectServicePaginationResponse, +) +from zitadel_client.models.project_service_project import ProjectServiceProject +ProjectServiceListProjectsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_pagination_request.py b/zitadel_client/models/project_service_pagination_request.py index 3c6c6c93..7a2cf883 100644 --- a/zitadel_client/models/project_service_pagination_request.py +++ b/zitadel_client/models/project_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class ProjectServicePaginationRequest(BaseModel): """ ProjectServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class ProjectServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +ProjectServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_pagination_response.py b/zitadel_client/models/project_service_pagination_response.py index 55edba7e..290a1901 100644 --- a/zitadel_client/models/project_service_pagination_response.py +++ b/zitadel_client/models/project_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServicePaginationResponse(BaseModel): """ ProjectServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class ProjectServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +ProjectServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_private_labeling_setting.py b/zitadel_client/models/project_service_private_labeling_setting.py index ab3fc570..a189b101 100644 --- a/zitadel_client/models/project_service_private_labeling_setting.py +++ b/zitadel_client/models/project_service_private_labeling_setting.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServicePrivateLabelingSetting(str, Enum): @@ -23,16 +13,10 @@ class ProjectServicePrivateLabelingSetting(str, Enum): ProjectServicePrivateLabelingSetting """ - """ - allowed enum values - """ - PRIVATE_LABELING_SETTING_UNSPECIFIED = 'PRIVATE_LABELING_SETTING_UNSPECIFIED' - PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY' - PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = 'PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServicePrivateLabelingSetting from a JSON string""" - return cls(json.loads(json_str)) - - + PRIVATE_LABELING_SETTING_UNSPECIFIED = "PRIVATE_LABELING_SETTING_UNSPECIFIED" + PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY = ( + "PRIVATE_LABELING_SETTING_ENFORCE_PROJECT_RESOURCE_OWNER_POLICY" + ) + PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY = ( + "PRIVATE_LABELING_SETTING_ALLOW_LOGIN_USER_RESOURCE_OWNER_POLICY" + ) diff --git a/zitadel_client/models/project_service_project.py b/zitadel_client/models/project_service_project.py index f8c45dbf..465b1e53 100644 --- a/zitadel_client/models/project_service_project.py +++ b/zitadel_client/models/project_service_project.py @@ -1,50 +1,84 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_granted_project_state import ProjectServiceGrantedProjectState -from zitadel_client.models.project_service_private_labeling_setting import ProjectServicePrivateLabelingSetting -from zitadel_client.models.project_service_project_state import ProjectServiceProjectState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ProjectServiceProject(BaseModel): """ ProjectServiceProject - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID is the unique identifier of the organization the project belongs to.", alias="organizationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - name: Optional[StrictStr] = Field(default=None, description="Name is the name of the project. This might be presented to users, e.g. in sign-in flows.") - state: Optional[ProjectServiceProjectState] = None - project_role_assertion: Optional[StrictBool] = Field(default=None, description="ProjectRoleAssertion is a boolean flag that describes if the roles of the user should be added to the token.", alias="projectRoleAssertion") - authorization_required: Optional[StrictBool] = Field(default=None, description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project.", alias="authorizationRequired") - project_access_required: Optional[StrictBool] = Field(default=None, description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", alias="projectAccessRequired") - private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the ID of the organization the project is granted to. In case the project is not granted, this field is unset.", alias="grantedOrganizationId") - granted_organization_name: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationName is the name of the organization the project is granted to. In case the project is not granted, this field is unset.", alias="grantedOrganizationName") - granted_state: Optional[ProjectServiceGrantedProjectState] = Field(default=None, alias="grantedState") - __properties: ClassVar[List[str]] = ["projectId", "organizationId", "creationDate", "changeDate", "name", "state", "projectRoleAssertion", "authorizationRequired", "projectAccessRequired", "privateLabelingSetting", "grantedOrganizationId", "grantedOrganizationName", "grantedState"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID is the unique identifier of the organization the project belongs to.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is the name of the project. This might be presented to users, e.g. in sign-in flows.", + ) + state: Optional[ProjectServiceProjectState] = Field(default=None, alias="state") + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="ProjectRoleAssertion is a boolean flag that describes if the roles of the user should be added to the token.", + ) + authorization_required: Optional[StrictBool] = Field( + default=None, + alias="authorizationRequired", + description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has an authorization to use this project assigned when login into an application of this project.", + ) + project_access_required: Optional[StrictBool] = Field( + default=None, + alias="projectAccessRequired", + description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user, that is trying to log in, has access to this project (either owns the project or is granted).", + ) + private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field( + default=None, alias="privateLabelingSetting" + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the ID of the organization the project is granted to. In case the project is not granted, this field is unset.", + ) + granted_organization_name: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationName", + description="GrantedOrganizationName is the name of the organization the project is granted to. In case the project is not granted, this field is unset.", + ) + granted_state: Optional[ProjectServiceGrantedProjectState] = Field( + default=None, alias="grantedState" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -52,74 +86,15 @@ class ProjectServiceProject(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProject from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if granted_organization_id (nullable) is None - # and model_fields_set contains the field - if self.granted_organization_id is None and "granted_organization_id" in self.model_fields_set: - _dict['grantedOrganizationId'] = None - - # set to None if granted_organization_name (nullable) is None - # and model_fields_set contains the field - if self.granted_organization_name is None and "granted_organization_name" in self.model_fields_set: - _dict['grantedOrganizationName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProject from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "organizationId": obj.get("organizationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "name": obj.get("name"), - "state": obj.get("state"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "authorizationRequired": obj.get("authorizationRequired"), - "projectAccessRequired": obj.get("projectAccessRequired"), - "privateLabelingSetting": obj.get("privateLabelingSetting"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "grantedOrganizationName": obj.get("grantedOrganizationName"), - "grantedState": obj.get("grantedState") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.project_service_granted_project_state import ( + ProjectServiceGrantedProjectState, +) +from zitadel_client.models.project_service_private_labeling_setting import ( + ProjectServicePrivateLabelingSetting, +) +from zitadel_client.models.project_service_project_state import ( + ProjectServiceProjectState, +) +ProjectServiceProject.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_field_name.py b/zitadel_client/models/project_service_project_field_name.py index 44425e95..1b9d9e7b 100644 --- a/zitadel_client/models/project_service_project_field_name.py +++ b/zitadel_client/models/project_service_project_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceProjectFieldName(str, Enum): @@ -23,18 +13,8 @@ class ProjectServiceProjectFieldName(str, Enum): ProjectServiceProjectFieldName """ - """ - allowed enum values - """ - PROJECT_FIELD_NAME_UNSPECIFIED = 'PROJECT_FIELD_NAME_UNSPECIFIED' - PROJECT_FIELD_NAME_ID = 'PROJECT_FIELD_NAME_ID' - PROJECT_FIELD_NAME_CREATION_DATE = 'PROJECT_FIELD_NAME_CREATION_DATE' - PROJECT_FIELD_NAME_CHANGE_DATE = 'PROJECT_FIELD_NAME_CHANGE_DATE' - PROJECT_FIELD_NAME_NAME = 'PROJECT_FIELD_NAME_NAME' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceProjectFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_FIELD_NAME_UNSPECIFIED = "PROJECT_FIELD_NAME_UNSPECIFIED" + PROJECT_FIELD_NAME_ID = "PROJECT_FIELD_NAME_ID" + PROJECT_FIELD_NAME_CREATION_DATE = "PROJECT_FIELD_NAME_CREATION_DATE" + PROJECT_FIELD_NAME_CHANGE_DATE = "PROJECT_FIELD_NAME_CHANGE_DATE" + PROJECT_FIELD_NAME_NAME = "PROJECT_FIELD_NAME_NAME" diff --git a/zitadel_client/models/project_service_project_grant.py b/zitadel_client/models/project_service_project_grant.py index ac06a4a1..ec10e0e2 100644 --- a/zitadel_client/models/project_service_project_grant.py +++ b/zitadel_client/models/project_service_project_grant.py @@ -1,44 +1,68 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.project_service_project_grant_state import ProjectServiceProjectGrantState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ProjectServiceProjectGrant(BaseModel): """ ProjectServiceProjectGrant - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization which granted the project to the granted_organization_id.", alias="organizationId") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="The ID of the organization the project is granted to.", alias="grantedOrganizationId") - granted_organization_name: Optional[StrictStr] = Field(default=None, description="The name of the organization the project is granted to.", alias="grantedOrganizationName") - granted_role_keys: Optional[List[StrictStr]] = Field(default=None, description="The roles granted to the organization for self-management of the project.", alias="grantedRoleKeys") - project_id: Optional[StrictStr] = Field(default=None, description="The ID of the granted project.", alias="projectId") - project_name: Optional[StrictStr] = Field(default=None, description="The name of the granted project.", alias="projectName") - state: Optional[ProjectServiceProjectGrantState] = None - __properties: ClassVar[List[str]] = ["organizationId", "creationDate", "changeDate", "grantedOrganizationId", "grantedOrganizationName", "grantedRoleKeys", "projectId", "projectName", "state"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization which granted the project to the granted_organization_id.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="The ID of the organization the project is granted to.", + ) + granted_organization_name: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationName", + description="The name of the organization the project is granted to.", + ) + granted_role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="grantedRoleKeys", + description="The roles granted to the organization for self-management of the project.", + ) + project_id: Optional[StrictStr] = Field( + default=None, alias="projectId", description="The ID of the granted project." + ) + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="The name of the granted project.", + ) + state: Optional[ProjectServiceProjectGrantState] = Field( + default=None, alias="state" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,60 +70,9 @@ class ProjectServiceProjectGrant(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectGrant from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectGrant from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "grantedOrganizationName": obj.get("grantedOrganizationName"), - "grantedRoleKeys": obj.get("grantedRoleKeys"), - "projectId": obj.get("projectId"), - "projectName": obj.get("projectName"), - "state": obj.get("state") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.project_service_project_grant_state import ( + ProjectServiceProjectGrantState, +) +ProjectServiceProjectGrant.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_grant_field_name.py b/zitadel_client/models/project_service_project_grant_field_name.py index 7a64db22..f9d21f15 100644 --- a/zitadel_client/models/project_service_project_grant_field_name.py +++ b/zitadel_client/models/project_service_project_grant_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceProjectGrantFieldName(str, Enum): @@ -23,17 +13,7 @@ class ProjectServiceProjectGrantFieldName(str, Enum): ProjectServiceProjectGrantFieldName """ - """ - allowed enum values - """ - PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = 'PROJECT_GRANT_FIELD_NAME_UNSPECIFIED' - PROJECT_GRANT_FIELD_NAME_PROJECT_ID = 'PROJECT_GRANT_FIELD_NAME_PROJECT_ID' - PROJECT_GRANT_FIELD_NAME_CREATION_DATE = 'PROJECT_GRANT_FIELD_NAME_CREATION_DATE' - PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = 'PROJECT_GRANT_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceProjectGrantFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_GRANT_FIELD_NAME_UNSPECIFIED = "PROJECT_GRANT_FIELD_NAME_UNSPECIFIED" + PROJECT_GRANT_FIELD_NAME_PROJECT_ID = "PROJECT_GRANT_FIELD_NAME_PROJECT_ID" + PROJECT_GRANT_FIELD_NAME_CREATION_DATE = "PROJECT_GRANT_FIELD_NAME_CREATION_DATE" + PROJECT_GRANT_FIELD_NAME_CHANGE_DATE = "PROJECT_GRANT_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/project_service_project_grant_search_filter.py b/zitadel_client/models/project_service_project_grant_search_filter.py index 2bd7f1f5..dffd7e4b 100644 --- a/zitadel_client/models/project_service_project_grant_search_filter.py +++ b/zitadel_client/models/project_service_project_grant_search_filter.py @@ -1,42 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_id_filter import ProjectServiceIDFilter -from zitadel_client.models.project_service_in_ids_filter import ProjectServiceInIDsFilter -from zitadel_client.models.project_service_project_name_filter import ProjectServiceProjectNameFilter -from zitadel_client.models.project_service_project_role_key_filter import ProjectServiceProjectRoleKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceProjectGrantSearchFilter(BaseModel): """ ProjectServiceProjectGrantSearchFilter - """ # noqa: E501 - granted_organization_id_filter: Optional[ProjectServiceIDFilter] = Field(default=None, alias="grantedOrganizationIdFilter") - in_project_ids_filter: Optional[ProjectServiceInIDsFilter] = Field(default=None, alias="inProjectIdsFilter") - organization_id_filter: Optional[ProjectServiceIDFilter] = Field(default=None, alias="organizationIdFilter") - project_name_filter: Optional[ProjectServiceProjectNameFilter] = Field(default=None, alias="projectNameFilter") - role_key_filter: Optional[ProjectServiceProjectRoleKeyFilter] = Field(default=None, alias="roleKeyFilter") - __properties: ClassVar[List[str]] = ["grantedOrganizationIdFilter", "inProjectIdsFilter", "organizationIdFilter", "projectNameFilter", "roleKeyFilter"] + """ + + granted_organization_id_filter: Optional[ProjectServiceIDFilter] = Field( + default=None, alias="grantedOrganizationIdFilter" + ) + in_project_ids_filter: Optional[ProjectServiceInIDsFilter] = Field( + default=None, alias="inProjectIdsFilter" + ) + organization_id_filter: Optional[ProjectServiceIDFilter] = Field( + default=None, alias="organizationIdFilter" + ) + project_name_filter: Optional[ProjectServiceProjectNameFilter] = Field( + default=None, alias="projectNameFilter" + ) + role_key_filter: Optional[ProjectServiceProjectRoleKeyFilter] = Field( + default=None, alias="roleKeyFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,71 +43,15 @@ class ProjectServiceProjectGrantSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectGrantSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of granted_organization_id_filter - if self.granted_organization_id_filter: - _dict['grantedOrganizationIdFilter'] = self.granted_organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_project_ids_filter - if self.in_project_ids_filter: - _dict['inProjectIdsFilter'] = self.in_project_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_filter - if self.organization_id_filter: - _dict['organizationIdFilter'] = self.organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name_filter - if self.project_name_filter: - _dict['projectNameFilter'] = self.project_name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key_filter - if self.role_key_filter: - _dict['roleKeyFilter'] = self.role_key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectGrantSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "grantedOrganizationIdFilter": ProjectServiceIDFilter.from_dict(obj["grantedOrganizationIdFilter"]) if obj.get("grantedOrganizationIdFilter") is not None else None, - "inProjectIdsFilter": ProjectServiceInIDsFilter.from_dict(obj["inProjectIdsFilter"]) if obj.get("inProjectIdsFilter") is not None else None, - "organizationIdFilter": ProjectServiceIDFilter.from_dict(obj["organizationIdFilter"]) if obj.get("organizationIdFilter") is not None else None, - "projectNameFilter": ProjectServiceProjectNameFilter.from_dict(obj["projectNameFilter"]) if obj.get("projectNameFilter") is not None else None, - "roleKeyFilter": ProjectServiceProjectRoleKeyFilter.from_dict(obj["roleKeyFilter"]) if obj.get("roleKeyFilter") is not None else None - }) - return _obj - - +from zitadel_client.models.project_service_id_filter import ProjectServiceIDFilter +from zitadel_client.models.project_service_in_ids_filter import ( + ProjectServiceInIDsFilter, +) +from zitadel_client.models.project_service_project_name_filter import ( + ProjectServiceProjectNameFilter, +) +from zitadel_client.models.project_service_project_role_key_filter import ( + ProjectServiceProjectRoleKeyFilter, +) + +ProjectServiceProjectGrantSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_grant_state.py b/zitadel_client/models/project_service_project_grant_state.py index f8637629..4f66f559 100644 --- a/zitadel_client/models/project_service_project_grant_state.py +++ b/zitadel_client/models/project_service_project_grant_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceProjectGrantState(str, Enum): @@ -23,16 +13,6 @@ class ProjectServiceProjectGrantState(str, Enum): ProjectServiceProjectGrantState """ - """ - allowed enum values - """ - PROJECT_GRANT_STATE_UNSPECIFIED = 'PROJECT_GRANT_STATE_UNSPECIFIED' - PROJECT_GRANT_STATE_ACTIVE = 'PROJECT_GRANT_STATE_ACTIVE' - PROJECT_GRANT_STATE_INACTIVE = 'PROJECT_GRANT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceProjectGrantState from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_GRANT_STATE_UNSPECIFIED = "PROJECT_GRANT_STATE_UNSPECIFIED" + PROJECT_GRANT_STATE_ACTIVE = "PROJECT_GRANT_STATE_ACTIVE" + PROJECT_GRANT_STATE_INACTIVE = "PROJECT_GRANT_STATE_INACTIVE" diff --git a/zitadel_client/models/project_service_project_name_filter.py b/zitadel_client/models/project_service_project_name_filter.py index 55a56051..6a34daac 100644 --- a/zitadel_client/models/project_service_project_name_filter.py +++ b/zitadel_client/models/project_service_project_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_text_filter_method import ProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceProjectNameFilter(BaseModel): """ ProjectServiceProjectNameFilter - """ # noqa: E501 - project_name: Optional[StrictStr] = Field(default=None, description="Defines the name of the project to query for.", alias="projectName") - method: Optional[ProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["projectName", "method"] + """ + + project_name: Optional[StrictStr] = Field( + default=None, + alias="projectName", + description="Defines the name of the project to query for.", + ) + method: Optional[ProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ProjectServiceProjectNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectName": obj.get("projectName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.project_service_text_filter_method import ( + ProjectServiceTextFilterMethod, +) +ProjectServiceProjectNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_organization_id_filter.py b/zitadel_client/models/project_service_project_organization_id_filter.py index 73061e99..cf14e175 100644 --- a/zitadel_client/models/project_service_project_organization_id_filter.py +++ b/zitadel_client/models/project_service_project_organization_id_filter.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_type import ProjectServiceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceProjectOrganizationIDFilter(BaseModel): """ ProjectServiceProjectOrganizationIDFilter - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="OrganizationID Is the ID of the organization to query for.", alias="organizationId") - type: Optional[ProjectServiceType] = None - __properties: ClassVar[List[str]] = ["organizationId", "type"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="OrganizationID Is the ID of the organization to query for.", + ) + type: Optional[ProjectServiceType] = Field(default=None, alias="type") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +35,6 @@ class ProjectServiceProjectOrganizationIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectOrganizationIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectOrganizationIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.project_service_type import ProjectServiceType +ProjectServiceProjectOrganizationIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_role.py b/zitadel_client/models/project_service_project_role.py index 3ca8db06..93f58b41 100644 --- a/zitadel_client/models/project_service_project_role.py +++ b/zitadel_client/models/project_service_project_role.py @@ -1,40 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceProjectRole(BaseModel): """ ProjectServiceProjectRole - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the ID of the project the role belongs to.", alias="projectId") - key: Optional[StrictStr] = Field(default=None, description="Key of the project role. The key identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName is a human readable name for the role, which might be displayed to users.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users.") - __properties: ClassVar[List[str]] = ["projectId", "key", "creationDate", "changeDate", "displayName", "group"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the ID of the project the role belongs to.", + ) + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="Key of the project role. The key identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName is a human readable name for the role, which might be displayed to users.", + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. This attribute is not to be confused with groups as a collection of users.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +59,6 @@ class ProjectServiceProjectRole(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRole from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRole from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "key": obj.get("key"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceProjectRole.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_role_display_name_filter.py b/zitadel_client/models/project_service_project_role_display_name_filter.py index 0ca0890c..94c05b8e 100644 --- a/zitadel_client/models/project_service_project_role_display_name_filter.py +++ b/zitadel_client/models/project_service_project_role_display_name_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_text_filter_method import ProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceProjectRoleDisplayNameFilter(BaseModel): """ ProjectServiceProjectRoleDisplayNameFilter - """ # noqa: E501 - display_name: Optional[StrictStr] = Field(default=None, description="The display name of the project role to query for.", alias="displayName") - method: Optional[ProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + """ + + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="The display name of the project role to query for.", + ) + method: Optional[ProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ProjectServiceProjectRoleDisplayNameFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleDisplayNameFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleDisplayNameFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.project_service_text_filter_method import ( + ProjectServiceTextFilterMethod, +) +ProjectServiceProjectRoleDisplayNameFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_role_field_name.py b/zitadel_client/models/project_service_project_role_field_name.py index 76ef38a0..5ff63b98 100644 --- a/zitadel_client/models/project_service_project_role_field_name.py +++ b/zitadel_client/models/project_service_project_role_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceProjectRoleFieldName(str, Enum): @@ -23,17 +13,7 @@ class ProjectServiceProjectRoleFieldName(str, Enum): ProjectServiceProjectRoleFieldName """ - """ - allowed enum values - """ - PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = 'PROJECT_ROLE_FIELD_NAME_UNSPECIFIED' - PROJECT_ROLE_FIELD_NAME_KEY = 'PROJECT_ROLE_FIELD_NAME_KEY' - PROJECT_ROLE_FIELD_NAME_CREATION_DATE = 'PROJECT_ROLE_FIELD_NAME_CREATION_DATE' - PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = 'PROJECT_ROLE_FIELD_NAME_CHANGE_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceProjectRoleFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_ROLE_FIELD_NAME_UNSPECIFIED = "PROJECT_ROLE_FIELD_NAME_UNSPECIFIED" + PROJECT_ROLE_FIELD_NAME_KEY = "PROJECT_ROLE_FIELD_NAME_KEY" + PROJECT_ROLE_FIELD_NAME_CREATION_DATE = "PROJECT_ROLE_FIELD_NAME_CREATION_DATE" + PROJECT_ROLE_FIELD_NAME_CHANGE_DATE = "PROJECT_ROLE_FIELD_NAME_CHANGE_DATE" diff --git a/zitadel_client/models/project_service_project_role_key_filter.py b/zitadel_client/models/project_service_project_role_key_filter.py index 1ae2ca6b..1cc762ad 100644 --- a/zitadel_client/models/project_service_project_role_key_filter.py +++ b/zitadel_client/models/project_service_project_role_key_filter.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_text_filter_method import ProjectServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceProjectRoleKeyFilter(BaseModel): """ ProjectServiceProjectRoleKeyFilter - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="The key of the project role to query for.") - method: Optional[ProjectServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + + key: Optional[StrictStr] = Field( + default=None, + alias="key", + description="The key of the project role to query for.", + ) + method: Optional[ProjectServiceTextFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class ProjectServiceProjectRoleKeyFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleKeyFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleKeyFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.project_service_text_filter_method import ( + ProjectServiceTextFilterMethod, +) +ProjectServiceProjectRoleKeyFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_role_search_filter.py b/zitadel_client/models/project_service_project_role_search_filter.py index f668f783..9180e459 100644 --- a/zitadel_client/models/project_service_project_role_search_filter.py +++ b/zitadel_client/models/project_service_project_role_search_filter.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_project_role_display_name_filter import ProjectServiceProjectRoleDisplayNameFilter -from zitadel_client.models.project_service_project_role_key_filter import ProjectServiceProjectRoleKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceProjectRoleSearchFilter(BaseModel): """ ProjectServiceProjectRoleSearchFilter - """ # noqa: E501 - display_name_filter: Optional[ProjectServiceProjectRoleDisplayNameFilter] = Field(default=None, alias="displayNameFilter") - role_key_filter: Optional[ProjectServiceProjectRoleKeyFilter] = Field(default=None, alias="roleKeyFilter") - __properties: ClassVar[List[str]] = ["displayNameFilter", "roleKeyFilter"] + """ + + display_name_filter: Optional[ProjectServiceProjectRoleDisplayNameFilter] = Field( + default=None, alias="displayNameFilter" + ) + role_key_filter: Optional[ProjectServiceProjectRoleKeyFilter] = Field( + default=None, alias="roleKeyFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +34,11 @@ class ProjectServiceProjectRoleSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of display_name_filter - if self.display_name_filter: - _dict['displayNameFilter'] = self.display_name_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of role_key_filter - if self.role_key_filter: - _dict['roleKeyFilter'] = self.role_key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectRoleSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayNameFilter": ProjectServiceProjectRoleDisplayNameFilter.from_dict(obj["displayNameFilter"]) if obj.get("displayNameFilter") is not None else None, - "roleKeyFilter": ProjectServiceProjectRoleKeyFilter.from_dict(obj["roleKeyFilter"]) if obj.get("roleKeyFilter") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_project_role_display_name_filter import ( + ProjectServiceProjectRoleDisplayNameFilter, +) +from zitadel_client.models.project_service_project_role_key_filter import ( + ProjectServiceProjectRoleKeyFilter, +) +ProjectServiceProjectRoleSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_search_filter.py b/zitadel_client/models/project_service_project_search_filter.py index 6a8c5095..94df52fe 100644 --- a/zitadel_client/models/project_service_project_search_filter.py +++ b/zitadel_client/models/project_service_project_search_filter.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_in_ids_filter import ProjectServiceInIDsFilter -from zitadel_client.models.project_service_project_name_filter import ProjectServiceProjectNameFilter -from zitadel_client.models.project_service_project_organization_id_filter import ProjectServiceProjectOrganizationIDFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceProjectSearchFilter(BaseModel): """ ProjectServiceProjectSearchFilter - """ # noqa: E501 - in_project_ids_filter: Optional[ProjectServiceInIDsFilter] = Field(default=None, alias="inProjectIdsFilter") - organization_id_filter: Optional[ProjectServiceProjectOrganizationIDFilter] = Field(default=None, alias="organizationIdFilter") - project_name_filter: Optional[ProjectServiceProjectNameFilter] = Field(default=None, alias="projectNameFilter") - __properties: ClassVar[List[str]] = ["inProjectIdsFilter", "organizationIdFilter", "projectNameFilter"] + """ + + in_project_ids_filter: Optional[ProjectServiceInIDsFilter] = Field( + default=None, alias="inProjectIdsFilter" + ) + organization_id_filter: Optional[ProjectServiceProjectOrganizationIDFilter] = Field( + default=None, alias="organizationIdFilter" + ) + project_name_filter: Optional[ProjectServiceProjectNameFilter] = Field( + default=None, alias="projectNameFilter" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +37,14 @@ class ProjectServiceProjectSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceProjectSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of in_project_ids_filter - if self.in_project_ids_filter: - _dict['inProjectIdsFilter'] = self.in_project_ids_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_filter - if self.organization_id_filter: - _dict['organizationIdFilter'] = self.organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of project_name_filter - if self.project_name_filter: - _dict['projectNameFilter'] = self.project_name_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceProjectSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "inProjectIdsFilter": ProjectServiceInIDsFilter.from_dict(obj["inProjectIdsFilter"]) if obj.get("inProjectIdsFilter") is not None else None, - "organizationIdFilter": ProjectServiceProjectOrganizationIDFilter.from_dict(obj["organizationIdFilter"]) if obj.get("organizationIdFilter") is not None else None, - "projectNameFilter": ProjectServiceProjectNameFilter.from_dict(obj["projectNameFilter"]) if obj.get("projectNameFilter") is not None else None - }) - return _obj - +from zitadel_client.models.project_service_in_ids_filter import ( + ProjectServiceInIDsFilter, +) +from zitadel_client.models.project_service_project_name_filter import ( + ProjectServiceProjectNameFilter, +) +from zitadel_client.models.project_service_project_organization_id_filter import ( + ProjectServiceProjectOrganizationIDFilter, +) +ProjectServiceProjectSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_project_state.py b/zitadel_client/models/project_service_project_state.py index d54589d1..90fd1176 100644 --- a/zitadel_client/models/project_service_project_state.py +++ b/zitadel_client/models/project_service_project_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceProjectState(str, Enum): @@ -23,16 +13,6 @@ class ProjectServiceProjectState(str, Enum): ProjectServiceProjectState """ - """ - allowed enum values - """ - PROJECT_STATE_UNSPECIFIED = 'PROJECT_STATE_UNSPECIFIED' - PROJECT_STATE_ACTIVE = 'PROJECT_STATE_ACTIVE' - PROJECT_STATE_INACTIVE = 'PROJECT_STATE_INACTIVE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceProjectState from a JSON string""" - return cls(json.loads(json_str)) - - + PROJECT_STATE_UNSPECIFIED = "PROJECT_STATE_UNSPECIFIED" + PROJECT_STATE_ACTIVE = "PROJECT_STATE_ACTIVE" + PROJECT_STATE_INACTIVE = "PROJECT_STATE_INACTIVE" diff --git a/zitadel_client/models/project_service_remove_project_role_request.py b/zitadel_client/models/project_service_remove_project_role_request.py index 96dacefb..7f5a5e14 100644 --- a/zitadel_client/models/project_service_remove_project_role_request.py +++ b/zitadel_client/models/project_service_remove_project_role_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceRemoveProjectRoleRequest(BaseModel): """ ProjectServiceRemoveProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="RoleKey is the key of the role to be removed. All dependencies of this role will be removed as well, including project grants and user grants. If the role is not found, the request will return a successful response as the desired state is already achieved.", alias="roleKey") - __properties: ClassVar[List[str]] = ["projectId", "roleKey"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="RoleKey is the key of the role to be removed. All dependencies of this role will be removed as well, including project grants and user grants. If the role is not found, the request will return a successful response as the desired state is already achieved.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class ProjectServiceRemoveProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceRemoveProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceRemoveProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey") - }) - return _obj - - +ProjectServiceRemoveProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_remove_project_role_response.py b/zitadel_client/models/project_service_remove_project_role_response.py index 926c11d4..ea241743 100644 --- a/zitadel_client/models/project_service_remove_project_role_response.py +++ b/zitadel_client/models/project_service_remove_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceRemoveProjectRoleResponse(BaseModel): """ ProjectServiceRemoveProjectRoleResponse - """ # noqa: E501 - removal_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="removalDate") - __properties: ClassVar[List[str]] = ["removalDate"] + """ + removal_date: Optional[AwareDatetime] = Field( + default=None, + alias="removalDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceRemoveProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceRemoveProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceRemoveProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "removalDate": obj.get("removalDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceRemoveProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_text_filter_method.py b/zitadel_client/models/project_service_text_filter_method.py index 2a085b2c..a903f42c 100644 --- a/zitadel_client/models/project_service_text_filter_method.py +++ b/zitadel_client/models/project_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class ProjectServiceTextFilterMethod(str, Enum): ProjectServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/project_service_type.py b/zitadel_client/models/project_service_type.py index 857f1ac0..8c9a8e28 100644 --- a/zitadel_client/models/project_service_type.py +++ b/zitadel_client/models/project_service_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class ProjectServiceType(str, Enum): @@ -23,17 +13,7 @@ class ProjectServiceType(str, Enum): ProjectServiceType """ - """ - allowed enum values - """ - TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' - OWNED = 'OWNED' - GRANTED = 'GRANTED' - OWNED_OR_GRANTED = 'OWNED_OR_GRANTED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProjectServiceType from a JSON string""" - return cls(json.loads(json_str)) - - + TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED" + OWNED = "OWNED" + GRANTED = "GRANTED" + OWNED_OR_GRANTED = "OWNED_OR_GRANTED" diff --git a/zitadel_client/models/project_service_update_project_grant_request.py b/zitadel_client/models/project_service_update_project_grant_request.py index d03cc4a4..1c2de84b 100644 --- a/zitadel_client/models/project_service_update_project_grant_request.py +++ b/zitadel_client/models/project_service_update_project_grant_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class ProjectServiceUpdateProjectGrantRequest(BaseModel): """ ProjectServiceUpdateProjectGrantRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - granted_organization_id: Optional[StrictStr] = Field(default=None, description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", alias="grantedOrganizationId") - role_keys: Optional[List[StrictStr]] = Field(default=None, description="RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. Any roles not included in this list will be removed from the project grant. If you want to add a role, make sure to include all other existing roles as well. If any previous role is removed, all user grants for this project grant with this role will be removed as well.", alias="roleKeys") - __properties: ClassVar[List[str]] = ["projectId", "grantedOrganizationId", "roleKeys"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + granted_organization_id: Optional[StrictStr] = Field( + default=None, + alias="grantedOrganizationId", + description="GrantedOrganizationID is the unique identifier of the organization the project was granted to.", + ) + role_keys: Optional[List[StrictStr]] = Field( + default=None, + alias="roleKeys", + description="RoleKeys is a list of roles to be granted to the organization for self management. The roles are identified by their keys. Any roles not included in this list will be removed from the project grant. If you want to add a role, make sure to include all other existing roles as well. If any previous role is removed, all user grants for this project grant with this role will be removed as well.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +44,4 @@ class ProjectServiceUpdateProjectGrantRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectGrantRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectGrantRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "grantedOrganizationId": obj.get("grantedOrganizationId"), - "roleKeys": obj.get("roleKeys") - }) - return _obj - - +ProjectServiceUpdateProjectGrantRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_update_project_grant_response.py b/zitadel_client/models/project_service_update_project_grant_response.py index 61226ed0..8e5aded6 100644 --- a/zitadel_client/models/project_service_update_project_grant_response.py +++ b/zitadel_client/models/project_service_update_project_grant_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceUpdateProjectGrantResponse(BaseModel): """ ProjectServiceUpdateProjectGrantResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceUpdateProjectGrantResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectGrantResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectGrantResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceUpdateProjectGrantResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_update_project_request.py b/zitadel_client/models/project_service_update_project_request.py index ad6a0e6a..de9902e4 100644 --- a/zitadel_client/models/project_service_update_project_request.py +++ b/zitadel_client/models/project_service_update_project_request.py @@ -1,40 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.project_service_private_labeling_setting import ProjectServicePrivateLabelingSetting -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class ProjectServiceUpdateProjectRequest(BaseModel): """ ProjectServiceUpdateProjectRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project to be updated.", alias="projectId") - name: Optional[StrictStr] = Field(default=None, description="Name is used to update the name of the project. This field is optional. If omitted, the name will remain unchanged.") - project_role_assertion: Optional[StrictBool] = Field(default=None, description="ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. If omitted, the setting will remain unchanged.", alias="projectRoleAssertion") - authorization_required: Optional[StrictBool] = Field(default=None, description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has a role of this project assigned when logging into an application of this project. If omitted, the setting will remain unchanged.", alias="authorizationRequired") - project_access_required: Optional[StrictBool] = Field(default=None, description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user has a grant to this project. If omitted, the setting will remain unchanged.", alias="projectAccessRequired") - private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field(default=None, alias="privateLabelingSetting") - __properties: ClassVar[List[str]] = ["projectId", "name", "projectRoleAssertion", "authorizationRequired", "projectAccessRequired", "privateLabelingSetting"] + """ + + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project to be updated.", + ) + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="Name is used to update the name of the project. This field is optional. If omitted, the name will remain unchanged.", + ) + project_role_assertion: Optional[StrictBool] = Field( + default=None, + alias="projectRoleAssertion", + description="ProjectRoleAssertion is a setting that can be enabled to have role information included in the user info endpoint. It is also dependent on your application settings to include it in tokens and other types. If omitted, the setting will remain unchanged.", + ) + authorization_required: Optional[StrictBool] = Field( + default=None, + alias="authorizationRequired", + description="AuthorizationRequired is a boolean flag that can be enabled to check if a user has a role of this project assigned when logging into an application of this project. If omitted, the setting will remain unchanged.", + ) + project_access_required: Optional[StrictBool] = Field( + default=None, + alias="projectAccessRequired", + description="ProjectAccessRequired is a boolean flag that can be enabled to check if the organization of the user has a grant to this project. If omitted, the setting will remain unchanged.", + ) + private_labeling_setting: Optional[ProjectServicePrivateLabelingSetting] = Field( + default=None, alias="privateLabelingSetting" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,77 +57,8 @@ class ProjectServiceUpdateProjectRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if project_role_assertion (nullable) is None - # and model_fields_set contains the field - if self.project_role_assertion is None and "project_role_assertion" in self.model_fields_set: - _dict['projectRoleAssertion'] = None - - # set to None if authorization_required (nullable) is None - # and model_fields_set contains the field - if self.authorization_required is None and "authorization_required" in self.model_fields_set: - _dict['authorizationRequired'] = None - - # set to None if project_access_required (nullable) is None - # and model_fields_set contains the field - if self.project_access_required is None and "project_access_required" in self.model_fields_set: - _dict['projectAccessRequired'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "name": obj.get("name"), - "projectRoleAssertion": obj.get("projectRoleAssertion"), - "authorizationRequired": obj.get("authorizationRequired"), - "projectAccessRequired": obj.get("projectAccessRequired"), - "privateLabelingSetting": obj.get("privateLabelingSetting") - }) - return _obj - +from zitadel_client.models.project_service_private_labeling_setting import ( + ProjectServicePrivateLabelingSetting, +) +ProjectServiceUpdateProjectRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_update_project_response.py b/zitadel_client/models/project_service_update_project_response.py index 12833055..ec5162a6 100644 --- a/zitadel_client/models/project_service_update_project_response.py +++ b/zitadel_client/models/project_service_update_project_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceUpdateProjectResponse(BaseModel): """ ProjectServiceUpdateProjectResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceUpdateProjectResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceUpdateProjectResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_update_project_role_request.py b/zitadel_client/models/project_service_update_project_role_request.py index eb6202cb..ad720fdb 100644 --- a/zitadel_client/models/project_service_update_project_role_request.py +++ b/zitadel_client/models/project_service_update_project_role_request.py @@ -1,37 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class ProjectServiceUpdateProjectRoleRequest(BaseModel): """ ProjectServiceUpdateProjectRoleRequest - """ # noqa: E501 - project_id: Optional[StrictStr] = Field(default=None, description="ProjectID is the unique identifier of the project.", alias="projectId") - role_key: Optional[StrictStr] = Field(default=None, description="RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. It cannot be changed. If you need a different key, remove the role and create a new one.", alias="roleKey") - display_name: Optional[StrictStr] = Field(default=None, description="DisplayName is the human readable name for the role, which might be displayed to users. If omitted, the name will remain unchanged.", alias="displayName") - group: Optional[StrictStr] = Field(default=None, description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. If omitted, the group will remain unchanged. This attribute is not to be confused with groups as a collection of users.") - __properties: ClassVar[List[str]] = ["projectId", "roleKey", "displayName", "group"] + """ + project_id: Optional[StrictStr] = Field( + default=None, + alias="projectId", + description="ProjectID is the unique identifier of the project.", + ) + role_key: Optional[StrictStr] = Field( + default=None, + alias="roleKey", + description="RoleKey identifies the role. It's the only relevant attribute for ZITADEL and will be used for authorization checks and as claim in tokens and user info responses. It cannot be changed. If you need a different key, remove the role and create a new one.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="DisplayName is the human readable name for the role, which might be displayed to users. If omitted, the name will remain unchanged.", + ) + group: Optional[StrictStr] = Field( + default=None, + alias="group", + description="Group allows grouping roles for display purposes. Zitadel will not handle it in any way. It can be used to group roles in a UI to allow easier management for administrators. If omitted, the group will remain unchanged. This attribute is not to be confused with groups as a collection of users.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,65 +49,4 @@ class ProjectServiceUpdateProjectRoleRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRoleRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if group (nullable) is None - # and model_fields_set contains the field - if self.group is None and "group" in self.model_fields_set: - _dict['group'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRoleRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "projectId": obj.get("projectId"), - "roleKey": obj.get("roleKey"), - "displayName": obj.get("displayName"), - "group": obj.get("group") - }) - return _obj - - +ProjectServiceUpdateProjectRoleRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/project_service_update_project_role_response.py b/zitadel_client/models/project_service_update_project_role_response.py index c6d391f5..8bff334a 100644 --- a/zitadel_client/models/project_service_update_project_role_response.py +++ b/zitadel_client/models/project_service_update_project_role_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class ProjectServiceUpdateProjectRoleResponse(BaseModel): """ ProjectServiceUpdateProjectRoleResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class ProjectServiceUpdateProjectRoleResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRoleResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProjectServiceUpdateProjectRoleResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +ProjectServiceUpdateProjectRoleResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_any.py b/zitadel_client/models/saml_service_any.py index 7eeed483..d9a20670 100644 --- a/zitadel_client/models/saml_service_any.py +++ b/zitadel_client/models/saml_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class SAMLServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +SAMLServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_authorization_error.py b/zitadel_client/models/saml_service_authorization_error.py index 74639451..88e87408 100644 --- a/zitadel_client/models/saml_service_authorization_error.py +++ b/zitadel_client/models/saml_service_authorization_error.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.saml_service_error_reason import SAMLServiceErrorReason -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceAuthorizationError(BaseModel): """ SAMLServiceAuthorizationError - """ # noqa: E501 - error: Optional[SAMLServiceErrorReason] = None - error_description: Optional[StrictStr] = Field(default=None, alias="errorDescription") - __properties: ClassVar[List[str]] = ["error", "errorDescription"] + """ + error: Optional[SAMLServiceErrorReason] = Field(default=None, alias="error") + error_description: Optional[StrictStr] = Field( + default=None, alias="errorDescription" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,58 +33,6 @@ class SAMLServiceAuthorizationError(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceAuthorizationError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if error_description (nullable) is None - # and model_fields_set contains the field - if self.error_description is None and "error_description" in self.model_fields_set: - _dict['errorDescription'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceAuthorizationError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "error": obj.get("error"), - "errorDescription": obj.get("errorDescription") - }) - return _obj - +from zitadel_client.models.saml_service_error_reason import SAMLServiceErrorReason +SAMLServiceAuthorizationError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_connect_error.py b/zitadel_client/models/saml_service_connect_error.py index c200a2c6..8bba4fd2 100644 --- a/zitadel_client/models/saml_service_connect_error.py +++ b/zitadel_client/models/saml_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.saml_service_any import SAMLServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class SAMLServiceConnectErrorCodeEnum(str, Enum): + """SAMLServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class SAMLServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[SAMLServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[SAMLServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[SAMLServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [SAMLServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.saml_service_any import SAMLServiceAny +SAMLServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_create_response_request.py b/zitadel_client/models/saml_service_create_response_request.py index eac81c34..1f88c141 100644 --- a/zitadel_client/models/saml_service_create_response_request.py +++ b/zitadel_client/models/saml_service_create_response_request.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.saml_service_authorization_error import SAMLServiceAuthorizationError -from zitadel_client.models.saml_service_session import SAMLServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceCreateResponseRequest(BaseModel): """ SAMLServiceCreateResponseRequest - """ # noqa: E501 - saml_request_id: Optional[StrictStr] = Field(default=None, description="ID of the SAML Request.", alias="samlRequestId") - error: Optional[SAMLServiceAuthorizationError] = None - session: Optional[SAMLServiceSession] = None - __properties: ClassVar[List[str]] = ["samlRequestId", "error", "session"] + """ + saml_request_id: Optional[StrictStr] = Field( + default=None, alias="samlRequestId", description="ID of the SAML Request." + ) + error: Optional[SAMLServiceAuthorizationError] = Field(default=None, alias="error") + session: Optional[SAMLServiceSession] = Field(default=None, alias="session") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +34,9 @@ class SAMLServiceCreateResponseRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceCreateResponseRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of error - if self.error: - _dict['error'] = self.error.to_dict() - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceCreateResponseRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "samlRequestId": obj.get("samlRequestId"), - "error": SAMLServiceAuthorizationError.from_dict(obj["error"]) if obj.get("error") is not None else None, - "session": SAMLServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.saml_service_authorization_error import ( + SAMLServiceAuthorizationError, +) +from zitadel_client.models.saml_service_session import SAMLServiceSession +SAMLServiceCreateResponseRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_create_response_response.py b/zitadel_client/models/saml_service_create_response_response.py index b1a715f7..f395785c 100644 --- a/zitadel_client/models/saml_service_create_response_response.py +++ b/zitadel_client/models/saml_service_create_response_response.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.saml_service_details import SAMLServiceDetails -from zitadel_client.models.saml_service_post_response import SAMLServicePostResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceCreateResponseResponse(BaseModel): """ SAMLServiceCreateResponseResponse - """ # noqa: E501 - details: Optional[SAMLServiceDetails] = None - url: Optional[StrictStr] = Field(default=None, description="URL including the Assertion Consumer Service where the user should be redirected or has to call per POST, depending on the binding. Contains details for the application to obtain the response on success, or error details on failure. Note that this field must be treated as credentials, as the contained SAMLResponse or code can be used on behalve of the user.") - post: Optional[SAMLServicePostResponse] = None - redirect: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["details", "url", "post", "redirect"] + """ + details: Optional[SAMLServiceDetails] = Field(default=None, alias="details") + url: Optional[StrictStr] = Field( + default=None, + alias="url", + description="URL including the Assertion Consumer Service where the user should be redirected or has to call per POST, depending on the binding. Contains details for the application to obtain the response on success, or error details on failure. Note that this field must be treated as credentials, as the contained SAMLResponse or code can be used on behalve of the user.", + ) + post: Optional[SAMLServicePostResponse] = Field(default=None, alias="post") + redirect: Optional[object] = Field(default=None, alias="redirect") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,61 +37,7 @@ class SAMLServiceCreateResponseResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceCreateResponseResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of post - if self.post: - _dict['post'] = self.post.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceCreateResponseResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SAMLServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "url": obj.get("url"), - "post": SAMLServicePostResponse.from_dict(obj["post"]) if obj.get("post") is not None else None, - "redirect": obj.get("redirect") - }) - return _obj - +from zitadel_client.models.saml_service_details import SAMLServiceDetails +from zitadel_client.models.saml_service_post_response import SAMLServicePostResponse +SAMLServiceCreateResponseResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_details.py b/zitadel_client/models/saml_service_details.py index 82f48217..0d9ac912 100644 --- a/zitadel_client/models/saml_service_details.py +++ b/zitadel_client/models/saml_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceDetails(BaseModel): """ SAMLServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class SAMLServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +SAMLServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_error_reason.py b/zitadel_client/models/saml_service_error_reason.py index aff3e9ea..2b5f26eb 100644 --- a/zitadel_client/models/saml_service_error_reason.py +++ b/zitadel_client/models/saml_service_error_reason.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SAMLServiceErrorReason(str, Enum): @@ -23,21 +13,11 @@ class SAMLServiceErrorReason(str, Enum): SAMLServiceErrorReason """ - """ - allowed enum values - """ - ERROR_REASON_UNSPECIFIED = 'ERROR_REASON_UNSPECIFIED' - ERROR_REASON_VERSION_MISSMATCH = 'ERROR_REASON_VERSION_MISSMATCH' - ERROR_REASON_AUTH_N_FAILED = 'ERROR_REASON_AUTH_N_FAILED' - ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE = 'ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE' - ERROR_REASON_INVALID_NAMEID_POLICY = 'ERROR_REASON_INVALID_NAMEID_POLICY' - ERROR_REASON_REQUEST_DENIED = 'ERROR_REASON_REQUEST_DENIED' - ERROR_REASON_REQUEST_UNSUPPORTED = 'ERROR_REASON_REQUEST_UNSUPPORTED' - ERROR_REASON_UNSUPPORTED_BINDING = 'ERROR_REASON_UNSUPPORTED_BINDING' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SAMLServiceErrorReason from a JSON string""" - return cls(json.loads(json_str)) - - + ERROR_REASON_UNSPECIFIED = "ERROR_REASON_UNSPECIFIED" + ERROR_REASON_VERSION_MISSMATCH = "ERROR_REASON_VERSION_MISSMATCH" + ERROR_REASON_AUTH_N_FAILED = "ERROR_REASON_AUTH_N_FAILED" + ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE = "ERROR_REASON_INVALID_ATTR_NAME_OR_VALUE" + ERROR_REASON_INVALID_NAMEID_POLICY = "ERROR_REASON_INVALID_NAMEID_POLICY" + ERROR_REASON_REQUEST_DENIED = "ERROR_REASON_REQUEST_DENIED" + ERROR_REASON_REQUEST_UNSUPPORTED = "ERROR_REASON_REQUEST_UNSUPPORTED" + ERROR_REASON_UNSUPPORTED_BINDING = "ERROR_REASON_UNSUPPORTED_BINDING" diff --git a/zitadel_client/models/saml_service_get_saml_request_request.py b/zitadel_client/models/saml_service_get_saml_request_request.py index 5682bdad..1da904c6 100644 --- a/zitadel_client/models/saml_service_get_saml_request_request.py +++ b/zitadel_client/models/saml_service_get_saml_request_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceGetSAMLRequestRequest(BaseModel): """ SAMLServiceGetSAMLRequestRequest - """ # noqa: E501 - saml_request_id: Optional[StrictStr] = Field(default=None, description="ID of the SAML Request, as obtained from the redirect URL.", alias="samlRequestId") - __properties: ClassVar[List[str]] = ["samlRequestId"] + """ + saml_request_id: Optional[StrictStr] = Field( + default=None, + alias="samlRequestId", + description="ID of the SAML Request, as obtained from the redirect URL.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SAMLServiceGetSAMLRequestRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceGetSAMLRequestRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceGetSAMLRequestRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "samlRequestId": obj.get("samlRequestId") - }) - return _obj - - +SAMLServiceGetSAMLRequestRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_get_saml_request_response.py b/zitadel_client/models/saml_service_get_saml_request_response.py index 17645f99..26f1060d 100644 --- a/zitadel_client/models/saml_service_get_saml_request_response.py +++ b/zitadel_client/models/saml_service_get_saml_request_response.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.saml_service_saml_request import SAMLServiceSAMLRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SAMLServiceGetSAMLRequestResponse(BaseModel): """ SAMLServiceGetSAMLRequestResponse - """ # noqa: E501 - saml_request: Optional[SAMLServiceSAMLRequest] = Field(default=None, alias="samlRequest") - __properties: ClassVar[List[str]] = ["samlRequest"] + """ + saml_request: Optional[SAMLServiceSAMLRequest] = Field( + default=None, alias="samlRequest" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,6 @@ class SAMLServiceGetSAMLRequestResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceGetSAMLRequestResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of saml_request - if self.saml_request: - _dict['samlRequest'] = self.saml_request.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceGetSAMLRequestResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "samlRequest": SAMLServiceSAMLRequest.from_dict(obj["samlRequest"]) if obj.get("samlRequest") is not None else None - }) - return _obj - +from zitadel_client.models.saml_service_saml_request import SAMLServiceSAMLRequest +SAMLServiceGetSAMLRequestResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_post_response.py b/zitadel_client/models/saml_service_post_response.py index 7f619b40..ff3bac77 100644 --- a/zitadel_client/models/saml_service_post_response.py +++ b/zitadel_client/models/saml_service_post_response.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServicePostResponse(BaseModel): """ SAMLServicePostResponse - """ # noqa: E501 - relay_state: Optional[StrictStr] = Field(default=None, description="The SAML RelaySate, that needs to be returned to the application to match the response to the request.", alias="relayState") - saml_response: Optional[StrictStr] = Field(default=None, description="The SAML Response, that needs to be returned to the application to complete the SAML flow.", alias="samlResponse") - __properties: ClassVar[List[str]] = ["relayState", "samlResponse"] + """ + relay_state: Optional[StrictStr] = Field( + default=None, + alias="relayState", + description="The SAML RelaySate, that needs to be returned to the application to match the response to the request.", + ) + saml_response: Optional[StrictStr] = Field( + default=None, + alias="samlResponse", + description="The SAML Response, that needs to be returned to the application to complete the SAML flow.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class SAMLServicePostResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServicePostResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServicePostResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "relayState": obj.get("relayState"), - "samlResponse": obj.get("samlResponse") - }) - return _obj - - +SAMLServicePostResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_saml_request.py b/zitadel_client/models/saml_service_saml_request.py index 7df3fb55..2cdc484a 100644 --- a/zitadel_client/models/saml_service_saml_request.py +++ b/zitadel_client/models/saml_service_saml_request.py @@ -1,40 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceSAMLRequest(BaseModel): """ SAMLRequest contains information about a SAML authentication request. see: https://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID of the created SAMLRequest.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - issuer: Optional[StrictStr] = Field(default=None, description="SAML entityID of the application that created the SAMLRequest.") - assertion_consumer_service: Optional[StrictStr] = Field(default=None, description="URL which points back to the assertion consumer service of the application that created the SAMLRequest.", alias="assertionConsumerService") - relay_state: Optional[StrictStr] = Field(default=None, description="RelayState provided by the application for the request.", alias="relayState") - binding: Optional[StrictStr] = Field(default=None, description="Binding used by the application for the request.") - __properties: ClassVar[List[str]] = ["id", "creationDate", "issuer", "assertionConsumerService", "relayState", "binding"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="ID of the created SAMLRequest." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + issuer: Optional[StrictStr] = Field( + default=None, + alias="issuer", + description="SAML entityID of the application that created the SAMLRequest.", + ) + assertion_consumer_service: Optional[StrictStr] = Field( + default=None, + alias="assertionConsumerService", + description="URL which points back to the assertion consumer service of the application that created the SAMLRequest.", + ) + relay_state: Optional[StrictStr] = Field( + default=None, + alias="relayState", + description="RelayState provided by the application for the request.", + ) + binding: Optional[StrictStr] = Field( + default=None, + alias="binding", + description="Binding used by the application for the request.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +57,6 @@ class SAMLServiceSAMLRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceSAMLRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceSAMLRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "issuer": obj.get("issuer"), - "assertionConsumerService": obj.get("assertionConsumerService"), - "relayState": obj.get("relayState"), - "binding": obj.get("binding") - }) - return _obj - +from pydantic import AwareDatetime +SAMLServiceSAMLRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/saml_service_session.py b/zitadel_client/models/saml_service_session.py index 45835945..717b8686 100644 --- a/zitadel_client/models/saml_service_session.py +++ b/zitadel_client/models/saml_service_session.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SAMLServiceSession(BaseModel): """ SAMLServiceSession - """ # noqa: E501 - session_id: Optional[StrictStr] = Field(default=None, description="ID of the session, used to login the user. Connects the session to the SAML Request.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="Token to verify the session is valid.", alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + """ + session_id: Optional[StrictStr] = Field( + default=None, + alias="sessionId", + description="ID of the session, used to login the user. Connects the session to the SAML Request.", + ) + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="Token to verify the session is valid.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class SAMLServiceSession(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SAMLServiceSession from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SAMLServiceSession from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +SAMLServiceSession.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_any.py b/zitadel_client/models/session_service_any.py index 6729ae39..0459129e 100644 --- a/zitadel_client/models/session_service_any.py +++ b/zitadel_client/models/session_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class SessionServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +SessionServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_challenges.py b/zitadel_client/models/session_service_challenges.py index 44a4b1f1..21d9dd12 100644 --- a/zitadel_client/models/session_service_challenges.py +++ b/zitadel_client/models/session_service_challenges.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_web_auth_n import SessionServiceWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceChallenges(BaseModel): """ SessionServiceChallenges - """ # noqa: E501 + """ + web_auth_n: Optional[SessionServiceWebAuthN] = Field(default=None, alias="webAuthN") otp_sms: Optional[StrictStr] = Field(default=None, alias="otpSms") otp_email: Optional[StrictStr] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["webAuthN", "otpSms", "otpEmail"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,67 +32,6 @@ class SessionServiceChallenges(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceChallenges from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # set to None if otp_sms (nullable) is None - # and model_fields_set contains the field - if self.otp_sms is None and "otp_sms" in self.model_fields_set: - _dict['otpSms'] = None - - # set to None if otp_email (nullable) is None - # and model_fields_set contains the field - if self.otp_email is None and "otp_email" in self.model_fields_set: - _dict['otpEmail'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceChallenges from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webAuthN": SessionServiceWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "otpSms": obj.get("otpSms"), - "otpEmail": obj.get("otpEmail") - }) - return _obj - +from zitadel_client.models.session_service_web_auth_n import SessionServiceWebAuthN +SessionServiceChallenges.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_idp_intent.py b/zitadel_client/models/session_service_check_idp_intent.py index 62e4f85a..da5bd6a4 100644 --- a/zitadel_client/models/session_service_check_idp_intent.py +++ b/zitadel_client/models/session_service_check_idp_intent.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckIDPIntent(BaseModel): """ SessionServiceCheckIDPIntent - """ # noqa: E501 - idp_intent_id: Optional[StrictStr] = Field(default=None, description="The ID of the idp intent, previously returned on the success response of the IDP callback.", alias="idpIntentId") - idp_intent_token: Optional[StrictStr] = Field(default=None, description="The token of the idp intent, previously returned on the success response of the IDP callback.", alias="idpIntentToken") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken"] + """ + idp_intent_id: Optional[StrictStr] = Field( + default=None, + alias="idpIntentId", + description="The ID of the idp intent, previously returned on the success response of the IDP callback.", + ) + idp_intent_token: Optional[StrictStr] = Field( + default=None, + alias="idpIntentToken", + description="The token of the idp intent, previously returned on the success response of the IDP callback.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class SessionServiceCheckIDPIntent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckIDPIntent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckIDPIntent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken") - }) - return _obj - - +SessionServiceCheckIDPIntent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_otp.py b/zitadel_client/models/session_service_check_otp.py index 6e37a3d2..454398b5 100644 --- a/zitadel_client/models/session_service_check_otp.py +++ b/zitadel_client/models/session_service_check_otp.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckOTP(BaseModel): """ SessionServiceCheckOTP - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The One-Time Password sent over SMS or Email of the user to be checked.") - __properties: ClassVar[List[str]] = ["code"] + """ + code: Optional[StrictStr] = Field( + default=None, + alias="code", + description="The One-Time Password sent over SMS or Email of the user to be checked.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceCheckOTP(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckOTP from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckOTP from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code") - }) - return _obj - - +SessionServiceCheckOTP.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_password.py b/zitadel_client/models/session_service_check_password.py index 08aec5ca..5e1569ae 100644 --- a/zitadel_client/models/session_service_check_password.py +++ b/zitadel_client/models/session_service_check_password.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckPassword(BaseModel): """ SessionServiceCheckPassword - """ # noqa: E501 - password: Optional[StrictStr] = Field(default=None, description="The password of the user to be checked.") - __properties: ClassVar[List[str]] = ["password"] + """ + password: Optional[StrictStr] = Field( + default=None, + alias="password", + description="The password of the user to be checked.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceCheckPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password") - }) - return _obj - - +SessionServiceCheckPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_recovery_code.py b/zitadel_client/models/session_service_check_recovery_code.py index f49f52b0..0812ab7a 100644 --- a/zitadel_client/models/session_service_check_recovery_code.py +++ b/zitadel_client/models/session_service_check_recovery_code.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckRecoveryCode(BaseModel): """ SessionServiceCheckRecoveryCode - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The Recovery Code of the user to be checked. The code must match the exact code previously generated for the user, including dashes if any. On successful check, the recovery code will be invalidated and cannot be used again.") - __properties: ClassVar[List[str]] = ["code"] + """ + code: Optional[StrictStr] = Field( + default=None, + alias="code", + description="The Recovery Code of the user to be checked. The code must match the exact code previously generated for the user, including dashes if any. On successful check, the recovery code will be invalidated and cannot be used again.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceCheckRecoveryCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckRecoveryCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckRecoveryCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code") - }) - return _obj - - +SessionServiceCheckRecoveryCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_totp.py b/zitadel_client/models/session_service_check_totp.py index d9584acc..95cc3778 100644 --- a/zitadel_client/models/session_service_check_totp.py +++ b/zitadel_client/models/session_service_check_totp.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckTOTP(BaseModel): """ SessionServiceCheckTOTP - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The Time-based One-Time Password generated by the user's TOTP authenticator app.") - __properties: ClassVar[List[str]] = ["code"] + """ + code: Optional[StrictStr] = Field( + default=None, + alias="code", + description="The Time-based One-Time Password generated by the user's TOTP authenticator app.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceCheckTOTP(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckTOTP from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckTOTP from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code") - }) - return _obj - - +SessionServiceCheckTOTP.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_user.py b/zitadel_client/models/session_service_check_user.py index b21326a7..3c20c13b 100644 --- a/zitadel_client/models/session_service_check_user.py +++ b/zitadel_client/models/session_service_check_user.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCheckUser(BaseModel): """ SessionServiceCheckUser - """ # noqa: E501 - login_name: Optional[StrictStr] = Field(default=None, description="The login name of the user to be checked. It will search case insensitive. Note this only checks for the computed login name and not for any organization scoped usernames. Also note that it will not check for emails or phone numbers, even if the corresponding setting is enabled. Use the user service ListUsers method to find a user by email or phone number first to obtain the user ID or login name.", alias="loginName") - user_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user to be checked.", alias="userId") - __properties: ClassVar[List[str]] = ["loginName", "userId"] + """ + login_name: Optional[StrictStr] = Field( + default=None, + alias="loginName", + description="The login name of the user to be checked. It will search case insensitive. Note this only checks for the computed login name and not for any organization scoped usernames. Also note that it will not check for emails or phone numbers, even if the corresponding setting is enabled. Use the user service ListUsers method to find a user by email or phone number first to obtain the user ID or login name.", + ) + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="The unique identifier of the user to be checked.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class SessionServiceCheckUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "userId": obj.get("userId") - }) - return _obj - - +SessionServiceCheckUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_check_web_auth_n.py b/zitadel_client/models/session_service_check_web_auth_n.py index 105df4e6..881c7ce8 100644 --- a/zitadel_client/models/session_service_check_web_auth_n.py +++ b/zitadel_client/models/session_service_check_web_auth_n.py @@ -1,34 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Dict, Optional + class SessionServiceCheckWebAuthN(BaseModel): """ SessionServiceCheckWebAuthN - """ # noqa: E501 - credential_assertion_data: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="credentialAssertionData") - __properties: ClassVar[List[str]] = ["credentialAssertionData"] + """ + credential_assertion_data: Optional[Dict[str, object]] = Field( + default=None, + alias="credentialAssertionData", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +33,4 @@ class SessionServiceCheckWebAuthN(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCheckWebAuthN from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCheckWebAuthN from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "credentialAssertionData": obj.get("credentialAssertionData") - }) - return _obj - - +SessionServiceCheckWebAuthN.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_checks.py b/zitadel_client/models/session_service_checks.py index 1cb1a137..81d7fe8f 100644 --- a/zitadel_client/models/session_service_checks.py +++ b/zitadel_client/models/session_service_checks.py @@ -1,48 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_check_idp_intent import SessionServiceCheckIDPIntent -from zitadel_client.models.session_service_check_otp import SessionServiceCheckOTP -from zitadel_client.models.session_service_check_password import SessionServiceCheckPassword -from zitadel_client.models.session_service_check_recovery_code import SessionServiceCheckRecoveryCode -from zitadel_client.models.session_service_check_totp import SessionServiceCheckTOTP -from zitadel_client.models.session_service_check_user import SessionServiceCheckUser -from zitadel_client.models.session_service_check_web_auth_n import SessionServiceCheckWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceChecks(BaseModel): """ SessionServiceChecks - """ # noqa: E501 - user: Optional[SessionServiceCheckUser] = None - password: Optional[SessionServiceCheckPassword] = None - web_auth_n: Optional[SessionServiceCheckWebAuthN] = Field(default=None, alias="webAuthN") - idp_intent: Optional[SessionServiceCheckIDPIntent] = Field(default=None, alias="idpIntent") - totp: Optional[SessionServiceCheckTOTP] = None + """ + + user: Optional[SessionServiceCheckUser] = Field(default=None, alias="user") + password: Optional[SessionServiceCheckPassword] = Field( + default=None, alias="password" + ) + web_auth_n: Optional[SessionServiceCheckWebAuthN] = Field( + default=None, alias="webAuthN" + ) + idp_intent: Optional[SessionServiceCheckIDPIntent] = Field( + default=None, alias="idpIntent" + ) + totp: Optional[SessionServiceCheckTOTP] = Field(default=None, alias="totp") otp_sms: Optional[SessionServiceCheckOTP] = Field(default=None, alias="otpSms") otp_email: Optional[SessionServiceCheckOTP] = Field(default=None, alias="otpEmail") - recovery_code: Optional[SessionServiceCheckRecoveryCode] = Field(default=None, alias="recoveryCode") - __properties: ClassVar[List[str]] = ["user", "password", "webAuthN", "idpIntent", "totp", "otpSms", "otpEmail", "recoveryCode"] + recovery_code: Optional[SessionServiceCheckRecoveryCode] = Field( + default=None, alias="recoveryCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,83 +44,20 @@ class SessionServiceChecks(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceChecks from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_intent - if self.idp_intent: - _dict['idpIntent'] = self.idp_intent.to_dict() - # override the default output from pydantic by calling `to_dict()` of totp - if self.totp: - _dict['totp'] = self.totp.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - # override the default output from pydantic by calling `to_dict()` of recovery_code - if self.recovery_code: - _dict['recoveryCode'] = self.recovery_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceChecks from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "user": SessionServiceCheckUser.from_dict(obj["user"]) if obj.get("user") is not None else None, - "password": SessionServiceCheckPassword.from_dict(obj["password"]) if obj.get("password") is not None else None, - "webAuthN": SessionServiceCheckWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "idpIntent": SessionServiceCheckIDPIntent.from_dict(obj["idpIntent"]) if obj.get("idpIntent") is not None else None, - "totp": SessionServiceCheckTOTP.from_dict(obj["totp"]) if obj.get("totp") is not None else None, - "otpSms": SessionServiceCheckOTP.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": SessionServiceCheckOTP.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None, - "recoveryCode": SessionServiceCheckRecoveryCode.from_dict(obj["recoveryCode"]) if obj.get("recoveryCode") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_check_idp_intent import ( + SessionServiceCheckIDPIntent, +) +from zitadel_client.models.session_service_check_otp import SessionServiceCheckOTP +from zitadel_client.models.session_service_check_password import ( + SessionServiceCheckPassword, +) +from zitadel_client.models.session_service_check_recovery_code import ( + SessionServiceCheckRecoveryCode, +) +from zitadel_client.models.session_service_check_totp import SessionServiceCheckTOTP +from zitadel_client.models.session_service_check_user import SessionServiceCheckUser +from zitadel_client.models.session_service_check_web_auth_n import ( + SessionServiceCheckWebAuthN, +) +SessionServiceChecks.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_connect_error.py b/zitadel_client/models/session_service_connect_error.py index f515c7e2..0e6e4be2 100644 --- a/zitadel_client/models/session_service_connect_error.py +++ b/zitadel_client/models/session_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.session_service_any import SessionServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class SessionServiceConnectErrorCodeEnum(str, Enum): + """SessionServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class SessionServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[SessionServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[SessionServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[SessionServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [SessionServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.session_service_any import SessionServiceAny +SessionServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_create_session_request.py b/zitadel_client/models/session_service_create_session_request.py index cbad96e2..60c7fa77 100644 --- a/zitadel_client/models/session_service_create_session_request.py +++ b/zitadel_client/models/session_service_create_session_request.py @@ -1,41 +1,43 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.session_service_checks import SessionServiceChecks -from zitadel_client.models.session_service_request_challenges import SessionServiceRequestChallenges -from zitadel_client.models.session_service_user_agent import SessionServiceUserAgent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Dict, Optional + class SessionServiceCreateSessionRequest(BaseModel): """ SessionServiceCreateSessionRequest - """ # noqa: E501 - checks: Optional[SessionServiceChecks] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = Field(default=None, description="Custom key value list to be stored on the session.") - challenges: Optional[SessionServiceRequestChallenges] = None - user_agent: Optional[SessionServiceUserAgent] = Field(default=None, alias="userAgent") - lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - __properties: ClassVar[List[str]] = ["checks", "metadata", "challenges", "userAgent", "lifetime"] + """ + + checks: Optional[SessionServiceChecks] = Field(default=None, alias="checks") + metadata: Optional[Dict[str, Base64Bytes]] = Field( + default=None, + alias="metadata", + description="Custom key value list to be stored on the session.", + ) + challenges: Optional[SessionServiceRequestChallenges] = Field( + default=None, alias="challenges" + ) + user_agent: Optional[SessionServiceUserAgent] = Field( + default=None, alias="userAgent" + ) + lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="lifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,65 +45,12 @@ class SessionServiceCreateSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCreateSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checks - if self.checks: - _dict['checks'] = self.checks.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_agent - if self.user_agent: - _dict['userAgent'] = self.user_agent.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCreateSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "checks": SessionServiceChecks.from_dict(obj["checks"]) if obj.get("checks") is not None else None, - "metadata": obj.get("metadata"), - "challenges": SessionServiceRequestChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None, - "userAgent": SessionServiceUserAgent.from_dict(obj["userAgent"]) if obj.get("userAgent") is not None else None, - "lifetime": obj.get("lifetime") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.session_service_checks import SessionServiceChecks +from zitadel_client.models.session_service_request_challenges import ( + SessionServiceRequestChallenges, +) +from zitadel_client.models.session_service_user_agent import SessionServiceUserAgent +SessionServiceCreateSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_create_session_response.py b/zitadel_client/models/session_service_create_session_response.py index 1ef54d3d..f75a0e74 100644 --- a/zitadel_client/models/session_service_create_session_response.py +++ b/zitadel_client/models/session_service_create_session_response.py @@ -1,39 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_challenges import SessionServiceChallenges -from zitadel_client.models.session_service_details import SessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCreateSessionResponse(BaseModel): """ SessionServiceCreateSessionResponse - """ # noqa: E501 - details: Optional[SessionServiceDetails] = None - session_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the session.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs.", alias="sessionToken") - challenges: Optional[SessionServiceChallenges] = None - __properties: ClassVar[List[str]] = ["details", "sessionId", "sessionToken", "challenges"] + """ + + details: Optional[SessionServiceDetails] = Field(default=None, alias="details") + session_id: Optional[StrictStr] = Field( + default=None, alias="sessionId", description="Unique identifier of the session." + ) + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs.", + ) + challenges: Optional[SessionServiceChallenges] = Field( + default=None, alias="challenges" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,61 +41,7 @@ class SessionServiceCreateSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCreateSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCreateSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken"), - "challenges": SessionServiceChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_challenges import SessionServiceChallenges +from zitadel_client.models.session_service_details import SessionServiceDetails +SessionServiceCreateSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_creation_date_query.py b/zitadel_client/models/session_service_creation_date_query.py index ee14c67b..f05c9df0 100644 --- a/zitadel_client/models/session_service_creation_date_query.py +++ b/zitadel_client/models/session_service_creation_date_query.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_timestamp_query_method import SessionServiceTimestampQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceCreationDateQuery(BaseModel): """ SessionServiceCreationDateQuery - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - method: Optional[SessionServiceTimestampQueryMethod] = None - __properties: ClassVar[List[str]] = ["creationDate", "method"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[SessionServiceTimestampQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class SessionServiceCreationDateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCreationDateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCreationDateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.session_service_timestamp_query_method import ( + SessionServiceTimestampQueryMethod, +) +SessionServiceCreationDateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_creator_query.py b/zitadel_client/models/session_service_creator_query.py index 562a2d10..9b91b1ab 100644 --- a/zitadel_client/models/session_service_creator_query.py +++ b/zitadel_client/models/session_service_creator_query.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceCreatorQuery(BaseModel): """ SessionServiceCreatorQuery - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID of the user who created the session. If empty, the calling user's ID is used.") - __properties: ClassVar[List[str]] = ["id"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID of the user who created the session. If empty, the calling user's ID is used.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class SessionServiceCreatorQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceCreatorQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if id (nullable) is None - # and model_fields_set contains the field - if self.id is None and "id" in self.model_fields_set: - _dict['id'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceCreatorQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +SessionServiceCreatorQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_delete_session_request.py b/zitadel_client/models/session_service_delete_session_request.py index 8296f0ee..58f9290d 100644 --- a/zitadel_client/models/session_service_delete_session_request.py +++ b/zitadel_client/models/session_service_delete_session_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceDeleteSessionRequest(BaseModel): """ SessionServiceDeleteSessionRequest - """ # noqa: E501 - session_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the session to be terminated.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.delete permission on either the instance or on the checked user's organization", alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + """ + session_id: Optional[StrictStr] = Field( + default=None, + alias="sessionId", + description="The unique identifier of the session to be terminated.", + ) + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.delete permission on either the instance or on the checked user's organization", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +39,4 @@ class SessionServiceDeleteSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceDeleteSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if session_token (nullable) is None - # and model_fields_set contains the field - if self.session_token is None and "session_token" in self.model_fields_set: - _dict['sessionToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceDeleteSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +SessionServiceDeleteSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_delete_session_response.py b/zitadel_client/models/session_service_delete_session_response.py index 5b2cbdbe..ceb72fec 100644 --- a/zitadel_client/models/session_service_delete_session_response.py +++ b/zitadel_client/models/session_service_delete_session_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_details import SessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SessionServiceDeleteSessionResponse(BaseModel): """ SessionServiceDeleteSessionResponse - """ # noqa: E501 - details: Optional[SessionServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[SessionServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class SessionServiceDeleteSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceDeleteSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceDeleteSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_details import SessionServiceDetails +SessionServiceDeleteSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_details.py b/zitadel_client/models/session_service_details.py index 68b708c9..d2cdea58 100644 --- a/zitadel_client/models/session_service_details.py +++ b/zitadel_client/models/session_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceDetails(BaseModel): """ SessionServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class SessionServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_expiration_date_query.py b/zitadel_client/models/session_service_expiration_date_query.py index 2c9accc3..ff3cea5a 100644 --- a/zitadel_client/models/session_service_expiration_date_query.py +++ b/zitadel_client/models/session_service_expiration_date_query.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_timestamp_query_method import SessionServiceTimestampQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceExpirationDateQuery(BaseModel): """ SessionServiceExpirationDateQuery - """ # noqa: E501 - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - method: Optional[SessionServiceTimestampQueryMethod] = None - __properties: ClassVar[List[str]] = ["expirationDate", "method"] + """ + + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[SessionServiceTimestampQueryMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class SessionServiceExpirationDateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceExpirationDateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceExpirationDateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "expirationDate": obj.get("expirationDate"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.session_service_timestamp_query_method import ( + SessionServiceTimestampQueryMethod, +) +SessionServiceExpirationDateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_factors.py b/zitadel_client/models/session_service_factors.py index d715ddff..f9fed781 100644 --- a/zitadel_client/models/session_service_factors.py +++ b/zitadel_client/models/session_service_factors.py @@ -1,48 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_intent_factor import SessionServiceIntentFactor -from zitadel_client.models.session_service_otp_factor import SessionServiceOTPFactor -from zitadel_client.models.session_service_password_factor import SessionServicePasswordFactor -from zitadel_client.models.session_service_recovery_code_factor import SessionServiceRecoveryCodeFactor -from zitadel_client.models.session_service_totp_factor import SessionServiceTOTPFactor -from zitadel_client.models.session_service_user_factor import SessionServiceUserFactor -from zitadel_client.models.session_service_web_auth_n_factor import SessionServiceWebAuthNFactor -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceFactors(BaseModel): """ SessionServiceFactors - """ # noqa: E501 - user: Optional[SessionServiceUserFactor] = None - password: Optional[SessionServicePasswordFactor] = None - web_auth_n: Optional[SessionServiceWebAuthNFactor] = Field(default=None, alias="webAuthN") - intent: Optional[SessionServiceIntentFactor] = None - totp: Optional[SessionServiceTOTPFactor] = None + """ + + user: Optional[SessionServiceUserFactor] = Field(default=None, alias="user") + password: Optional[SessionServicePasswordFactor] = Field( + default=None, alias="password" + ) + web_auth_n: Optional[SessionServiceWebAuthNFactor] = Field( + default=None, alias="webAuthN" + ) + intent: Optional[SessionServiceIntentFactor] = Field(default=None, alias="intent") + totp: Optional[SessionServiceTOTPFactor] = Field(default=None, alias="totp") otp_sms: Optional[SessionServiceOTPFactor] = Field(default=None, alias="otpSms") otp_email: Optional[SessionServiceOTPFactor] = Field(default=None, alias="otpEmail") - recovery_code: Optional[SessionServiceRecoveryCodeFactor] = Field(default=None, alias="recoveryCode") - __properties: ClassVar[List[str]] = ["user", "password", "webAuthN", "intent", "totp", "otpSms", "otpEmail", "recoveryCode"] + recovery_code: Optional[SessionServiceRecoveryCodeFactor] = Field( + default=None, alias="recoveryCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -50,83 +42,20 @@ class SessionServiceFactors(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceFactors from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of intent - if self.intent: - _dict['intent'] = self.intent.to_dict() - # override the default output from pydantic by calling `to_dict()` of totp - if self.totp: - _dict['totp'] = self.totp.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - # override the default output from pydantic by calling `to_dict()` of recovery_code - if self.recovery_code: - _dict['recoveryCode'] = self.recovery_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceFactors from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "user": SessionServiceUserFactor.from_dict(obj["user"]) if obj.get("user") is not None else None, - "password": SessionServicePasswordFactor.from_dict(obj["password"]) if obj.get("password") is not None else None, - "webAuthN": SessionServiceWebAuthNFactor.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "intent": SessionServiceIntentFactor.from_dict(obj["intent"]) if obj.get("intent") is not None else None, - "totp": SessionServiceTOTPFactor.from_dict(obj["totp"]) if obj.get("totp") is not None else None, - "otpSms": SessionServiceOTPFactor.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": SessionServiceOTPFactor.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None, - "recoveryCode": SessionServiceRecoveryCodeFactor.from_dict(obj["recoveryCode"]) if obj.get("recoveryCode") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_intent_factor import ( + SessionServiceIntentFactor, +) +from zitadel_client.models.session_service_otp_factor import SessionServiceOTPFactor +from zitadel_client.models.session_service_password_factor import ( + SessionServicePasswordFactor, +) +from zitadel_client.models.session_service_recovery_code_factor import ( + SessionServiceRecoveryCodeFactor, +) +from zitadel_client.models.session_service_totp_factor import SessionServiceTOTPFactor +from zitadel_client.models.session_service_user_factor import SessionServiceUserFactor +from zitadel_client.models.session_service_web_auth_n_factor import ( + SessionServiceWebAuthNFactor, +) +SessionServiceFactors.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_get_session_request.py b/zitadel_client/models/session_service_get_session_request.py index 6bce4099..d5061d66 100644 --- a/zitadel_client/models/session_service_get_session_request.py +++ b/zitadel_client/models/session_service_get_session_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceGetSessionRequest(BaseModel): """ SessionServiceGetSessionRequest - """ # noqa: E501 - session_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the session to be retrieved.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization", alias="sessionToken") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken"] + """ + session_id: Optional[StrictStr] = Field( + default=None, + alias="sessionId", + description="The unique identifier of the session to be retrieved.", + ) + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met: - the caller created the session - the authenticated user requests their own session (checked user) - the security token provided in the authorization header has the same user agent as the session - the caller is granted the permission session.read permission on either the instance or on the checked user's organization", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +39,4 @@ class SessionServiceGetSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceGetSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if session_token (nullable) is None - # and model_fields_set contains the field - if self.session_token is None and "session_token" in self.model_fields_set: - _dict['sessionToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceGetSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken") - }) - return _obj - - +SessionServiceGetSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_get_session_response.py b/zitadel_client/models/session_service_get_session_response.py index 48637ef0..532cab6c 100644 --- a/zitadel_client/models/session_service_get_session_response.py +++ b/zitadel_client/models/session_service_get_session_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_session import SessionServiceSession -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SessionServiceGetSessionResponse(BaseModel): """ SessionServiceGetSessionResponse - """ # noqa: E501 - session: Optional[SessionServiceSession] = None - __properties: ClassVar[List[str]] = ["session"] + """ + session: Optional[SessionServiceSession] = Field(default=None, alias="session") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class SessionServiceGetSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceGetSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of session - if self.session: - _dict['session'] = self.session.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceGetSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "session": SessionServiceSession.from_dict(obj["session"]) if obj.get("session") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_session import SessionServiceSession +SessionServiceGetSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_header_values.py b/zitadel_client/models/session_service_header_values.py index 7c8cb622..8ccdb618 100644 --- a/zitadel_client/models/session_service_header_values.py +++ b/zitadel_client/models/session_service_header_values.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class SessionServiceHeaderValues(BaseModel): """ A header may have multiple values. In Go, headers are defined as map[string][]string, but protobuf doesn't allow this scheme. - """ # noqa: E501 - values: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["values"] + """ + + values: Optional[List[StrictStr]] = Field(default=None, alias="values") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class SessionServiceHeaderValues(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceHeaderValues from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceHeaderValues from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "values": obj.get("values") - }) - return _obj - - +SessionServiceHeaderValues.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_ids_query.py b/zitadel_client/models/session_service_ids_query.py index 3146b420..076641f4 100644 --- a/zitadel_client/models/session_service_ids_query.py +++ b/zitadel_client/models/session_service_ids_query.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class SessionServiceIDsQuery(BaseModel): """ SessionServiceIDsQuery - """ # noqa: E501 - ids: Optional[List[StrictStr]] = Field(default=None, description="List of session IDs to search for. If multiple IDs are provided, sessions matching any of the IDs will be returned.") - __properties: ClassVar[List[str]] = ["ids"] + """ + ids: Optional[List[StrictStr]] = Field( + default=None, + alias="ids", + description="List of session IDs to search for. If multiple IDs are provided, sessions matching any of the IDs will be returned.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceIDsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceIDsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceIDsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ids": obj.get("ids") - }) - return _obj - - +SessionServiceIDsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_intent_factor.py b/zitadel_client/models/session_service_intent_factor.py index ebcf85ed..6a6e8629 100644 --- a/zitadel_client/models/session_service_intent_factor.py +++ b/zitadel_client/models/session_service_intent_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceIntentFactor(BaseModel): """ SessionServiceIntentFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class SessionServiceIntentFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceIntentFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceIntentFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceIntentFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_list_details.py b/zitadel_client/models/session_service_list_details.py index 75e23ace..acd9d4e6 100644 --- a/zitadel_client/models/session_service_list_details.py +++ b/zitadel_client/models/session_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceListDetails(BaseModel): """ SessionServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class SessionServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_list_query.py b/zitadel_client/models/session_service_list_query.py index 6a79c932..1e1c68f3 100644 --- a/zitadel_client/models/session_service_list_query.py +++ b/zitadel_client/models/session_service_list_query.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class SessionServiceListQuery(BaseModel): """ SessionServiceListQuery - """ # noqa: E501 - offset: Optional[Any] = None - limit: Optional[StrictInt] = None - asc: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field(default=None, alias="offset") + limit: Optional[StrictInt] = Field(default=None, alias="limit") + asc: Optional[StrictBool] = Field(default=None, alias="asc") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +32,4 @@ class SessionServiceListQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceListQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceListQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +SessionServiceListQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_list_sessions_request.py b/zitadel_client/models/session_service_list_sessions_request.py index 9bb71db6..eaee2211 100644 --- a/zitadel_client/models/session_service_list_sessions_request.py +++ b/zitadel_client/models/session_service_list_sessions_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.session_service_list_query import SessionServiceListQuery -from zitadel_client.models.session_service_search_query import SessionServiceSearchQuery -from zitadel_client.models.session_service_session_field_name import SessionServiceSessionFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class SessionServiceListSessionsRequest(BaseModel): """ SessionServiceListSessionsRequest - """ # noqa: E501 - query: Optional[SessionServiceListQuery] = None - queries: Optional[List[SessionServiceSearchQuery]] = Field(default=None, description="The criteria to be used when searching for sessions. Multiple queries will be combined with a logical AND.") - sorting_column: Optional[SessionServiceSessionFieldName] = Field(default=None, alias="sortingColumn") - __properties: ClassVar[List[str]] = ["query", "queries", "sortingColumn"] + """ + + query: Optional[SessionServiceListQuery] = Field(default=None, alias="query") + queries: Optional[List[SessionServiceSearchQuery]] = Field( + default=None, + alias="queries", + description="The criteria to be used when searching for sessions. Multiple queries will be combined with a logical AND.", + ) + sorting_column: Optional[SessionServiceSessionFieldName] = Field( + default=None, alias="sortingColumn" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,10 @@ class SessionServiceListSessionsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceListSessionsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceListSessionsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": SessionServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None, - "queries": [SessionServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None, - "sortingColumn": obj.get("sortingColumn") - }) - return _obj - +from zitadel_client.models.session_service_list_query import SessionServiceListQuery +from zitadel_client.models.session_service_search_query import SessionServiceSearchQuery +from zitadel_client.models.session_service_session_field_name import ( + SessionServiceSessionFieldName, +) +SessionServiceListSessionsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_list_sessions_response.py b/zitadel_client/models/session_service_list_sessions_response.py index 38137546..1e290ca6 100644 --- a/zitadel_client/models/session_service_list_sessions_response.py +++ b/zitadel_client/models/session_service_list_sessions_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.session_service_list_details import SessionServiceListDetails -from zitadel_client.models.session_service_session import SessionServiceSession -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class SessionServiceListSessionsResponse(BaseModel): """ SessionServiceListSessionsResponse - """ # noqa: E501 - details: Optional[SessionServiceListDetails] = None - sessions: Optional[List[SessionServiceSession]] = Field(default=None, description="The sessions matching the search query. There might be more sessions available than returned in this response. Use the details field to see if there are more sessions available and to get the total count of sessions matching the query.") - __properties: ClassVar[List[str]] = ["details", "sessions"] + """ + details: Optional[SessionServiceListDetails] = Field(default=None, alias="details") + sessions: Optional[List[SessionServiceSession]] = Field( + default=None, + alias="sessions", + description="The sessions matching the search query. There might be more sessions available than returned in this response. Use the details field to see if there are more sessions available and to get the total count of sessions matching the query.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,7 @@ class SessionServiceListSessionsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceListSessionsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in sessions (list) - _items = [] - if self.sessions: - for _item_sessions in self.sessions: - if _item_sessions: - _items.append(_item_sessions.to_dict()) - _dict['sessions'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceListSessionsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SessionServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessions": [SessionServiceSession.from_dict(_item) for _item in obj["sessions"]] if obj.get("sessions") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_list_details import SessionServiceListDetails +from zitadel_client.models.session_service_session import SessionServiceSession +SessionServiceListSessionsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_otp_email.py b/zitadel_client/models/session_service_otp_email.py index 75d20ec4..1f9aee32 100644 --- a/zitadel_client/models/session_service_otp_email.py +++ b/zitadel_client/models/session_service_otp_email.py @@ -1,36 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_send_code import SessionServiceSendCode -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceOTPEmail(BaseModel): """ SessionServiceOTPEmail - """ # noqa: E501 - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") + """ + + return_code: Optional[object] = Field(default=None, alias="returnCode") send_code: Optional[SessionServiceSendCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["returnCode", "sendCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +30,6 @@ class SessionServiceOTPEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceOTPEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceOTPEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "returnCode": obj.get("returnCode"), - "sendCode": SessionServiceSendCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_send_code import SessionServiceSendCode +SessionServiceOTPEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_otp_factor.py b/zitadel_client/models/session_service_otp_factor.py index 9d3da5b7..da57d053 100644 --- a/zitadel_client/models/session_service_otp_factor.py +++ b/zitadel_client/models/session_service_otp_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceOTPFactor(BaseModel): """ SessionServiceOTPFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class SessionServiceOTPFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceOTPFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceOTPFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceOTPFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_otpsms.py b/zitadel_client/models/session_service_otpsms.py index ab0e7733..85db10e1 100644 --- a/zitadel_client/models/session_service_otpsms.py +++ b/zitadel_client/models/session_service_otpsms.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SessionServiceOTPSMS(BaseModel): """ SessionServiceOTPSMS - """ # noqa: E501 - return_code: Optional[StrictBool] = Field(default=None, description="Request the code to be returned instead of sending an SMS. This is useful for testing or in case you want to send the code yourself.", alias="returnCode") - __properties: ClassVar[List[str]] = ["returnCode"] + """ + return_code: Optional[StrictBool] = Field( + default=None, + alias="returnCode", + description="Request the code to be returned instead of sending an SMS. This is useful for testing or in case you want to send the code yourself.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceOTPSMS(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceOTPSMS from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceOTPSMS from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "returnCode": obj.get("returnCode") - }) - return _obj - - +SessionServiceOTPSMS.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_password_factor.py b/zitadel_client/models/session_service_password_factor.py index 4d976344..0fb3b988 100644 --- a/zitadel_client/models/session_service_password_factor.py +++ b/zitadel_client/models/session_service_password_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServicePasswordFactor(BaseModel): """ SessionServicePasswordFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class SessionServicePasswordFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServicePasswordFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServicePasswordFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +SessionServicePasswordFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_recovery_code_factor.py b/zitadel_client/models/session_service_recovery_code_factor.py index 4123d382..b1cea64f 100644 --- a/zitadel_client/models/session_service_recovery_code_factor.py +++ b/zitadel_client/models/session_service_recovery_code_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceRecoveryCodeFactor(BaseModel): """ SessionServiceRecoveryCodeFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class SessionServiceRecoveryCodeFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceRecoveryCodeFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceRecoveryCodeFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceRecoveryCodeFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_request_challenges.py b/zitadel_client/models/session_service_request_challenges.py index 73abdb00..cb9ecf4d 100644 --- a/zitadel_client/models/session_service_request_challenges.py +++ b/zitadel_client/models/session_service_request_challenges.py @@ -1,39 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_otp_email import SessionServiceOTPEmail -from zitadel_client.models.session_service_otpsms import SessionServiceOTPSMS -from zitadel_client.models.session_service_web_auth_n import SessionServiceWebAuthN -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceRequestChallenges(BaseModel): """ SessionServiceRequestChallenges - """ # noqa: E501 + """ + web_auth_n: Optional[SessionServiceWebAuthN] = Field(default=None, alias="webAuthN") otp_sms: Optional[SessionServiceOTPSMS] = Field(default=None, alias="otpSms") otp_email: Optional[SessionServiceOTPEmail] = Field(default=None, alias="otpEmail") - __properties: ClassVar[List[str]] = ["webAuthN", "otpSms", "otpEmail"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,63 +31,8 @@ class SessionServiceRequestChallenges(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceRequestChallenges from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of web_auth_n - if self.web_auth_n: - _dict['webAuthN'] = self.web_auth_n.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_sms - if self.otp_sms: - _dict['otpSms'] = self.otp_sms.to_dict() - # override the default output from pydantic by calling `to_dict()` of otp_email - if self.otp_email: - _dict['otpEmail'] = self.otp_email.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceRequestChallenges from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webAuthN": SessionServiceWebAuthN.from_dict(obj["webAuthN"]) if obj.get("webAuthN") is not None else None, - "otpSms": SessionServiceOTPSMS.from_dict(obj["otpSms"]) if obj.get("otpSms") is not None else None, - "otpEmail": SessionServiceOTPEmail.from_dict(obj["otpEmail"]) if obj.get("otpEmail") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_otp_email import SessionServiceOTPEmail +from zitadel_client.models.session_service_otpsms import SessionServiceOTPSMS +from zitadel_client.models.session_service_web_auth_n import SessionServiceWebAuthN +SessionServiceRequestChallenges.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_search_query.py b/zitadel_client/models/session_service_search_query.py index aec30e30..89c52f50 100644 --- a/zitadel_client/models/session_service_search_query.py +++ b/zitadel_client/models/session_service_search_query.py @@ -1,45 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_creation_date_query import SessionServiceCreationDateQuery -from zitadel_client.models.session_service_creator_query import SessionServiceCreatorQuery -from zitadel_client.models.session_service_expiration_date_query import SessionServiceExpirationDateQuery -from zitadel_client.models.session_service_ids_query import SessionServiceIDsQuery -from zitadel_client.models.session_service_user_agent_query import SessionServiceUserAgentQuery -from zitadel_client.models.session_service_user_id_query import SessionServiceUserIDQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceSearchQuery(BaseModel): """ SessionServiceSearchQuery - """ # noqa: E501 - creation_date_query: Optional[SessionServiceCreationDateQuery] = Field(default=None, alias="creationDateQuery") - creator_query: Optional[SessionServiceCreatorQuery] = Field(default=None, alias="creatorQuery") - expiration_date_query: Optional[SessionServiceExpirationDateQuery] = Field(default=None, alias="expirationDateQuery") + """ + + creation_date_query: Optional[SessionServiceCreationDateQuery] = Field( + default=None, alias="creationDateQuery" + ) + creator_query: Optional[SessionServiceCreatorQuery] = Field( + default=None, alias="creatorQuery" + ) + expiration_date_query: Optional[SessionServiceExpirationDateQuery] = Field( + default=None, alias="expirationDateQuery" + ) ids_query: Optional[SessionServiceIDsQuery] = Field(default=None, alias="idsQuery") - user_agent_query: Optional[SessionServiceUserAgentQuery] = Field(default=None, alias="userAgentQuery") - user_id_query: Optional[SessionServiceUserIDQuery] = Field(default=None, alias="userIdQuery") - __properties: ClassVar[List[str]] = ["creationDateQuery", "creatorQuery", "expirationDateQuery", "idsQuery", "userAgentQuery", "userIdQuery"] + user_agent_query: Optional[SessionServiceUserAgentQuery] = Field( + default=None, alias="userAgentQuery" + ) + user_id_query: Optional[SessionServiceUserIDQuery] = Field( + default=None, alias="userIdQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,75 +44,21 @@ class SessionServiceSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of creation_date_query - if self.creation_date_query: - _dict['creationDateQuery'] = self.creation_date_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of creator_query - if self.creator_query: - _dict['creatorQuery'] = self.creator_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of expiration_date_query - if self.expiration_date_query: - _dict['expirationDateQuery'] = self.expiration_date_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of ids_query - if self.ids_query: - _dict['idsQuery'] = self.ids_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_agent_query - if self.user_agent_query: - _dict['userAgentQuery'] = self.user_agent_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_id_query - if self.user_id_query: - _dict['userIdQuery'] = self.user_id_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDateQuery": SessionServiceCreationDateQuery.from_dict(obj["creationDateQuery"]) if obj.get("creationDateQuery") is not None else None, - "creatorQuery": SessionServiceCreatorQuery.from_dict(obj["creatorQuery"]) if obj.get("creatorQuery") is not None else None, - "expirationDateQuery": SessionServiceExpirationDateQuery.from_dict(obj["expirationDateQuery"]) if obj.get("expirationDateQuery") is not None else None, - "idsQuery": SessionServiceIDsQuery.from_dict(obj["idsQuery"]) if obj.get("idsQuery") is not None else None, - "userAgentQuery": SessionServiceUserAgentQuery.from_dict(obj["userAgentQuery"]) if obj.get("userAgentQuery") is not None else None, - "userIdQuery": SessionServiceUserIDQuery.from_dict(obj["userIdQuery"]) if obj.get("userIdQuery") is not None else None - }) - return _obj - - +from zitadel_client.models.session_service_creation_date_query import ( + SessionServiceCreationDateQuery, +) +from zitadel_client.models.session_service_creator_query import ( + SessionServiceCreatorQuery, +) +from zitadel_client.models.session_service_expiration_date_query import ( + SessionServiceExpirationDateQuery, +) +from zitadel_client.models.session_service_ids_query import SessionServiceIDsQuery +from zitadel_client.models.session_service_user_agent_query import ( + SessionServiceUserAgentQuery, +) +from zitadel_client.models.session_service_user_id_query import ( + SessionServiceUserIDQuery, +) + +SessionServiceSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_send_code.py b/zitadel_client/models/session_service_send_code.py index b3ea5699..00293803 100644 --- a/zitadel_client/models/session_service_send_code.py +++ b/zitadel_client/models/session_service_send_code.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceSendCode(BaseModel): """ SessionServiceSendCode - """ # noqa: E501 - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: Code, UserID, LoginName, DisplayName, PreferredLanguage, SessionID", alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + """ + + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: Code, UserID, LoginName, DisplayName, PreferredLanguage, SessionID", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class SessionServiceSendCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceSendCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceSendCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +SessionServiceSendCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_session.py b/zitadel_client/models/session_service_session.py index 44b92807..0b8f6598 100644 --- a/zitadel_client/models/session_service_session.py +++ b/zitadel_client/models/session_service_session.py @@ -1,44 +1,59 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.session_service_factors import SessionServiceFactors -from zitadel_client.models.session_service_user_agent import SessionServiceUserAgent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class SessionServiceSession(BaseModel): """ SessionServiceSession - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the session.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - sequence: Optional[Any] = Field(default=None, description="The sequence of the session represents the change sequence of the session.") - factors: Optional[SessionServiceFactors] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = Field(default=None, description="Metadata contains custom key value pairs set by the user. The metadata is not interpreted by ZITADEL and can be used to store any information relevant to the session.") - user_agent: Optional[SessionServiceUserAgent] = Field(default=None, alias="userAgent") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "sequence", "factors", "metadata", "userAgent", "expirationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, alias="id", description="Unique identifier of the session." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="The sequence of the session represents the change sequence of the session.", + ) + factors: Optional[SessionServiceFactors] = Field(default=None, alias="factors") + metadata: Optional[Dict[str, Base64Bytes]] = Field( + default=None, + alias="metadata", + description="Metadata contains custom key value pairs set by the user. The metadata is not interpreted by ZITADEL and can be used to store any information relevant to the session.", + ) + user_agent: Optional[SessionServiceUserAgent] = Field( + default=None, alias="userAgent" + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,70 +61,9 @@ class SessionServiceSession(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceSession from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of factors - if self.factors: - _dict['factors'] = self.factors.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_agent - if self.user_agent: - _dict['userAgent'] = self.user_agent.to_dict() - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceSession from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "sequence": obj.get("sequence"), - "factors": SessionServiceFactors.from_dict(obj["factors"]) if obj.get("factors") is not None else None, - "metadata": obj.get("metadata"), - "userAgent": SessionServiceUserAgent.from_dict(obj["userAgent"]) if obj.get("userAgent") is not None else None, - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +from zitadel_client.models.session_service_factors import SessionServiceFactors +from zitadel_client.models.session_service_user_agent import SessionServiceUserAgent +SessionServiceSession.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_session_field_name.py b/zitadel_client/models/session_service_session_field_name.py index 786111f3..89da54f3 100644 --- a/zitadel_client/models/session_service_session_field_name.py +++ b/zitadel_client/models/session_service_session_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SessionServiceSessionFieldName(str, Enum): @@ -23,15 +13,5 @@ class SessionServiceSessionFieldName(str, Enum): SessionServiceSessionFieldName """ - """ - allowed enum values - """ - SESSION_FIELD_NAME_UNSPECIFIED = 'SESSION_FIELD_NAME_UNSPECIFIED' - SESSION_FIELD_NAME_CREATION_DATE = 'SESSION_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SessionServiceSessionFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + SESSION_FIELD_NAME_UNSPECIFIED = "SESSION_FIELD_NAME_UNSPECIFIED" + SESSION_FIELD_NAME_CREATION_DATE = "SESSION_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/session_service_set_session_request.py b/zitadel_client/models/session_service_set_session_request.py index 72548e8a..14730b85 100644 --- a/zitadel_client/models/session_service_set_session_request.py +++ b/zitadel_client/models/session_service_set_session_request.py @@ -1,41 +1,64 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.session_service_checks import SessionServiceChecks -from zitadel_client.models.session_service_request_challenges import SessionServiceRequestChallenges -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictStr +from typing import Any, Dict, Optional + class SessionServiceSetSessionRequest(BaseModel): """ SessionServiceSetSessionRequest - """ # noqa: E501 - session_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the session to be updated.", alias="sessionId") - session_token: Optional[StrictStr] = Field(default=None, description="Deprecated: the session token is no longer required when updating a session and will be ignored when provided.", alias="sessionToken") - checks: Optional[SessionServiceChecks] = None - metadata: Optional[Dict[str, Union[StrictBytes, StrictStr]]] = Field(default=None, description="Additional custom key value pairs to be stored on the session. Existing keys will be overwritten. To delete a key, set its value to an empty byte array. Note that metadata keys cannot be changed once the session has been created. You need to create a new entry and delete the old one instead.") - challenges: Optional[SessionServiceRequestChallenges] = None - lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".") - __properties: ClassVar[List[str]] = ["sessionId", "sessionToken", "checks", "metadata", "challenges", "lifetime"] + """ + session_id: Optional[StrictStr] = Field( + default=None, + alias="sessionId", + description="The unique identifier of the session to be updated.", + ) + # .. deprecated:: This property is deprecated. + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="Deprecated: the session token is no longer required when updating a session and will be ignored when provided.", + ) + checks: Optional[SessionServiceChecks] = Field(default=None, alias="checks") + metadata: Optional[Dict[str, Base64Bytes]] = Field( + default=None, + alias="metadata", + description="Additional custom key value pairs to be stored on the session. Existing keys will be overwritten. To delete a key, set its value to an empty byte array. Note that metadata keys cannot be changed once the session has been created. You need to create a new entry and delete the old one instead.", + ) + challenges: Optional[SessionServiceRequestChallenges] = Field( + default=None, alias="challenges" + ) + lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="lifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + + @field_validator("session_token") + def session_token_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `session_token` is set.""" + if value is not None: + warnings.warn( + "field 'session_token' on SessionServiceSetSessionRequest is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,63 +66,11 @@ class SessionServiceSetSessionRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceSetSessionRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of checks - if self.checks: - _dict['checks'] = self.checks.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceSetSessionRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sessionId": obj.get("sessionId"), - "sessionToken": obj.get("sessionToken"), - "checks": SessionServiceChecks.from_dict(obj["checks"]) if obj.get("checks") is not None else None, - "metadata": obj.get("metadata"), - "challenges": SessionServiceRequestChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None, - "lifetime": obj.get("lifetime") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.session_service_checks import SessionServiceChecks +from zitadel_client.models.session_service_request_challenges import ( + SessionServiceRequestChallenges, +) +SessionServiceSetSessionRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_set_session_response.py b/zitadel_client/models/session_service_set_session_response.py index b462f92d..d81f42ec 100644 --- a/zitadel_client/models/session_service_set_session_response.py +++ b/zitadel_client/models/session_service_set_session_response.py @@ -1,38 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_challenges import SessionServiceChallenges -from zitadel_client.models.session_service_details import SessionServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceSetSessionResponse(BaseModel): """ SessionServiceSetSessionResponse - """ # noqa: E501 - details: Optional[SessionServiceDetails] = None - session_token: Optional[StrictStr] = Field(default=None, description="The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. The previous token was invalidated and can no longer be used.", alias="sessionToken") - challenges: Optional[SessionServiceChallenges] = None - __properties: ClassVar[List[str]] = ["details", "sessionToken", "challenges"] + """ + + details: Optional[SessionServiceDetails] = Field(default=None, alias="details") + session_token: Optional[StrictStr] = Field( + default=None, + alias="sessionToken", + description="The current token of the session, which is required for using the session as authentication, e.g.when authenticating an OIDC auth request or SAML request. Additionally, the session token can be used as OAuth2 access token to authenticate against the ZITADEL APIs. The previous token was invalidated and can no longer be used.", + ) + challenges: Optional[SessionServiceChallenges] = Field( + default=None, alias="challenges" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +38,7 @@ class SessionServiceSetSessionResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceSetSessionResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of challenges - if self.challenges: - _dict['challenges'] = self.challenges.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceSetSessionResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SessionServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sessionToken": obj.get("sessionToken"), - "challenges": SessionServiceChallenges.from_dict(obj["challenges"]) if obj.get("challenges") is not None else None - }) - return _obj - +from zitadel_client.models.session_service_challenges import SessionServiceChallenges +from zitadel_client.models.session_service_details import SessionServiceDetails +SessionServiceSetSessionResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_timestamp_query_method.py b/zitadel_client/models/session_service_timestamp_query_method.py index 62c4c96e..ab62991b 100644 --- a/zitadel_client/models/session_service_timestamp_query_method.py +++ b/zitadel_client/models/session_service_timestamp_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SessionServiceTimestampQueryMethod(str, Enum): @@ -23,18 +13,10 @@ class SessionServiceTimestampQueryMethod(str, Enum): SessionServiceTimestampQueryMethod """ - """ - allowed enum values - """ - TIMESTAMP_QUERY_METHOD_EQUALS = 'TIMESTAMP_QUERY_METHOD_EQUALS' - TIMESTAMP_QUERY_METHOD_GREATER = 'TIMESTAMP_QUERY_METHOD_GREATER' - TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS' - TIMESTAMP_QUERY_METHOD_LESS = 'TIMESTAMP_QUERY_METHOD_LESS' - TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = 'TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SessionServiceTimestampQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_QUERY_METHOD_EQUALS = "TIMESTAMP_QUERY_METHOD_EQUALS" + TIMESTAMP_QUERY_METHOD_GREATER = "TIMESTAMP_QUERY_METHOD_GREATER" + TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS = ( + "TIMESTAMP_QUERY_METHOD_GREATER_OR_EQUALS" + ) + TIMESTAMP_QUERY_METHOD_LESS = "TIMESTAMP_QUERY_METHOD_LESS" + TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS = "TIMESTAMP_QUERY_METHOD_LESS_OR_EQUALS" diff --git a/zitadel_client/models/session_service_totp_factor.py b/zitadel_client/models/session_service_totp_factor.py index 451b43e4..c796d14a 100644 --- a/zitadel_client/models/session_service_totp_factor.py +++ b/zitadel_client/models/session_service_totp_factor.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SessionServiceTOTPFactor(BaseModel): """ SessionServiceTOTPFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - __properties: ClassVar[List[str]] = ["verifiedAt"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class SessionServiceTOTPFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceTOTPFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceTOTPFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceTOTPFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_user_agent.py b/zitadel_client/models/session_service_user_agent.py index a0498bfe..8a91734e 100644 --- a/zitadel_client/models/session_service_user_agent.py +++ b/zitadel_client/models/session_service_user_agent.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_header_values import SessionServiceHeaderValues -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class SessionServiceUserAgent(BaseModel): """ SessionServiceUserAgent - """ # noqa: E501 - fingerprint_id: Optional[StrictStr] = Field(default=None, description="FingerprintID is a unique identifier for the user agent's fingerprint. It can be used to group sessions by device or browser.", alias="fingerprintId") - ip: Optional[StrictStr] = Field(default=None, description="IP is the IP address from which the session was created.") - description: Optional[StrictStr] = Field(default=None, description="Description is a human-readable description of the user agent.") - header: Optional[Dict[str, SessionServiceHeaderValues]] = None - __properties: ClassVar[List[str]] = ["fingerprintId", "ip", "description", "header"] + """ + fingerprint_id: Optional[StrictStr] = Field( + default=None, + alias="fingerprintId", + description="FingerprintID is a unique identifier for the user agent's fingerprint. It can be used to group sessions by device or browser.", + ) + ip: Optional[StrictStr] = Field( + default=None, + alias="ip", + description="IP is the IP address from which the session was created.", + ) + description: Optional[StrictStr] = Field( + default=None, + alias="description", + description="Description is a human-readable description of the user agent.", + ) + header: Optional[Dict[str, SessionServiceHeaderValues]] = Field( + default=None, alias="header" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,82 +47,8 @@ class SessionServiceUserAgent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceUserAgent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in header (dict) - _field_dict = {} - if self.header: - for _key_header in self.header: - if self.header[_key_header]: - _field_dict[_key_header] = self.header[_key_header].to_dict() - _dict['header'] = _field_dict - # set to None if fingerprint_id (nullable) is None - # and model_fields_set contains the field - if self.fingerprint_id is None and "fingerprint_id" in self.model_fields_set: - _dict['fingerprintId'] = None - - # set to None if ip (nullable) is None - # and model_fields_set contains the field - if self.ip is None and "ip" in self.model_fields_set: - _dict['ip'] = None - - # set to None if description (nullable) is None - # and model_fields_set contains the field - if self.description is None and "description" in self.model_fields_set: - _dict['description'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceUserAgent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "fingerprintId": obj.get("fingerprintId"), - "ip": obj.get("ip"), - "description": obj.get("description"), - "header": dict( - (_k, SessionServiceHeaderValues.from_dict(_v)) - for _k, _v in obj["header"].items() - ) - if obj.get("header") is not None - else None - }) - return _obj - +from zitadel_client.models.session_service_header_values import ( + SessionServiceHeaderValues, +) +SessionServiceUserAgent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_user_agent_query.py b/zitadel_client/models/session_service_user_agent_query.py index 54d66f05..ef3ffa8e 100644 --- a/zitadel_client/models/session_service_user_agent_query.py +++ b/zitadel_client/models/session_service_user_agent_query.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceUserAgentQuery(BaseModel): """ SessionServiceUserAgentQuery - """ # noqa: E501 - fingerprint_id: Optional[StrictStr] = Field(default=None, description="Finger print id of the user agent used for the session. Set an empty fingerprint_id to use the user agent from the call. If the user agent is not available from the current token, an error will be returned.", alias="fingerprintId") - __properties: ClassVar[List[str]] = ["fingerprintId"] + """ + + fingerprint_id: Optional[StrictStr] = Field( + default=None, + alias="fingerprintId", + description="Finger print id of the user agent used for the session. Set an empty fingerprint_id to use the user agent from the call. If the user agent is not available from the current token, an error will be returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class SessionServiceUserAgentQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceUserAgentQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if fingerprint_id (nullable) is None - # and model_fields_set contains the field - if self.fingerprint_id is None and "fingerprint_id" in self.model_fields_set: - _dict['fingerprintId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceUserAgentQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "fingerprintId": obj.get("fingerprintId") - }) - return _obj - - +SessionServiceUserAgentQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_user_factor.py b/zitadel_client/models/session_service_user_factor.py index 62b8e94d..8e1faf2e 100644 --- a/zitadel_client/models/session_service_user_factor.py +++ b/zitadel_client/models/session_service_user_factor.py @@ -1,39 +1,52 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceUserFactor(BaseModel): """ SessionServiceUserFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user that was verified.") - login_name: Optional[StrictStr] = Field(default=None, description="The login name of the user that was verified.", alias="loginName") - display_name: Optional[StrictStr] = Field(default=None, description="The display name of the user that was verified.", alias="displayName") - organization_id: Optional[StrictStr] = Field(default=None, description="The id of the organization the user belongs to.", alias="organizationId") - __properties: ClassVar[List[str]] = ["verifiedAt", "id", "loginName", "displayName", "organizationId"] + """ + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the user that was verified.", + ) + login_name: Optional[StrictStr] = Field( + default=None, + alias="loginName", + description="The login name of the user that was verified.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="The display name of the user that was verified.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The id of the organization the user belongs to.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +54,6 @@ class SessionServiceUserFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceUserFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceUserFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt"), - "id": obj.get("id"), - "loginName": obj.get("loginName"), - "displayName": obj.get("displayName"), - "organizationId": obj.get("organizationId") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceUserFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_user_id_query.py b/zitadel_client/models/session_service_user_id_query.py index 6ebc1f73..c5670246 100644 --- a/zitadel_client/models/session_service_user_id_query.py +++ b/zitadel_client/models/session_service_user_id_query.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceUserIDQuery(BaseModel): """ SessionServiceUserIDQuery - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID of the user whose sessions are being searched for.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="ID of the user whose sessions are being searched for.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SessionServiceUserIDQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceUserIDQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceUserIDQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +SessionServiceUserIDQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_user_verification_requirement.py b/zitadel_client/models/session_service_user_verification_requirement.py index 972a0eda..2b744bd4 100644 --- a/zitadel_client/models/session_service_user_verification_requirement.py +++ b/zitadel_client/models/session_service_user_verification_requirement.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SessionServiceUserVerificationRequirement(str, Enum): @@ -23,17 +13,11 @@ class SessionServiceUserVerificationRequirement(str, Enum): SessionServiceUserVerificationRequirement """ - """ - allowed enum values - """ - USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = 'USER_VERIFICATION_REQUIREMENT_UNSPECIFIED' - USER_VERIFICATION_REQUIREMENT_REQUIRED = 'USER_VERIFICATION_REQUIREMENT_REQUIRED' - USER_VERIFICATION_REQUIREMENT_PREFERRED = 'USER_VERIFICATION_REQUIREMENT_PREFERRED' - USER_VERIFICATION_REQUIREMENT_DISCOURAGED = 'USER_VERIFICATION_REQUIREMENT_DISCOURAGED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SessionServiceUserVerificationRequirement from a JSON string""" - return cls(json.loads(json_str)) - - + USER_VERIFICATION_REQUIREMENT_UNSPECIFIED = ( + "USER_VERIFICATION_REQUIREMENT_UNSPECIFIED" + ) + USER_VERIFICATION_REQUIREMENT_REQUIRED = "USER_VERIFICATION_REQUIREMENT_REQUIRED" + USER_VERIFICATION_REQUIREMENT_PREFERRED = "USER_VERIFICATION_REQUIREMENT_PREFERRED" + USER_VERIFICATION_REQUIREMENT_DISCOURAGED = ( + "USER_VERIFICATION_REQUIREMENT_DISCOURAGED" + ) diff --git a/zitadel_client/models/session_service_web_auth_n.py b/zitadel_client/models/session_service_web_auth_n.py index 394870c5..b5de8849 100644 --- a/zitadel_client/models/session_service_web_auth_n.py +++ b/zitadel_client/models/session_service_web_auth_n.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.session_service_user_verification_requirement import SessionServiceUserVerificationRequirement -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SessionServiceWebAuthN(BaseModel): """ SessionServiceWebAuthN - """ # noqa: E501 - domain: Optional[StrictStr] = Field(default=None, description="The domain on which the session was created. Will be used in the WebAuthN challenge. It must be either the exact domain or a top-level domain of the origin of the request. For example if the request is coming from \"login.example.com\", the domain can be \"login.example.com\" or \"example.com\", but not \"other.com\" or \"sub.login.example.com\". See also: https://www.w3.org/TR/webauthn/#relying-party-identifier") - user_verification_requirement: Optional[SessionServiceUserVerificationRequirement] = Field(default=None, alias="userVerificationRequirement") - __properties: ClassVar[List[str]] = ["domain", "userVerificationRequirement"] + """ + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description='The domain on which the session was created. Will be used in the WebAuthN challenge. It must be either the exact domain or a top-level domain of the origin of the request. For example if the request is coming from "login.example.com", the domain can be "login.example.com" or "example.com", but not "other.com" or "sub.login.example.com". See also: https://www.w3.org/TR/webauthn/#relying-party-identifier', + ) + user_verification_requirement: Optional[ + SessionServiceUserVerificationRequirement + ] = Field(default=None, alias="userVerificationRequirement") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,8 @@ class SessionServiceWebAuthN(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceWebAuthN from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceWebAuthN from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "domain": obj.get("domain"), - "userVerificationRequirement": obj.get("userVerificationRequirement") - }) - return _obj - +from zitadel_client.models.session_service_user_verification_requirement import ( + SessionServiceUserVerificationRequirement, +) +SessionServiceWebAuthN.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/session_service_web_auth_n_factor.py b/zitadel_client/models/session_service_web_auth_n_factor.py index a231ee81..2e92f456 100644 --- a/zitadel_client/models/session_service_web_auth_n_factor.py +++ b/zitadel_client/models/session_service_web_auth_n_factor.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SessionServiceWebAuthNFactor(BaseModel): """ SessionServiceWebAuthNFactor - """ # noqa: E501 - verified_at: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="verifiedAt") - user_verified: Optional[StrictBool] = Field(default=None, description="Indicates if the user presence was verified during the last challenge. This can be used to determine if the factor can be considered as multi-factor authentication.", alias="userVerified") - __properties: ClassVar[List[str]] = ["verifiedAt", "userVerified"] + """ + + verified_at: Optional[AwareDatetime] = Field( + default=None, + alias="verifiedAt", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + user_verified: Optional[StrictBool] = Field( + default=None, + alias="userVerified", + description="Indicates if the user presence was verified during the last challenge. This can be used to determine if the factor can be considered as multi-factor authentication.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class SessionServiceWebAuthNFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionServiceWebAuthNFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionServiceWebAuthNFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "verifiedAt": obj.get("verifiedAt"), - "userVerified": obj.get("userVerified") - }) - return _obj - +from pydantic import AwareDatetime +SessionServiceWebAuthNFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_any.py b/zitadel_client/models/settings_service_any.py index 173480ee..b649913e 100644 --- a/zitadel_client/models/settings_service_any.py +++ b/zitadel_client/models/settings_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class SettingsServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +SettingsServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_auto_linking_option.py b/zitadel_client/models/settings_service_auto_linking_option.py index 16e287b7..71afdeff 100644 --- a/zitadel_client/models/settings_service_auto_linking_option.py +++ b/zitadel_client/models/settings_service_auto_linking_option.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceAutoLinkingOption(str, Enum): @@ -23,16 +13,6 @@ class SettingsServiceAutoLinkingOption(str, Enum): SettingsServiceAutoLinkingOption """ - """ - allowed enum values - """ - AUTO_LINKING_OPTION_UNSPECIFIED = 'AUTO_LINKING_OPTION_UNSPECIFIED' - AUTO_LINKING_OPTION_USERNAME = 'AUTO_LINKING_OPTION_USERNAME' - AUTO_LINKING_OPTION_EMAIL = 'AUTO_LINKING_OPTION_EMAIL' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceAutoLinkingOption from a JSON string""" - return cls(json.loads(json_str)) - - + AUTO_LINKING_OPTION_UNSPECIFIED = "AUTO_LINKING_OPTION_UNSPECIFIED" + AUTO_LINKING_OPTION_USERNAME = "AUTO_LINKING_OPTION_USERNAME" + AUTO_LINKING_OPTION_EMAIL = "AUTO_LINKING_OPTION_EMAIL" diff --git a/zitadel_client/models/settings_service_branding_settings.py b/zitadel_client/models/settings_service_branding_settings.py index ad7043a8..c4477923 100644 --- a/zitadel_client/models/settings_service_branding_settings.py +++ b/zitadel_client/models/settings_service_branding_settings.py @@ -1,43 +1,50 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from zitadel_client.models.settings_service_theme import SettingsServiceTheme -from zitadel_client.models.settings_service_theme_mode import SettingsServiceThemeMode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class SettingsServiceBrandingSettings(BaseModel): """ SettingsServiceBrandingSettings - """ # noqa: E501 - light_theme: Optional[SettingsServiceTheme] = Field(default=None, alias="lightTheme") + """ + + light_theme: Optional[SettingsServiceTheme] = Field( + default=None, alias="lightTheme" + ) dark_theme: Optional[SettingsServiceTheme] = Field(default=None, alias="darkTheme") - font_url: Optional[StrictStr] = Field(default=None, description="The url where the font is served.", alias="fontUrl") - hide_login_name_suffix: Optional[StrictBool] = Field(default=None, description="If enabled, the organization suffix will be hidden on the login form if the scope \\\"urn:zitadel:iam:org:domain:primary:{domainname}\\\" is used.", alias="hideLoginNameSuffix") - disable_watermark: Optional[StrictBool] = Field(default=None, description="If enabled, the Zitadel logo will not be displayed on the login screen.", alias="disableWatermark") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - theme_mode: Optional[SettingsServiceThemeMode] = Field(default=None, alias="themeMode") - __properties: ClassVar[List[str]] = ["lightTheme", "darkTheme", "fontUrl", "hideLoginNameSuffix", "disableWatermark", "resourceOwnerType", "themeMode"] + font_url: Optional[StrictStr] = Field( + default=None, alias="fontUrl", description="The url where the font is served." + ) + hide_login_name_suffix: Optional[StrictBool] = Field( + default=None, + alias="hideLoginNameSuffix", + description='If enabled, the organization suffix will be hidden on the login form if the scope \\"urn:zitadel:iam:org:domain:primary:{domainname}\\" is used.', + ) + disable_watermark: Optional[StrictBool] = Field( + default=None, + alias="disableWatermark", + description="If enabled, the Zitadel logo will not be displayed on the login screen.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + theme_mode: Optional[SettingsServiceThemeMode] = Field( + default=None, alias="themeMode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,64 +52,10 @@ class SettingsServiceBrandingSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceBrandingSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of light_theme - if self.light_theme: - _dict['lightTheme'] = self.light_theme.to_dict() - # override the default output from pydantic by calling `to_dict()` of dark_theme - if self.dark_theme: - _dict['darkTheme'] = self.dark_theme.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceBrandingSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "lightTheme": SettingsServiceTheme.from_dict(obj["lightTheme"]) if obj.get("lightTheme") is not None else None, - "darkTheme": SettingsServiceTheme.from_dict(obj["darkTheme"]) if obj.get("darkTheme") is not None else None, - "fontUrl": obj.get("fontUrl"), - "hideLoginNameSuffix": obj.get("hideLoginNameSuffix"), - "disableWatermark": obj.get("disableWatermark"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "themeMode": obj.get("themeMode") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +from zitadel_client.models.settings_service_theme import SettingsServiceTheme +from zitadel_client.models.settings_service_theme_mode import SettingsServiceThemeMode +SettingsServiceBrandingSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_connect_error.py b/zitadel_client/models/settings_service_connect_error.py index 50536ae4..3fa195fd 100644 --- a/zitadel_client/models/settings_service_connect_error.py +++ b/zitadel_client/models/settings_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.settings_service_any import SettingsServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class SettingsServiceConnectErrorCodeEnum(str, Enum): + """SettingsServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class SettingsServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[SettingsServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[SettingsServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[SettingsServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [SettingsServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.settings_service_any import SettingsServiceAny +SettingsServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_details.py b/zitadel_client/models/settings_service_details.py index 9714e43d..36e4df16 100644 --- a/zitadel_client/models/settings_service_details.py +++ b/zitadel_client/models/settings_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SettingsServiceDetails(BaseModel): """ SettingsServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class SettingsServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +SettingsServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_domain_settings.py b/zitadel_client/models/settings_service_domain_settings.py index 075b5537..e780d704 100644 --- a/zitadel_client/models/settings_service_domain_settings.py +++ b/zitadel_client/models/settings_service_domain_settings.py @@ -1,38 +1,45 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServiceDomainSettings(BaseModel): """ SettingsServiceDomainSettings - """ # noqa: E501 - login_name_includes_domain: Optional[StrictBool] = Field(default=None, description="If enabled, the login name will automatically be suffixed with the domain of the organization. This ensures that the login name is unique across the instance.", alias="loginNameIncludesDomain") - require_org_domain_verification: Optional[StrictBool] = Field(default=None, description="If enabled, organization domains must be verified (through an DNS or HTTP challenge) upon creation. If disabled, organization domains will be created as already verified automatically.", alias="requireOrgDomainVerification") - smtp_sender_address_matches_instance_domain: Optional[StrictBool] = Field(default=None, description="If enabled, the SMTP sender address domain must match custom domain on the instance.", alias="smtpSenderAddressMatchesInstanceDomain") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["loginNameIncludesDomain", "requireOrgDomainVerification", "smtpSenderAddressMatchesInstanceDomain", "resourceOwnerType"] + """ + + login_name_includes_domain: Optional[StrictBool] = Field( + default=None, + alias="loginNameIncludesDomain", + description="If enabled, the login name will automatically be suffixed with the domain of the organization. This ensures that the login name is unique across the instance.", + ) + require_org_domain_verification: Optional[StrictBool] = Field( + default=None, + alias="requireOrgDomainVerification", + description="If enabled, organization domains must be verified (through an DNS or HTTP challenge) upon creation. If disabled, organization domains will be created as already verified automatically.", + ) + smtp_sender_address_matches_instance_domain: Optional[StrictBool] = Field( + default=None, + alias="smtpSenderAddressMatchesInstanceDomain", + description="If enabled, the SMTP sender address domain must match custom domain on the instance.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,55 +47,8 @@ class SettingsServiceDomainSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceDomainSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceDomainSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginNameIncludesDomain": obj.get("loginNameIncludesDomain"), - "requireOrgDomainVerification": obj.get("requireOrgDomainVerification"), - "smtpSenderAddressMatchesInstanceDomain": obj.get("smtpSenderAddressMatchesInstanceDomain"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +SettingsServiceDomainSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_embedded_iframe_settings.py b/zitadel_client/models/settings_service_embedded_iframe_settings.py index 6823303e..6446f302 100644 --- a/zitadel_client/models/settings_service_embedded_iframe_settings.py +++ b/zitadel_client/models/settings_service_embedded_iframe_settings.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class SettingsServiceEmbeddedIframeSettings(BaseModel): """ SettingsServiceEmbeddedIframeSettings - """ # noqa: E501 - enabled: Optional[StrictBool] = Field(default=None, description="Enabled states if iframe embedding is enabled or disabled.") - allowed_origins: Optional[List[StrictStr]] = Field(default=None, description="AllowedOrigins defines which origins are allowed to embed ZITADEL in an iframe.", alias="allowedOrigins") - __properties: ClassVar[List[str]] = ["enabled", "allowedOrigins"] + """ + enabled: Optional[StrictBool] = Field( + default=None, + alias="enabled", + description="Enabled states if iframe embedding is enabled or disabled.", + ) + allowed_origins: Optional[List[StrictStr]] = Field( + default=None, + alias="allowedOrigins", + description="AllowedOrigins defines which origins are allowed to embed ZITADEL in an iframe.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class SettingsServiceEmbeddedIframeSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceEmbeddedIframeSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceEmbeddedIframeSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "enabled": obj.get("enabled"), - "allowedOrigins": obj.get("allowedOrigins") - }) - return _obj - - +SettingsServiceEmbeddedIframeSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_active_identity_providers_request.py b/zitadel_client/models/settings_service_get_active_identity_providers_request.py index 99a7b56c..4c116337 100644 --- a/zitadel_client/models/settings_service_get_active_identity_providers_request.py +++ b/zitadel_client/models/settings_service_get_active_identity_providers_request.py @@ -1,39 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServiceGetActiveIdentityProvidersRequest(BaseModel): """ SettingsServiceGetActiveIdentityProvidersRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - creation_allowed: Optional[StrictBool] = Field(default=None, alias="creationAllowed") + """ + + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + creation_allowed: Optional[StrictBool] = Field( + default=None, alias="creationAllowed" + ) linking_allowed: Optional[StrictBool] = Field(default=None, alias="linkingAllowed") auto_creation: Optional[StrictBool] = Field(default=None, alias="autoCreation") auto_linking: Optional[StrictBool] = Field(default=None, alias="autoLinking") - __properties: ClassVar[List[str]] = ["ctx", "creationAllowed", "linkingAllowed", "autoCreation", "autoLinking"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,79 +36,8 @@ class SettingsServiceGetActiveIdentityProvidersRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetActiveIdentityProvidersRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - # set to None if creation_allowed (nullable) is None - # and model_fields_set contains the field - if self.creation_allowed is None and "creation_allowed" in self.model_fields_set: - _dict['creationAllowed'] = None - - # set to None if linking_allowed (nullable) is None - # and model_fields_set contains the field - if self.linking_allowed is None and "linking_allowed" in self.model_fields_set: - _dict['linkingAllowed'] = None - - # set to None if auto_creation (nullable) is None - # and model_fields_set contains the field - if self.auto_creation is None and "auto_creation" in self.model_fields_set: - _dict['autoCreation'] = None - - # set to None if auto_linking (nullable) is None - # and model_fields_set contains the field - if self.auto_linking is None and "auto_linking" in self.model_fields_set: - _dict['autoLinking'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetActiveIdentityProvidersRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None, - "creationAllowed": obj.get("creationAllowed"), - "linkingAllowed": obj.get("linkingAllowed"), - "autoCreation": obj.get("autoCreation"), - "autoLinking": obj.get("autoLinking") - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetActiveIdentityProvidersRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_active_identity_providers_response.py b/zitadel_client/models/settings_service_get_active_identity_providers_response.py index b01b23dc..b72a009f 100644 --- a/zitadel_client/models/settings_service_get_active_identity_providers_response.py +++ b/zitadel_client/models/settings_service_get_active_identity_providers_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.settings_service_identity_provider import SettingsServiceIdentityProvider -from zitadel_client.models.settings_service_list_details import SettingsServiceListDetails -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class SettingsServiceGetActiveIdentityProvidersResponse(BaseModel): """ SettingsServiceGetActiveIdentityProvidersResponse - """ # noqa: E501 - details: Optional[SettingsServiceListDetails] = None - identity_providers: Optional[List[SettingsServiceIdentityProvider]] = Field(default=None, alias="identityProviders") - __properties: ClassVar[List[str]] = ["details", "identityProviders"] + """ + details: Optional[SettingsServiceListDetails] = Field(default=None, alias="details") + identity_providers: Optional[List[SettingsServiceIdentityProvider]] = Field( + default=None, alias="identityProviders" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +32,11 @@ class SettingsServiceGetActiveIdentityProvidersResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetActiveIdentityProvidersResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in identity_providers (list) - _items = [] - if self.identity_providers: - for _item_identity_providers in self.identity_providers: - if _item_identity_providers: - _items.append(_item_identity_providers.to_dict()) - _dict['identityProviders'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetActiveIdentityProvidersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "identityProviders": [SettingsServiceIdentityProvider.from_dict(_item) for _item in obj["identityProviders"]] if obj.get("identityProviders") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_identity_provider import ( + SettingsServiceIdentityProvider, +) +from zitadel_client.models.settings_service_list_details import ( + SettingsServiceListDetails, +) +SettingsServiceGetActiveIdentityProvidersResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_branding_settings_request.py b/zitadel_client/models/settings_service_get_branding_settings_request.py index fc4c7beb..81a2f1a3 100644 --- a/zitadel_client/models/settings_service_get_branding_settings_request.py +++ b/zitadel_client/models/settings_service_get_branding_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetBrandingSettingsRequest(BaseModel): """ SettingsServiceGetBrandingSettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetBrandingSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetBrandingSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetBrandingSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetBrandingSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_branding_settings_response.py b/zitadel_client/models/settings_service_get_branding_settings_response.py index 1d127540..9477ff5b 100644 --- a/zitadel_client/models/settings_service_get_branding_settings_response.py +++ b/zitadel_client/models/settings_service_get_branding_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_branding_settings import SettingsServiceBrandingSettings -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetBrandingSettingsResponse(BaseModel): """ SettingsServiceGetBrandingSettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceBrandingSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceBrandingSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetBrandingSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetBrandingSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetBrandingSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceBrandingSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_branding_settings import ( + SettingsServiceBrandingSettings, +) +from zitadel_client.models.settings_service_details import SettingsServiceDetails +SettingsServiceGetBrandingSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_domain_settings_request.py b/zitadel_client/models/settings_service_get_domain_settings_request.py index 01b2fd9a..2faa04ed 100644 --- a/zitadel_client/models/settings_service_get_domain_settings_request.py +++ b/zitadel_client/models/settings_service_get_domain_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetDomainSettingsRequest(BaseModel): """ SettingsServiceGetDomainSettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetDomainSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetDomainSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetDomainSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetDomainSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_domain_settings_response.py b/zitadel_client/models/settings_service_get_domain_settings_response.py index c2b7da8a..022d6436 100644 --- a/zitadel_client/models/settings_service_get_domain_settings_response.py +++ b/zitadel_client/models/settings_service_get_domain_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_domain_settings import SettingsServiceDomainSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetDomainSettingsResponse(BaseModel): """ SettingsServiceGetDomainSettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceDomainSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceDomainSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetDomainSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetDomainSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetDomainSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceDomainSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_domain_settings import ( + SettingsServiceDomainSettings, +) +SettingsServiceGetDomainSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_general_settings_response.py b/zitadel_client/models/settings_service_get_general_settings_response.py index d675ea28..89281a98 100644 --- a/zitadel_client/models/settings_service_get_general_settings_response.py +++ b/zitadel_client/models/settings_service_get_general_settings_response.py @@ -1,38 +1,52 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class SettingsServiceGetGeneralSettingsResponse(BaseModel): """ SettingsServiceGetGeneralSettingsResponse - """ # noqa: E501 - default_org_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. Deprecated: use default_organization_id instead.", alias="defaultOrgId") - default_language: Optional[StrictStr] = Field(default=None, description="The default language is use if no other language is specified or detected. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\").", alias="defaultLanguage") - supported_languages: Optional[List[StrictStr]] = Field(default=None, description="The list of supported languages. Note that the instance might restrict the languages further only allowing a subset of these languages to be used. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\").", alias="supportedLanguages") - default_organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified.", alias="defaultOrganizationId") - allowed_languages: Optional[List[StrictStr]] = Field(default=None, description="The list of allowed languages for the instance. This is a subset of the supported languages to be used in the instance e.g. for user selection during registration or language detection in the UI. The format is a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\").", alias="allowedLanguages") - __properties: ClassVar[List[str]] = ["defaultOrgId", "defaultLanguage", "supportedLanguages", "defaultOrganizationId", "allowedLanguages"] + """ + + default_org_id: Optional[StrictStr] = Field( + default=None, + alias="defaultOrgId", + description="The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified. Deprecated: use default_organization_id instead.", + ) + default_language: Optional[StrictStr] = Field( + default=None, + alias="defaultLanguage", + description='The default language is use if no other language is specified or detected. The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").', + ) + supported_languages: Optional[List[StrictStr]] = Field( + default=None, + alias="supportedLanguages", + description='The list of supported languages. Note that the instance might restrict the languages further only allowing a subset of these languages to be used. The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").', + ) + default_organization_id: Optional[StrictStr] = Field( + default=None, + alias="defaultOrganizationId", + description="The unique identifier of the default organization. The default organization is used to assign new users to an organization if no other organization is specified.", + ) + allowed_languages: Optional[List[StrictStr]] = Field( + default=None, + alias="allowedLanguages", + description='The list of allowed languages for the instance. This is a subset of the supported languages to be used in the instance e.g. for user selection during registration or language detection in the UI. The format is a BCP 47 language tag (e.g. "en", "de", "fr-CH").', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +54,4 @@ class SettingsServiceGetGeneralSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetGeneralSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetGeneralSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "defaultOrgId": obj.get("defaultOrgId"), - "defaultLanguage": obj.get("defaultLanguage"), - "supportedLanguages": obj.get("supportedLanguages"), - "defaultOrganizationId": obj.get("defaultOrganizationId"), - "allowedLanguages": obj.get("allowedLanguages") - }) - return _obj - - +SettingsServiceGetGeneralSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_hosted_login_translation_request.py b/zitadel_client/models/settings_service_get_hosted_login_translation_request.py index e22c5458..08116c4b 100644 --- a/zitadel_client/models/settings_service_get_hosted_login_translation_request.py +++ b/zitadel_client/models/settings_service_get_hosted_login_translation_request.py @@ -1,38 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class SettingsServiceGetHostedLoginTranslationRequest(BaseModel): """ SettingsServiceGetHostedLoginTranslationRequest - """ # noqa: E501 - locale: Optional[StrictStr] = Field(default=None, description="The locale of the translations to be returned. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\").") - ignore_inheritance: Optional[StrictBool] = Field(default=None, description="if set to true, higher levels are ignored, if false higher levels are merged into the file", alias="ignoreInheritance") - instance: Optional[StrictBool] = None + """ + + locale: Optional[StrictStr] = Field( + default=None, + alias="locale", + description='The locale of the translations to be returned. Needs to be a BCP 47 language tag (e.g. "en", "de", "fr-CH").', + ) + ignore_inheritance: Optional[StrictBool] = Field( + default=None, + alias="ignoreInheritance", + description="if set to true, higher levels are ignored, if false higher levels are merged into the file", + ) + instance: Optional[StrictBool] = Field(default=None, alias="instance") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - system: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["locale", "ignoreInheritance", "instance", "organizationId", "system"] + system: Optional[StrictBool] = Field(default=None, alias="system") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +42,4 @@ class SettingsServiceGetHostedLoginTranslationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetHostedLoginTranslationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetHostedLoginTranslationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "locale": obj.get("locale"), - "ignoreInheritance": obj.get("ignoreInheritance"), - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId"), - "system": obj.get("system") - }) - return _obj - - +SettingsServiceGetHostedLoginTranslationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_hosted_login_translation_response.py b/zitadel_client/models/settings_service_get_hosted_login_translation_response.py index 0eb78963..c1557abc 100644 --- a/zitadel_client/models/settings_service_get_hosted_login_translation_response.py +++ b/zitadel_client/models/settings_service_get_hosted_login_translation_response.py @@ -1,35 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class SettingsServiceGetHostedLoginTranslationResponse(BaseModel): """ SettingsServiceGetHostedLoginTranslationResponse - """ # noqa: E501 - etag: Optional[StrictStr] = Field(default=None, description="hash of the payload") - translations: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.") - __properties: ClassVar[List[str]] = ["etag", "translations"] + """ + etag: Optional[StrictStr] = Field( + default=None, alias="etag", description="hash of the payload" + ) + translations: Optional[Dict[str, object]] = Field( + default=None, + alias="translations", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +37,4 @@ class SettingsServiceGetHostedLoginTranslationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetHostedLoginTranslationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetHostedLoginTranslationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "etag": obj.get("etag"), - "translations": obj.get("translations") - }) - return _obj - - +SettingsServiceGetHostedLoginTranslationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_legal_and_support_settings_request.py b/zitadel_client/models/settings_service_get_legal_and_support_settings_request.py index 27b73609..13ca1344 100644 --- a/zitadel_client/models/settings_service_get_legal_and_support_settings_request.py +++ b/zitadel_client/models/settings_service_get_legal_and_support_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLegalAndSupportSettingsRequest(BaseModel): """ SettingsServiceGetLegalAndSupportSettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetLegalAndSupportSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLegalAndSupportSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLegalAndSupportSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetLegalAndSupportSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_legal_and_support_settings_response.py b/zitadel_client/models/settings_service_get_legal_and_support_settings_response.py index 9fe55741..cda9f40d 100644 --- a/zitadel_client/models/settings_service_get_legal_and_support_settings_response.py +++ b/zitadel_client/models/settings_service_get_legal_and_support_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_legal_and_support_settings import SettingsServiceLegalAndSupportSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLegalAndSupportSettingsResponse(BaseModel): """ SettingsServiceGetLegalAndSupportSettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceLegalAndSupportSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceLegalAndSupportSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetLegalAndSupportSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLegalAndSupportSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLegalAndSupportSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceLegalAndSupportSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_legal_and_support_settings import ( + SettingsServiceLegalAndSupportSettings, +) +SettingsServiceGetLegalAndSupportSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_lockout_settings_request.py b/zitadel_client/models/settings_service_get_lockout_settings_request.py index 718fedc2..275a03ae 100644 --- a/zitadel_client/models/settings_service_get_lockout_settings_request.py +++ b/zitadel_client/models/settings_service_get_lockout_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLockoutSettingsRequest(BaseModel): """ SettingsServiceGetLockoutSettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetLockoutSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLockoutSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLockoutSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetLockoutSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_lockout_settings_response.py b/zitadel_client/models/settings_service_get_lockout_settings_response.py index 109027cc..4d882659 100644 --- a/zitadel_client/models/settings_service_get_lockout_settings_response.py +++ b/zitadel_client/models/settings_service_get_lockout_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_lockout_settings import SettingsServiceLockoutSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLockoutSettingsResponse(BaseModel): """ SettingsServiceGetLockoutSettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceLockoutSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceLockoutSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetLockoutSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLockoutSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLockoutSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceLockoutSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_lockout_settings import ( + SettingsServiceLockoutSettings, +) +SettingsServiceGetLockoutSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_login_settings_request.py b/zitadel_client/models/settings_service_get_login_settings_request.py index c99961e3..a90a53de 100644 --- a/zitadel_client/models/settings_service_get_login_settings_request.py +++ b/zitadel_client/models/settings_service_get_login_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLoginSettingsRequest(BaseModel): """ SettingsServiceGetLoginSettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetLoginSettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLoginSettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLoginSettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetLoginSettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_login_settings_response.py b/zitadel_client/models/settings_service_get_login_settings_response.py index 93807a70..ae561f52 100644 --- a/zitadel_client/models/settings_service_get_login_settings_response.py +++ b/zitadel_client/models/settings_service_get_login_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_login_settings import SettingsServiceLoginSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetLoginSettingsResponse(BaseModel): """ SettingsServiceGetLoginSettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceLoginSettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceLoginSettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetLoginSettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetLoginSettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetLoginSettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceLoginSettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_login_settings import ( + SettingsServiceLoginSettings, +) +SettingsServiceGetLoginSettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_password_complexity_settings_request.py b/zitadel_client/models/settings_service_get_password_complexity_settings_request.py index 2d93416c..569e6048 100644 --- a/zitadel_client/models/settings_service_get_password_complexity_settings_request.py +++ b/zitadel_client/models/settings_service_get_password_complexity_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetPasswordComplexitySettingsRequest(BaseModel): """ SettingsServiceGetPasswordComplexitySettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetPasswordComplexitySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordComplexitySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordComplexitySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetPasswordComplexitySettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_password_complexity_settings_response.py b/zitadel_client/models/settings_service_get_password_complexity_settings_response.py index 24ffbe07..f3e7c599 100644 --- a/zitadel_client/models/settings_service_get_password_complexity_settings_response.py +++ b/zitadel_client/models/settings_service_get_password_complexity_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_password_complexity_settings import SettingsServicePasswordComplexitySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetPasswordComplexitySettingsResponse(BaseModel): """ SettingsServiceGetPasswordComplexitySettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServicePasswordComplexitySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServicePasswordComplexitySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetPasswordComplexitySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordComplexitySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordComplexitySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServicePasswordComplexitySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_password_complexity_settings import ( + SettingsServicePasswordComplexitySettings, +) +SettingsServiceGetPasswordComplexitySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_password_expiry_settings_request.py b/zitadel_client/models/settings_service_get_password_expiry_settings_request.py index f6e6a910..2aa1e71e 100644 --- a/zitadel_client/models/settings_service_get_password_expiry_settings_request.py +++ b/zitadel_client/models/settings_service_get_password_expiry_settings_request.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_request_context import SettingsServiceRequestContext -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetPasswordExpirySettingsRequest(BaseModel): """ SettingsServiceGetPasswordExpirySettingsRequest - """ # noqa: E501 - ctx: Optional[SettingsServiceRequestContext] = None - __properties: ClassVar[List[str]] = ["ctx"] + """ + ctx: Optional[SettingsServiceRequestContext] = Field(default=None, alias="ctx") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,8 @@ class SettingsServiceGetPasswordExpirySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordExpirySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ctx - if self.ctx: - _dict['ctx'] = self.ctx.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordExpirySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ctx": SettingsServiceRequestContext.from_dict(obj["ctx"]) if obj.get("ctx") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_request_context import ( + SettingsServiceRequestContext, +) +SettingsServiceGetPasswordExpirySettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_password_expiry_settings_response.py b/zitadel_client/models/settings_service_get_password_expiry_settings_response.py index a73c1f4d..49fdcb0c 100644 --- a/zitadel_client/models/settings_service_get_password_expiry_settings_response.py +++ b/zitadel_client/models/settings_service_get_password_expiry_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_password_expiry_settings import SettingsServicePasswordExpirySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetPasswordExpirySettingsResponse(BaseModel): """ SettingsServiceGetPasswordExpirySettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServicePasswordExpirySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServicePasswordExpirySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetPasswordExpirySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordExpirySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetPasswordExpirySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServicePasswordExpirySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_password_expiry_settings import ( + SettingsServicePasswordExpirySettings, +) +SettingsServiceGetPasswordExpirySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_get_security_settings_response.py b/zitadel_client/models/settings_service_get_security_settings_response.py index ab52aac5..f3f5b16f 100644 --- a/zitadel_client/models/settings_service_get_security_settings_response.py +++ b/zitadel_client/models/settings_service_get_security_settings_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from zitadel_client.models.settings_service_security_settings import SettingsServiceSecuritySettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceGetSecuritySettingsResponse(BaseModel): """ SettingsServiceGetSecuritySettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - settings: Optional[SettingsServiceSecuritySettings] = None - __properties: ClassVar[List[str]] = ["details", "settings"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + settings: Optional[SettingsServiceSecuritySettings] = Field( + default=None, alias="settings" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class SettingsServiceGetSecuritySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceGetSecuritySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of settings - if self.settings: - _dict['settings'] = self.settings.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceGetSecuritySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "settings": SettingsServiceSecuritySettings.from_dict(obj["settings"]) if obj.get("settings") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +from zitadel_client.models.settings_service_security_settings import ( + SettingsServiceSecuritySettings, +) +SettingsServiceGetSecuritySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_identity_provider.py b/zitadel_client/models/settings_service_identity_provider.py index b36025d0..10afe772 100644 --- a/zitadel_client/models/settings_service_identity_provider.py +++ b/zitadel_client/models/settings_service_identity_provider.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_identity_provider_type import SettingsServiceIdentityProviderType -from zitadel_client.models.settings_service_options import SettingsServiceOptions -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SettingsServiceIdentityProvider(BaseModel): """ SettingsServiceIdentityProvider - """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - type: Optional[SettingsServiceIdentityProviderType] = None - options: Optional[SettingsServiceOptions] = None - __properties: ClassVar[List[str]] = ["id", "name", "type", "options"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + type: Optional[SettingsServiceIdentityProviderType] = Field( + default=None, alias="type" + ) + options: Optional[SettingsServiceOptions] = Field(default=None, alias="options") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,58 +35,9 @@ class SettingsServiceIdentityProvider(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceIdentityProvider from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of options - if self.options: - _dict['options'] = self.options.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceIdentityProvider from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), - "type": obj.get("type"), - "options": SettingsServiceOptions.from_dict(obj["options"]) if obj.get("options") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_identity_provider_type import ( + SettingsServiceIdentityProviderType, +) +from zitadel_client.models.settings_service_options import SettingsServiceOptions +SettingsServiceIdentityProvider.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_identity_provider_type.py b/zitadel_client/models/settings_service_identity_provider_type.py index 7cd00852..a6effeff 100644 --- a/zitadel_client/models/settings_service_identity_provider_type.py +++ b/zitadel_client/models/settings_service_identity_provider_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceIdentityProviderType(str, Enum): @@ -23,26 +13,18 @@ class SettingsServiceIdentityProviderType(str, Enum): SettingsServiceIdentityProviderType """ - """ - allowed enum values - """ - IDENTITY_PROVIDER_TYPE_UNSPECIFIED = 'IDENTITY_PROVIDER_TYPE_UNSPECIFIED' - IDENTITY_PROVIDER_TYPE_OIDC = 'IDENTITY_PROVIDER_TYPE_OIDC' - IDENTITY_PROVIDER_TYPE_JWT = 'IDENTITY_PROVIDER_TYPE_JWT' - IDENTITY_PROVIDER_TYPE_LDAP = 'IDENTITY_PROVIDER_TYPE_LDAP' - IDENTITY_PROVIDER_TYPE_OAUTH = 'IDENTITY_PROVIDER_TYPE_OAUTH' - IDENTITY_PROVIDER_TYPE_AZURE_AD = 'IDENTITY_PROVIDER_TYPE_AZURE_AD' - IDENTITY_PROVIDER_TYPE_GITHUB = 'IDENTITY_PROVIDER_TYPE_GITHUB' - IDENTITY_PROVIDER_TYPE_GITHUB_ES = 'IDENTITY_PROVIDER_TYPE_GITHUB_ES' - IDENTITY_PROVIDER_TYPE_GITLAB = 'IDENTITY_PROVIDER_TYPE_GITLAB' - IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = 'IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED' - IDENTITY_PROVIDER_TYPE_GOOGLE = 'IDENTITY_PROVIDER_TYPE_GOOGLE' - IDENTITY_PROVIDER_TYPE_SAML = 'IDENTITY_PROVIDER_TYPE_SAML' - IDENTITY_PROVIDER_TYPE_APPLE = 'IDENTITY_PROVIDER_TYPE_APPLE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceIdentityProviderType from a JSON string""" - return cls(json.loads(json_str)) - - + IDENTITY_PROVIDER_TYPE_UNSPECIFIED = "IDENTITY_PROVIDER_TYPE_UNSPECIFIED" + IDENTITY_PROVIDER_TYPE_OIDC = "IDENTITY_PROVIDER_TYPE_OIDC" + IDENTITY_PROVIDER_TYPE_JWT = "IDENTITY_PROVIDER_TYPE_JWT" + IDENTITY_PROVIDER_TYPE_LDAP = "IDENTITY_PROVIDER_TYPE_LDAP" + IDENTITY_PROVIDER_TYPE_OAUTH = "IDENTITY_PROVIDER_TYPE_OAUTH" + IDENTITY_PROVIDER_TYPE_AZURE_AD = "IDENTITY_PROVIDER_TYPE_AZURE_AD" + IDENTITY_PROVIDER_TYPE_GITHUB = "IDENTITY_PROVIDER_TYPE_GITHUB" + IDENTITY_PROVIDER_TYPE_GITHUB_ES = "IDENTITY_PROVIDER_TYPE_GITHUB_ES" + IDENTITY_PROVIDER_TYPE_GITLAB = "IDENTITY_PROVIDER_TYPE_GITLAB" + IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED = ( + "IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED" + ) + IDENTITY_PROVIDER_TYPE_GOOGLE = "IDENTITY_PROVIDER_TYPE_GOOGLE" + IDENTITY_PROVIDER_TYPE_SAML = "IDENTITY_PROVIDER_TYPE_SAML" + IDENTITY_PROVIDER_TYPE_APPLE = "IDENTITY_PROVIDER_TYPE_APPLE" diff --git a/zitadel_client/models/settings_service_legal_and_support_settings.py b/zitadel_client/models/settings_service_legal_and_support_settings.py index 66fbf264..a62628c0 100644 --- a/zitadel_client/models/settings_service_legal_and_support_settings.py +++ b/zitadel_client/models/settings_service_legal_and_support_settings.py @@ -1,42 +1,65 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SettingsServiceLegalAndSupportSettings(BaseModel): """ SettingsServiceLegalAndSupportSettings - """ # noqa: E501 - tos_link: Optional[StrictStr] = Field(default=None, description="Link to the Terms of Service. Can be a relative or absolute URL.", alias="tosLink") - privacy_policy_link: Optional[StrictStr] = Field(default=None, description="Link to the Privacy Policy. Can be a relative or absolute URL.", alias="privacyPolicyLink") - help_link: Optional[StrictStr] = Field(default=None, description="Link to a help page. Can be a relative or absolute URL.", alias="helpLink") - support_email: Optional[StrictStr] = Field(default=None, description="Email address for support issues.", alias="supportEmail") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - docs_link: Optional[StrictStr] = Field(default=None, description="Link to documentation to be shown in the console.", alias="docsLink") - custom_link: Optional[StrictStr] = Field(default=None, description="Link to an external resource that will be available to users in the console.", alias="customLink") - custom_link_text: Optional[StrictStr] = Field(default=None, description="The button text that would be shown in console pointing to custom link.", alias="customLinkText") - __properties: ClassVar[List[str]] = ["tosLink", "privacyPolicyLink", "helpLink", "supportEmail", "resourceOwnerType", "docsLink", "customLink", "customLinkText"] + """ + + tos_link: Optional[StrictStr] = Field( + default=None, + alias="tosLink", + description="Link to the Terms of Service. Can be a relative or absolute URL.", + ) + privacy_policy_link: Optional[StrictStr] = Field( + default=None, + alias="privacyPolicyLink", + description="Link to the Privacy Policy. Can be a relative or absolute URL.", + ) + help_link: Optional[StrictStr] = Field( + default=None, + alias="helpLink", + description="Link to a help page. Can be a relative or absolute URL.", + ) + support_email: Optional[StrictStr] = Field( + default=None, + alias="supportEmail", + description="Email address for support issues.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + docs_link: Optional[StrictStr] = Field( + default=None, + alias="docsLink", + description="Link to documentation to be shown in the console.", + ) + custom_link: Optional[StrictStr] = Field( + default=None, + alias="customLink", + description="Link to an external resource that will be available to users in the console.", + ) + custom_link_text: Optional[StrictStr] = Field( + default=None, + alias="customLinkText", + description="The button text that would be shown in console pointing to custom link.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,59 +67,8 @@ class SettingsServiceLegalAndSupportSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceLegalAndSupportSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceLegalAndSupportSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "tosLink": obj.get("tosLink"), - "privacyPolicyLink": obj.get("privacyPolicyLink"), - "helpLink": obj.get("helpLink"), - "supportEmail": obj.get("supportEmail"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "docsLink": obj.get("docsLink"), - "customLink": obj.get("customLink"), - "customLinkText": obj.get("customLinkText") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +SettingsServiceLegalAndSupportSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_list_details.py b/zitadel_client/models/settings_service_list_details.py index 653c4552..928c403f 100644 --- a/zitadel_client/models/settings_service_list_details.py +++ b/zitadel_client/models/settings_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SettingsServiceListDetails(BaseModel): """ SettingsServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class SettingsServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +SettingsServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_lockout_settings.py b/zitadel_client/models/settings_service_lockout_settings.py index cd493676..297cee4b 100644 --- a/zitadel_client/models/settings_service_lockout_settings.py +++ b/zitadel_client/models/settings_service_lockout_settings.py @@ -1,37 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SettingsServiceLockoutSettings(BaseModel): """ SettingsServiceLockoutSettings - """ # noqa: E501 - max_password_attempts: Optional[Any] = Field(default=None, description="The amount of failed password attempts before the account gets locked. Attempts are reset as soon as the password is entered correctly or the password is reset. If set to 0 the account will never be locked.", alias="maxPasswordAttempts") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - max_otp_attempts: Optional[Any] = Field(default=None, description="THe amount of failed OTP (TOTP, SMS, Email) attempts before the account gets locked. Attempts are reset as soon as the OTP is entered correctly. If set to 0 the account will never be locked.", alias="maxOtpAttempts") - __properties: ClassVar[List[str]] = ["maxPasswordAttempts", "resourceOwnerType", "maxOtpAttempts"] + """ + + max_password_attempts: Optional[object] = Field( + default=None, + alias="maxPasswordAttempts", + description="The amount of failed password attempts before the account gets locked. Attempts are reset as soon as the password is entered correctly or the password is reset. If set to 0 the account will never be locked.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + max_otp_attempts: Optional[object] = Field( + default=None, + alias="maxOtpAttempts", + description="THe amount of failed OTP (TOTP, SMS, Email) attempts before the account gets locked. Attempts are reset as soon as the OTP is entered correctly. If set to 0 the account will never be locked.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +41,8 @@ class SettingsServiceLockoutSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceLockoutSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if max_password_attempts (nullable) is None - # and model_fields_set contains the field - if self.max_password_attempts is None and "max_password_attempts" in self.model_fields_set: - _dict['maxPasswordAttempts'] = None - - # set to None if max_otp_attempts (nullable) is None - # and model_fields_set contains the field - if self.max_otp_attempts is None and "max_otp_attempts" in self.model_fields_set: - _dict['maxOtpAttempts'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceLockoutSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "maxPasswordAttempts": obj.get("maxPasswordAttempts"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "maxOtpAttempts": obj.get("maxOtpAttempts") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +SettingsServiceLockoutSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_login_settings.py b/zitadel_client/models/settings_service_login_settings.py index 43f23621..2a4fa75b 100644 --- a/zitadel_client/models/settings_service_login_settings.py +++ b/zitadel_client/models/settings_service_login_settings.py @@ -1,58 +1,141 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.settings_service_multi_factor_type import SettingsServiceMultiFactorType -from zitadel_client.models.settings_service_passkeys_type import SettingsServicePasskeysType -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from zitadel_client.models.settings_service_second_factor_type import SettingsServiceSecondFactorType -from typing import Optional, Set -from typing_extensions import Self +import warnings +from pydantic import BaseModel, ConfigDict, Field, field_validator +from pydantic import StrictBool, StrictStr +from typing import Any, List, Optional + class SettingsServiceLoginSettings(BaseModel): """ SettingsServiceLoginSettings - """ # noqa: E501 - allow_username_password: Optional[StrictBool] = Field(default=None, description="If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. Deprecated: check allow_local_authentication instead.", alias="allowUsernamePassword") - allow_local_authentication: Optional[StrictBool] = Field(default=None, description="If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled.", alias="allowLocalAuthentication") - allow_register: Optional[StrictBool] = Field(default=None, description="If enabled, users can register a local account by themself. This option does not effect external identity providers. Each identity provider can be configured to allow or disallow registration.", alias="allowRegister") - allow_external_idp: Optional[StrictBool] = Field(default=None, description="If enabled, users will generally be allowed to use an external identity provider to log in. Be sure to allow at least one external identity provider if this option is enabled.", alias="allowExternalIdp") - force_mfa: Optional[StrictBool] = Field(default=None, description="If enabled, users will be forced to use a multi-factor to log in. This also applies to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already.", alias="forceMfa") - passkeys_type: Optional[SettingsServicePasskeysType] = Field(default=None, alias="passkeysType") - hide_password_reset: Optional[StrictBool] = Field(default=None, description="If enabled, the password reset link will be hidden on the login screen.", alias="hidePasswordReset") - ignore_unknown_usernames: Optional[StrictBool] = Field(default=None, description="If enabled, an unknown username on the login screen will not return an error directly, but will always display the password screen. This prevents user enumeration attacks.", alias="ignoreUnknownUsernames") - default_redirect_uri: Optional[StrictStr] = Field(default=None, description="Defines where the user will be redirected to if the login is started without app context (e.g. from mail).", alias="defaultRedirectUri") - password_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="passwordCheckLifetime") - external_login_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="externalLoginCheckLifetime") - mfa_init_skip_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="mfaInitSkipLifetime") - second_factor_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="secondFactorCheckLifetime") - multi_factor_check_lifetime: Optional[StrictStr] = Field(default=None, description="A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like \"day\" or \"month\". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix \"s\" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as \"3s\", while 3 seconds and 1 nanosecond should be expressed in JSON format as \"3.000000001s\", and 3 seconds and 1 microsecond should be expressed in JSON format as \"3.000001s\".", alias="multiFactorCheckLifetime") - second_factors: Optional[List[SettingsServiceSecondFactorType]] = Field(default=None, description="The list of allowed second factors.", alias="secondFactors") - multi_factors: Optional[List[SettingsServiceMultiFactorType]] = Field(default=None, description="The list of allowed multi factors.", alias="multiFactors") - allow_domain_discovery: Optional[StrictBool] = Field(default=None, description="Allow discovery of the organization and its authentication option by domain. If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the organization domains and will redirect to the registration of that organization on success. The registration can either be locally (requires allow_register to be true) or through an external identity provider. In case only one identity provider is configured for the organization, the user will be redirected directly to the identity provider.", alias="allowDomainDiscovery") - disable_login_with_email: Optional[StrictBool] = Field(default=None, description="By default, users can login with their verified email address additionally to their login name. Setting this to true disables the email login. Note: If the email is set as the login name, this setting has no effect.", alias="disableLoginWithEmail") - disable_login_with_phone: Optional[StrictBool] = Field(default=None, description="By default, users can login with their verified phone number additionally to their login name. Setting this to true disables the phone number login. Note: If the phone number is set as the login name, this setting has no effect.", alias="disableLoginWithPhone") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - force_mfa_local_only: Optional[StrictBool] = Field(default=None, description="If enabled, users will be forced to use a multi-factor to log in if they authenticated locally. This does not apply to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. If both force_mfa and force_mfa_local_only are enabled, force_mfa takes precedence and all logins will require a second factor.", alias="forceMfaLocalOnly") - __properties: ClassVar[List[str]] = ["allowUsernamePassword", "allowLocalAuthentication", "allowRegister", "allowExternalIdp", "forceMfa", "passkeysType", "hidePasswordReset", "ignoreUnknownUsernames", "defaultRedirectUri", "passwordCheckLifetime", "externalLoginCheckLifetime", "mfaInitSkipLifetime", "secondFactorCheckLifetime", "multiFactorCheckLifetime", "secondFactors", "multiFactors", "allowDomainDiscovery", "disableLoginWithEmail", "disableLoginWithPhone", "resourceOwnerType", "forceMfaLocalOnly"] + """ + + # .. deprecated:: This property is deprecated. + allow_username_password: Optional[StrictBool] = Field( + default=None, + alias="allowUsernamePassword", + description="If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled. Deprecated: check allow_local_authentication instead.", + ) + allow_local_authentication: Optional[StrictBool] = Field( + default=None, + alias="allowLocalAuthentication", + description="If enabled, users can log in locally with their username and passkeys or password. Disabling this option will require users to log in with an external identity provider. Be sure to allow at least one external identity provider if this option is disabled.", + ) + allow_register: Optional[StrictBool] = Field( + default=None, + alias="allowRegister", + description="If enabled, users can register a local account by themself. This option does not effect external identity providers. Each identity provider can be configured to allow or disallow registration.", + ) + allow_external_idp: Optional[StrictBool] = Field( + default=None, + alias="allowExternalIdp", + description="If enabled, users will generally be allowed to use an external identity provider to log in. Be sure to allow at least one external identity provider if this option is enabled.", + ) + force_mfa: Optional[StrictBool] = Field( + default=None, + alias="forceMfa", + description="If enabled, users will be forced to use a multi-factor to log in. This also applies to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already.", + ) + passkeys_type: Optional[SettingsServicePasskeysType] = Field( + default=None, alias="passkeysType" + ) + hide_password_reset: Optional[StrictBool] = Field( + default=None, + alias="hidePasswordReset", + description="If enabled, the password reset link will be hidden on the login screen.", + ) + ignore_unknown_usernames: Optional[StrictBool] = Field( + default=None, + alias="ignoreUnknownUsernames", + description="If enabled, an unknown username on the login screen will not return an error directly, but will always display the password screen. This prevents user enumeration attacks.", + ) + default_redirect_uri: Optional[StrictStr] = Field( + default=None, + alias="defaultRedirectUri", + description="Defines where the user will be redirected to if the login is started without app context (e.g. from mail).", + ) + password_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="passwordCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + external_login_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="externalLoginCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + mfa_init_skip_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="mfaInitSkipLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + second_factor_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="secondFactorCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + multi_factor_check_lifetime: Optional[ProtobufDuration] = Field( + default=None, + alias="multiFactorCheckLifetime", + description='A Duration represents a signed, fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". It is related to Timestamp in that the difference between two Timestamp values is a Duration and it can be added or subtracted from a Timestamp. Range is approximately +-10,000 years. # Examples Example 1: Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos - start.nanos; if (duration.seconds < 0 && duration.nanos > 0) { duration.seconds += 1; duration.nanos -= 1000000000; } else if (duration.seconds > 0 && duration.nanos < 0) { duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos < 0) { end.seconds -= 1; end.nanos += 1000000000; } else if (end.nanos >= 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: Compute Duration from datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type is encoded as a string rather than an object, where the string ends in the suffix "s" (indicating seconds) and is preceded by the number of seconds, with nanoseconds expressed as fractional seconds. For example, 3 seconds with 0 nanoseconds should be encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should be expressed in JSON format as "3.000000001s", and 3 seconds and 1 microsecond should be expressed in JSON format as "3.000001s".', + ) + second_factors: Optional[List[SettingsServiceSecondFactorType]] = Field( + default=None, + alias="secondFactors", + description="The list of allowed second factors.", + ) + multi_factors: Optional[List[SettingsServiceMultiFactorType]] = Field( + default=None, + alias="multiFactors", + description="The list of allowed multi factors.", + ) + allow_domain_discovery: Optional[StrictBool] = Field( + default=None, + alias="allowDomainDiscovery", + description="Allow discovery of the organization and its authentication option by domain. If set to true, the suffix (@domain.com) of an unknown username input on the login screen will be matched against the organization domains and will redirect to the registration of that organization on success. The registration can either be locally (requires allow_register to be true) or through an external identity provider. In case only one identity provider is configured for the organization, the user will be redirected directly to the identity provider.", + ) + disable_login_with_email: Optional[StrictBool] = Field( + default=None, + alias="disableLoginWithEmail", + description="By default, users can login with their verified email address additionally to their login name. Setting this to true disables the email login. Note: If the email is set as the login name, this setting has no effect.", + ) + disable_login_with_phone: Optional[StrictBool] = Field( + default=None, + alias="disableLoginWithPhone", + description="By default, users can login with their verified phone number additionally to their login name. Setting this to true disables the phone number login. Note: If the phone number is set as the login name, this setting has no effect.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + force_mfa_local_only: Optional[StrictBool] = Field( + default=None, + alias="forceMfaLocalOnly", + description="If enabled, users will be forced to use a multi-factor to log in if they authenticated locally. This does not apply to federated logins through an external identity provider. Users will be required to set up a second factor if they have not done so already. If both force_mfa and force_mfa_local_only are enabled, force_mfa takes precedence and all logins will require a second factor.", + ) + @field_validator("allow_username_password") + def allow_username_password_warn_deprecated(cls, value: Any) -> Any: + """Emits a DeprecationWarning when the deprecated field `allow_username_password` is set.""" + if value is not None: + warnings.warn( + "field 'allow_username_password' on SettingsServiceLoginSettings is deprecated", + DeprecationWarning, + stacklevel=2, + ) + return value + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -60,72 +143,18 @@ class SettingsServiceLoginSettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceLoginSettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceLoginSettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "allowUsernamePassword": obj.get("allowUsernamePassword"), - "allowLocalAuthentication": obj.get("allowLocalAuthentication"), - "allowRegister": obj.get("allowRegister"), - "allowExternalIdp": obj.get("allowExternalIdp"), - "forceMfa": obj.get("forceMfa"), - "passkeysType": obj.get("passkeysType"), - "hidePasswordReset": obj.get("hidePasswordReset"), - "ignoreUnknownUsernames": obj.get("ignoreUnknownUsernames"), - "defaultRedirectUri": obj.get("defaultRedirectUri"), - "passwordCheckLifetime": obj.get("passwordCheckLifetime"), - "externalLoginCheckLifetime": obj.get("externalLoginCheckLifetime"), - "mfaInitSkipLifetime": obj.get("mfaInitSkipLifetime"), - "secondFactorCheckLifetime": obj.get("secondFactorCheckLifetime"), - "multiFactorCheckLifetime": obj.get("multiFactorCheckLifetime"), - "secondFactors": obj.get("secondFactors"), - "multiFactors": obj.get("multiFactors"), - "allowDomainDiscovery": obj.get("allowDomainDiscovery"), - "disableLoginWithEmail": obj.get("disableLoginWithEmail"), - "disableLoginWithPhone": obj.get("disableLoginWithPhone"), - "resourceOwnerType": obj.get("resourceOwnerType"), - "forceMfaLocalOnly": obj.get("forceMfaLocalOnly") - }) - return _obj - - +from zitadel_client._duration import ProtobufDuration +from zitadel_client.models.settings_service_multi_factor_type import ( + SettingsServiceMultiFactorType, +) +from zitadel_client.models.settings_service_passkeys_type import ( + SettingsServicePasskeysType, +) +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +from zitadel_client.models.settings_service_second_factor_type import ( + SettingsServiceSecondFactorType, +) + +SettingsServiceLoginSettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_multi_factor_type.py b/zitadel_client/models/settings_service_multi_factor_type.py index c5313ff5..23391a19 100644 --- a/zitadel_client/models/settings_service_multi_factor_type.py +++ b/zitadel_client/models/settings_service_multi_factor_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceMultiFactorType(str, Enum): @@ -23,15 +13,5 @@ class SettingsServiceMultiFactorType(str, Enum): SettingsServiceMultiFactorType """ - """ - allowed enum values - """ - MULTI_FACTOR_TYPE_UNSPECIFIED = 'MULTI_FACTOR_TYPE_UNSPECIFIED' - MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = 'MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceMultiFactorType from a JSON string""" - return cls(json.loads(json_str)) - - + MULTI_FACTOR_TYPE_UNSPECIFIED = "MULTI_FACTOR_TYPE_UNSPECIFIED" + MULTI_FACTOR_TYPE_U2_F_WITH_VERIFICATION = "MULTI_FACTOR_TYPE_U2F_WITH_VERIFICATION" diff --git a/zitadel_client/models/settings_service_options.py b/zitadel_client/models/settings_service_options.py index c56c9fac..01175d7a 100644 --- a/zitadel_client/models/settings_service_options.py +++ b/zitadel_client/models/settings_service_options.py @@ -1,39 +1,50 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_auto_linking_option import SettingsServiceAutoLinkingOption -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServiceOptions(BaseModel): """ SettingsServiceOptions - """ # noqa: E501 - is_linking_allowed: Optional[StrictBool] = Field(default=None, description="Enable if users should be able to link an existing ZITADEL user with an external account.", alias="isLinkingAllowed") - is_creation_allowed: Optional[StrictBool] = Field(default=None, description="Enable if users should be able to create a new account in ZITADEL when using an external account.", alias="isCreationAllowed") - is_auto_creation: Optional[StrictBool] = Field(default=None, description="Enable if a new account in ZITADEL should be created automatically when login with an external account.", alias="isAutoCreation") - is_auto_update: Optional[StrictBool] = Field(default=None, description="Enable if a the ZITADEL account fields should be updated automatically on each login.", alias="isAutoUpdate") - auto_linking: Optional[SettingsServiceAutoLinkingOption] = Field(default=None, alias="autoLinking") - __properties: ClassVar[List[str]] = ["isLinkingAllowed", "isCreationAllowed", "isAutoCreation", "isAutoUpdate", "autoLinking"] + """ + is_linking_allowed: Optional[StrictBool] = Field( + default=None, + alias="isLinkingAllowed", + description="Enable if users should be able to link an existing ZITADEL user with an external account.", + ) + is_creation_allowed: Optional[StrictBool] = Field( + default=None, + alias="isCreationAllowed", + description="Enable if users should be able to create a new account in ZITADEL when using an external account.", + ) + is_auto_creation: Optional[StrictBool] = Field( + default=None, + alias="isAutoCreation", + description="Enable if a new account in ZITADEL should be created automatically when login with an external account.", + ) + is_auto_update: Optional[StrictBool] = Field( + default=None, + alias="isAutoUpdate", + description="Enable if a the ZITADEL account fields should be updated automatically on each login.", + ) + auto_linking: Optional[SettingsServiceAutoLinkingOption] = Field( + default=None, alias="autoLinking" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,56 +52,8 @@ class SettingsServiceOptions(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceOptions from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceOptions from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "isLinkingAllowed": obj.get("isLinkingAllowed"), - "isCreationAllowed": obj.get("isCreationAllowed"), - "isAutoCreation": obj.get("isAutoCreation"), - "isAutoUpdate": obj.get("isAutoUpdate"), - "autoLinking": obj.get("autoLinking") - }) - return _obj - +from zitadel_client.models.settings_service_auto_linking_option import ( + SettingsServiceAutoLinkingOption, +) +SettingsServiceOptions.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_passkeys_type.py b/zitadel_client/models/settings_service_passkeys_type.py index 88939095..4df42690 100644 --- a/zitadel_client/models/settings_service_passkeys_type.py +++ b/zitadel_client/models/settings_service_passkeys_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServicePasskeysType(str, Enum): @@ -23,15 +13,5 @@ class SettingsServicePasskeysType(str, Enum): SettingsServicePasskeysType """ - """ - allowed enum values - """ - PASSKEYS_TYPE_NOT_ALLOWED = 'PASSKEYS_TYPE_NOT_ALLOWED' - PASSKEYS_TYPE_ALLOWED = 'PASSKEYS_TYPE_ALLOWED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServicePasskeysType from a JSON string""" - return cls(json.loads(json_str)) - - + PASSKEYS_TYPE_NOT_ALLOWED = "PASSKEYS_TYPE_NOT_ALLOWED" + PASSKEYS_TYPE_ALLOWED = "PASSKEYS_TYPE_ALLOWED" diff --git a/zitadel_client/models/settings_service_password_complexity_settings.py b/zitadel_client/models/settings_service_password_complexity_settings.py index efc9fe41..07db1e66 100644 --- a/zitadel_client/models/settings_service_password_complexity_settings.py +++ b/zitadel_client/models/settings_service_password_complexity_settings.py @@ -1,40 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServicePasswordComplexitySettings(BaseModel): """ SettingsServicePasswordComplexitySettings - """ # noqa: E501 - min_length: Optional[Any] = Field(default=None, description="The minimum length a password must have.", alias="minLength") - requires_uppercase: Optional[StrictBool] = Field(default=None, description="Defines if the password MUST contain an upper case letter.", alias="requiresUppercase") - requires_lowercase: Optional[StrictBool] = Field(default=None, description="Defines if the password MUST contain a lowercase letter.", alias="requiresLowercase") - requires_number: Optional[StrictBool] = Field(default=None, description="Defines if the password MUST contain a number.", alias="requiresNumber") - requires_symbol: Optional[StrictBool] = Field(default=None, description="Defines if the password MUST contain a symbol or special character. E.g. \"$\"", alias="requiresSymbol") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["minLength", "requiresUppercase", "requiresLowercase", "requiresNumber", "requiresSymbol", "resourceOwnerType"] + """ + min_length: Optional[object] = Field( + default=None, + alias="minLength", + description="The minimum length a password must have.", + ) + requires_uppercase: Optional[StrictBool] = Field( + default=None, + alias="requiresUppercase", + description="Defines if the password MUST contain an upper case letter.", + ) + requires_lowercase: Optional[StrictBool] = Field( + default=None, + alias="requiresLowercase", + description="Defines if the password MUST contain a lowercase letter.", + ) + requires_number: Optional[StrictBool] = Field( + default=None, + alias="requiresNumber", + description="Defines if the password MUST contain a number.", + ) + requires_symbol: Optional[StrictBool] = Field( + default=None, + alias="requiresSymbol", + description='Defines if the password MUST contain a symbol or special character. E.g. "$"', + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,62 +57,8 @@ class SettingsServicePasswordComplexitySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServicePasswordComplexitySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if min_length (nullable) is None - # and model_fields_set contains the field - if self.min_length is None and "min_length" in self.model_fields_set: - _dict['minLength'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServicePasswordComplexitySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "minLength": obj.get("minLength"), - "requiresUppercase": obj.get("requiresUppercase"), - "requiresLowercase": obj.get("requiresLowercase"), - "requiresNumber": obj.get("requiresNumber"), - "requiresSymbol": obj.get("requiresSymbol"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +SettingsServicePasswordComplexitySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_password_expiry_settings.py b/zitadel_client/models/settings_service_password_expiry_settings.py index 756af12f..cd61e5c8 100644 --- a/zitadel_client/models/settings_service_password_expiry_settings.py +++ b/zitadel_client/models/settings_service_password_expiry_settings.py @@ -1,37 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_resource_owner_type import SettingsServiceResourceOwnerType -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class SettingsServicePasswordExpirySettings(BaseModel): """ SettingsServicePasswordExpirySettings - """ # noqa: E501 - max_age_days: Optional[Any] = Field(default=None, description="Amount of days after which a password will expire. The user will be forced to change the password on the following authentication.", alias="maxAgeDays") - expire_warn_days: Optional[Any] = Field(default=None, description="Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user.", alias="expireWarnDays") - resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field(default=None, alias="resourceOwnerType") - __properties: ClassVar[List[str]] = ["maxAgeDays", "expireWarnDays", "resourceOwnerType"] + """ + + max_age_days: Optional[object] = Field( + default=None, + alias="maxAgeDays", + description="Amount of days after which a password will expire. The user will be forced to change the password on the following authentication.", + ) + expire_warn_days: Optional[object] = Field( + default=None, + alias="expireWarnDays", + description="Amount of days after which the user should be notified of the upcoming expiry. ZITADEL will not notify the user.", + ) + resource_owner_type: Optional[SettingsServiceResourceOwnerType] = Field( + default=None, alias="resourceOwnerType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +41,8 @@ class SettingsServicePasswordExpirySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServicePasswordExpirySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if max_age_days (nullable) is None - # and model_fields_set contains the field - if self.max_age_days is None and "max_age_days" in self.model_fields_set: - _dict['maxAgeDays'] = None - - # set to None if expire_warn_days (nullable) is None - # and model_fields_set contains the field - if self.expire_warn_days is None and "expire_warn_days" in self.model_fields_set: - _dict['expireWarnDays'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServicePasswordExpirySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "maxAgeDays": obj.get("maxAgeDays"), - "expireWarnDays": obj.get("expireWarnDays"), - "resourceOwnerType": obj.get("resourceOwnerType") - }) - return _obj - +from zitadel_client.models.settings_service_resource_owner_type import ( + SettingsServiceResourceOwnerType, +) +SettingsServicePasswordExpirySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_request_context.py b/zitadel_client/models/settings_service_request_context.py index a870d541..98a4be07 100644 --- a/zitadel_client/models/settings_service_request_context.py +++ b/zitadel_client/models/settings_service_request_context.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class SettingsServiceRequestContext(BaseModel): """ SettingsServiceRequestContext - """ # noqa: E501 - instance: Optional[StrictBool] = None + """ + + instance: Optional[StrictBool] = Field(default=None, alias="instance") org_id: Optional[StrictStr] = Field(default=None, alias="orgId") - __properties: ClassVar[List[str]] = ["instance", "orgId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class SettingsServiceRequestContext(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceRequestContext from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceRequestContext from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "instance": obj.get("instance"), - "orgId": obj.get("orgId") - }) - return _obj - - +SettingsServiceRequestContext.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_resource_owner_type.py b/zitadel_client/models/settings_service_resource_owner_type.py index 1daeb805..820326fc 100644 --- a/zitadel_client/models/settings_service_resource_owner_type.py +++ b/zitadel_client/models/settings_service_resource_owner_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceResourceOwnerType(str, Enum): @@ -23,16 +13,6 @@ class SettingsServiceResourceOwnerType(str, Enum): SettingsServiceResourceOwnerType """ - """ - allowed enum values - """ - RESOURCE_OWNER_TYPE_UNSPECIFIED = 'RESOURCE_OWNER_TYPE_UNSPECIFIED' - RESOURCE_OWNER_TYPE_INSTANCE = 'RESOURCE_OWNER_TYPE_INSTANCE' - RESOURCE_OWNER_TYPE_ORG = 'RESOURCE_OWNER_TYPE_ORG' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceResourceOwnerType from a JSON string""" - return cls(json.loads(json_str)) - - + RESOURCE_OWNER_TYPE_UNSPECIFIED = "RESOURCE_OWNER_TYPE_UNSPECIFIED" + RESOURCE_OWNER_TYPE_INSTANCE = "RESOURCE_OWNER_TYPE_INSTANCE" + RESOURCE_OWNER_TYPE_ORG = "RESOURCE_OWNER_TYPE_ORG" diff --git a/zitadel_client/models/settings_service_second_factor_type.py b/zitadel_client/models/settings_service_second_factor_type.py index 12c41462..7afa8860 100644 --- a/zitadel_client/models/settings_service_second_factor_type.py +++ b/zitadel_client/models/settings_service_second_factor_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceSecondFactorType(str, Enum): @@ -23,20 +13,10 @@ class SettingsServiceSecondFactorType(str, Enum): SettingsServiceSecondFactorType """ - """ - allowed enum values - """ - SECOND_FACTOR_TYPE_UNSPECIFIED = 'SECOND_FACTOR_TYPE_UNSPECIFIED' - SECOND_FACTOR_TYPE_OTP = 'SECOND_FACTOR_TYPE_OTP' - SECOND_FACTOR_TYPE_TOTP = 'SECOND_FACTOR_TYPE_TOTP' - SECOND_FACTOR_TYPE_U2_F = 'SECOND_FACTOR_TYPE_U2F' - SECOND_FACTOR_TYPE_OTP_EMAIL = 'SECOND_FACTOR_TYPE_OTP_EMAIL' - SECOND_FACTOR_TYPE_OTP_SMS = 'SECOND_FACTOR_TYPE_OTP_SMS' - SECOND_FACTOR_TYPE_RECOVERY_CODES = 'SECOND_FACTOR_TYPE_RECOVERY_CODES' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceSecondFactorType from a JSON string""" - return cls(json.loads(json_str)) - - + SECOND_FACTOR_TYPE_UNSPECIFIED = "SECOND_FACTOR_TYPE_UNSPECIFIED" + SECOND_FACTOR_TYPE_OTP = "SECOND_FACTOR_TYPE_OTP" + SECOND_FACTOR_TYPE_TOTP = "SECOND_FACTOR_TYPE_TOTP" + SECOND_FACTOR_TYPE_U2_F = "SECOND_FACTOR_TYPE_U2F" + SECOND_FACTOR_TYPE_OTP_EMAIL = "SECOND_FACTOR_TYPE_OTP_EMAIL" + SECOND_FACTOR_TYPE_OTP_SMS = "SECOND_FACTOR_TYPE_OTP_SMS" + SECOND_FACTOR_TYPE_RECOVERY_CODES = "SECOND_FACTOR_TYPE_RECOVERY_CODES" diff --git a/zitadel_client/models/settings_service_security_settings.py b/zitadel_client/models/settings_service_security_settings.py index 455b876d..9a8cfff9 100644 --- a/zitadel_client/models/settings_service_security_settings.py +++ b/zitadel_client/models/settings_service_security_settings.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_embedded_iframe_settings import SettingsServiceEmbeddedIframeSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServiceSecuritySettings(BaseModel): """ SettingsServiceSecuritySettings - """ # noqa: E501 - embedded_iframe: Optional[SettingsServiceEmbeddedIframeSettings] = Field(default=None, alias="embeddedIframe") - enable_impersonation: Optional[StrictBool] = Field(default=None, description="If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\".", alias="enableImpersonation") - __properties: ClassVar[List[str]] = ["embeddedIframe", "enableImpersonation"] + """ + + embedded_iframe: Optional[SettingsServiceEmbeddedIframeSettings] = Field( + default=None, alias="embeddedIframe" + ) + enable_impersonation: Optional[StrictBool] = Field( + default=None, + alias="enableImpersonation", + description='If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well".', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +37,8 @@ class SettingsServiceSecuritySettings(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceSecuritySettings from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of embedded_iframe - if self.embedded_iframe: - _dict['embeddedIframe'] = self.embedded_iframe.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceSecuritySettings from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "embeddedIframe": SettingsServiceEmbeddedIframeSettings.from_dict(obj["embeddedIframe"]) if obj.get("embeddedIframe") is not None else None, - "enableImpersonation": obj.get("enableImpersonation") - }) - return _obj - +from zitadel_client.models.settings_service_embedded_iframe_settings import ( + SettingsServiceEmbeddedIframeSettings, +) +SettingsServiceSecuritySettings.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_set_hosted_login_translation_request.py b/zitadel_client/models/settings_service_set_hosted_login_translation_request.py index f5768fdd..e4ad7070 100644 --- a/zitadel_client/models/settings_service_set_hosted_login_translation_request.py +++ b/zitadel_client/models/settings_service_set_hosted_login_translation_request.py @@ -1,37 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Dict, Optional + class SettingsServiceSetHostedLoginTranslationRequest(BaseModel): """ SettingsServiceSetHostedLoginTranslationRequest - """ # noqa: E501 - locale: Optional[StrictStr] = Field(default=None, description="The locale of the translations to be set. Needs to be a BCP 47 language tag (e.g. \"en\", \"de\", \"fr-CH\").") - translations: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.") - instance: Optional[StrictBool] = None + """ + + locale: Optional[StrictStr] = Field( + default=None, + alias="locale", + description='The locale of the translations to be set. Needs to be a BCP 47 language tag (e.g. "en", "de", "fr-CH").', + ) + translations: Optional[Dict[str, object]] = Field( + default=None, + alias="translations", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + instance: Optional[StrictBool] = Field(default=None, alias="instance") organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["locale", "translations", "instance", "organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +41,4 @@ class SettingsServiceSetHostedLoginTranslationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceSetHostedLoginTranslationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceSetHostedLoginTranslationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "locale": obj.get("locale"), - "translations": obj.get("translations"), - "instance": obj.get("instance"), - "organizationId": obj.get("organizationId") - }) - return _obj - - +SettingsServiceSetHostedLoginTranslationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_set_hosted_login_translation_response.py b/zitadel_client/models/settings_service_set_hosted_login_translation_response.py index 004e9145..50d6424a 100644 --- a/zitadel_client/models/settings_service_set_hosted_login_translation_response.py +++ b/zitadel_client/models/settings_service_set_hosted_login_translation_response.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SettingsServiceSetHostedLoginTranslationResponse(BaseModel): """ SettingsServiceSetHostedLoginTranslationResponse - """ # noqa: E501 - etag: Optional[StrictStr] = Field(default=None, description="hash of the saved translation. Valid only when ignore_inheritance = true") - __properties: ClassVar[List[str]] = ["etag"] + """ + etag: Optional[StrictStr] = Field( + default=None, + alias="etag", + description="hash of the saved translation. Valid only when ignore_inheritance = true", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class SettingsServiceSetHostedLoginTranslationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceSetHostedLoginTranslationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceSetHostedLoginTranslationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "etag": obj.get("etag") - }) - return _obj - - +SettingsServiceSetHostedLoginTranslationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_set_security_settings_request.py b/zitadel_client/models/settings_service_set_security_settings_request.py index a5342d2d..8be59ed5 100644 --- a/zitadel_client/models/settings_service_set_security_settings_request.py +++ b/zitadel_client/models/settings_service_set_security_settings_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_embedded_iframe_settings import SettingsServiceEmbeddedIframeSettings -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool +from typing import Optional + class SettingsServiceSetSecuritySettingsRequest(BaseModel): """ SettingsServiceSetSecuritySettingsRequest - """ # noqa: E501 - embedded_iframe: Optional[SettingsServiceEmbeddedIframeSettings] = Field(default=None, alias="embeddedIframe") - enable_impersonation: Optional[StrictBool] = Field(default=None, description="If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well\".", alias="enableImpersonation") - __properties: ClassVar[List[str]] = ["embeddedIframe", "enableImpersonation"] + """ + + embedded_iframe: Optional[SettingsServiceEmbeddedIframeSettings] = Field( + default=None, alias="embeddedIframe" + ) + enable_impersonation: Optional[StrictBool] = Field( + default=None, + alias="enableImpersonation", + description='If enabled, users are allowed to impersonate other users. The impersonator needs the appropriate `*_IMPERSONATOR` roles assigned as well".', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +37,8 @@ class SettingsServiceSetSecuritySettingsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceSetSecuritySettingsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of embedded_iframe - if self.embedded_iframe: - _dict['embeddedIframe'] = self.embedded_iframe.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceSetSecuritySettingsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "embeddedIframe": SettingsServiceEmbeddedIframeSettings.from_dict(obj["embeddedIframe"]) if obj.get("embeddedIframe") is not None else None, - "enableImpersonation": obj.get("enableImpersonation") - }) - return _obj - +from zitadel_client.models.settings_service_embedded_iframe_settings import ( + SettingsServiceEmbeddedIframeSettings, +) +SettingsServiceSetSecuritySettingsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_set_security_settings_response.py b/zitadel_client/models/settings_service_set_security_settings_response.py index a480edc7..4ae354a0 100644 --- a/zitadel_client/models/settings_service_set_security_settings_response.py +++ b/zitadel_client/models/settings_service_set_security_settings_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.settings_service_details import SettingsServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class SettingsServiceSetSecuritySettingsResponse(BaseModel): """ SettingsServiceSetSecuritySettingsResponse - """ # noqa: E501 - details: Optional[SettingsServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[SettingsServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class SettingsServiceSetSecuritySettingsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceSetSecuritySettingsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceSetSecuritySettingsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": SettingsServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.settings_service_details import SettingsServiceDetails +SettingsServiceSetSecuritySettingsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_theme.py b/zitadel_client/models/settings_service_theme.py index 61ffeebb..95e644f3 100644 --- a/zitadel_client/models/settings_service_theme.py +++ b/zitadel_client/models/settings_service_theme.py @@ -1,39 +1,49 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class SettingsServiceTheme(BaseModel): """ SettingsServiceTheme - """ # noqa: E501 - primary_color: Optional[StrictStr] = Field(default=None, description="The hex value for primary color.", alias="primaryColor") - background_color: Optional[StrictStr] = Field(default=None, description="The hex value for background color.", alias="backgroundColor") - warn_color: Optional[StrictStr] = Field(default=None, description="The hex value for warning color.", alias="warnColor") - font_color: Optional[StrictStr] = Field(default=None, description="The value for font color.", alias="fontColor") - logo_url: Optional[StrictStr] = Field(default=None, description="The URL where the logo is served.", alias="logoUrl") - icon_url: Optional[StrictStr] = Field(default=None, description="The URL where the icon is served.", alias="iconUrl") - __properties: ClassVar[List[str]] = ["primaryColor", "backgroundColor", "warnColor", "fontColor", "logoUrl", "iconUrl"] + """ + primary_color: Optional[StrictStr] = Field( + default=None, + alias="primaryColor", + description="The hex value for primary color.", + ) + background_color: Optional[StrictStr] = Field( + default=None, + alias="backgroundColor", + description="The hex value for background color.", + ) + warn_color: Optional[StrictStr] = Field( + default=None, alias="warnColor", description="The hex value for warning color." + ) + font_color: Optional[StrictStr] = Field( + default=None, alias="fontColor", description="The value for font color." + ) + logo_url: Optional[StrictStr] = Field( + default=None, alias="logoUrl", description="The URL where the logo is served." + ) + icon_url: Optional[StrictStr] = Field( + default=None, alias="iconUrl", description="The URL where the icon is served." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,57 +51,4 @@ class SettingsServiceTheme(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SettingsServiceTheme from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SettingsServiceTheme from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "primaryColor": obj.get("primaryColor"), - "backgroundColor": obj.get("backgroundColor"), - "warnColor": obj.get("warnColor"), - "fontColor": obj.get("fontColor"), - "logoUrl": obj.get("logoUrl"), - "iconUrl": obj.get("iconUrl") - }) - return _obj - - +SettingsServiceTheme.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/settings_service_theme_mode.py b/zitadel_client/models/settings_service_theme_mode.py index 90bf21f0..affb7f2f 100644 --- a/zitadel_client/models/settings_service_theme_mode.py +++ b/zitadel_client/models/settings_service_theme_mode.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class SettingsServiceThemeMode(str, Enum): @@ -23,17 +13,7 @@ class SettingsServiceThemeMode(str, Enum): SettingsServiceThemeMode """ - """ - allowed enum values - """ - THEME_MODE_UNSPECIFIED = 'THEME_MODE_UNSPECIFIED' - THEME_MODE_AUTO = 'THEME_MODE_AUTO' - THEME_MODE_LIGHT = 'THEME_MODE_LIGHT' - THEME_MODE_DARK = 'THEME_MODE_DARK' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SettingsServiceThemeMode from a JSON string""" - return cls(json.loads(json_str)) - - + THEME_MODE_UNSPECIFIED = "THEME_MODE_UNSPECIFIED" + THEME_MODE_AUTO = "THEME_MODE_AUTO" + THEME_MODE_LIGHT = "THEME_MODE_LIGHT" + THEME_MODE_DARK = "THEME_MODE_DARK" diff --git a/zitadel_client/models/user_service_access_token_type.py b/zitadel_client/models/user_service_access_token_type.py index ab8fbcf7..f8c147b9 100644 --- a/zitadel_client/models/user_service_access_token_type.py +++ b/zitadel_client/models/user_service_access_token_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceAccessTokenType(str, Enum): @@ -23,15 +13,5 @@ class UserServiceAccessTokenType(str, Enum): UserServiceAccessTokenType """ - """ - allowed enum values - """ - ACCESS_TOKEN_TYPE_BEARER = 'ACCESS_TOKEN_TYPE_BEARER' - ACCESS_TOKEN_TYPE_JWT = 'ACCESS_TOKEN_TYPE_JWT' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceAccessTokenType from a JSON string""" - return cls(json.loads(json_str)) - - + ACCESS_TOKEN_TYPE_BEARER = "ACCESS_TOKEN_TYPE_BEARER" + ACCESS_TOKEN_TYPE_JWT = "ACCESS_TOKEN_TYPE_JWT" diff --git a/zitadel_client/models/user_service_add_human_user_request.py b/zitadel_client/models/user_service_add_human_user_request.py index 1c765bdc..91865fb1 100644 --- a/zitadel_client/models/user_service_add_human_user_request.py +++ b/zitadel_client/models/user_service_add_human_user_request.py @@ -1,52 +1,58 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_hashed_password import UserServiceHashedPassword -from zitadel_client.models.user_service_idp_link import UserServiceIDPLink -from zitadel_client.models.user_service_organization import UserServiceOrganization -from zitadel_client.models.user_service_password import UserServicePassword -from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail -from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone -from zitadel_client.models.user_service_set_human_profile import UserServiceSetHumanProfile -from zitadel_client.models.user_service_set_metadata_entry import UserServiceSetMetadataEntry -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceAddHumanUserRequest(BaseModel): """ UserServiceAddHumanUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="optionally set your own id unique for the user.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="optionally set a unique username, if none is provided the email will be used.") - organization: Optional[UserServiceOrganization] = None - profile: Optional[UserServiceSetHumanProfile] = None - email: Optional[UserServiceSetHumanEmail] = None - phone: Optional[UserServiceSetHumanPhone] = None - metadata: Optional[List[UserServiceSetMetadataEntry]] = None - idp_links: Optional[List[UserServiceIDPLink]] = Field(default=None, alias="idpLinks") - totp_secret: Optional[StrictStr] = Field(default=None, description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", alias="totpSecret") - hashed_password: Optional[UserServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[UserServicePassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "organization", "profile", "email", "phone", "metadata", "idpLinks", "totpSecret", "hashedPassword", "password"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="optionally set your own id unique for the user.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="optionally set a unique username, if none is provided the email will be used.", + ) + organization: Optional[UserServiceOrganization] = Field( + default=None, alias="organization" + ) + profile: Optional[UserServiceSetHumanProfile] = Field(default=None, alias="profile") + email: Optional[UserServiceSetHumanEmail] = Field(default=None, alias="email") + phone: Optional[UserServiceSetHumanPhone] = Field(default=None, alias="phone") + metadata: Optional[List[UserServiceSetMetadataEntry]] = Field( + default=None, alias="metadata" + ) + idp_links: Optional[List[UserServiceIDPLink]] = Field( + default=None, alias="idpLinks" + ) + totp_secret: Optional[StrictStr] = Field( + default=None, + alias="totpSecret", + description="An Implementation of RFC 6238 is used, with HMAC-SHA-1 and time-step of 30 seconds. Currently no other options are supported, and if anything different is used the validation will fail.", + ) + hashed_password: Optional[UserServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[UserServicePassword] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -54,109 +60,17 @@ class UserServiceAddHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of organization - if self.organization: - _dict['organization'] = self.organization.to_dict() - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in idp_links (list) - _items = [] - if self.idp_links: - for _item_idp_links in self.idp_links: - if _item_idp_links: - _items.append(_item_idp_links.to_dict()) - _dict['idpLinks'] = _items - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if user_id (nullable) is None - # and model_fields_set contains the field - if self.user_id is None and "user_id" in self.model_fields_set: - _dict['userId'] = None - - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - # set to None if totp_secret (nullable) is None - # and model_fields_set contains the field - if self.totp_secret is None and "totp_secret" in self.model_fields_set: - _dict['totpSecret'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "organization": UserServiceOrganization.from_dict(obj["organization"]) if obj.get("organization") is not None else None, - "profile": UserServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": UserServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": UserServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "metadata": [UserServiceSetMetadataEntry.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None, - "idpLinks": [UserServiceIDPLink.from_dict(_item) for _item in obj["idpLinks"]] if obj.get("idpLinks") is not None else None, - "totpSecret": obj.get("totpSecret"), - "hashedPassword": UserServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": UserServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - - +from zitadel_client.models.user_service_hashed_password import UserServiceHashedPassword +from zitadel_client.models.user_service_idp_link import UserServiceIDPLink +from zitadel_client.models.user_service_organization import UserServiceOrganization +from zitadel_client.models.user_service_password import UserServicePassword +from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail +from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone +from zitadel_client.models.user_service_set_human_profile import ( + UserServiceSetHumanProfile, +) +from zitadel_client.models.user_service_set_metadata_entry import ( + UserServiceSetMetadataEntry, +) + +UserServiceAddHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_human_user_response.py b/zitadel_client/models/user_service_add_human_user_response.py index 142938fc..11a079e6 100644 --- a/zitadel_client/models/user_service_add_human_user_response.py +++ b/zitadel_client/models/user_service_add_human_user_response.py @@ -1,38 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddHumanUserResponse(BaseModel): """ UserServiceAddHumanUserResponse - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - details: Optional[UserServiceDetails] = None + details: Optional[UserServiceDetails] = Field(default=None, alias="details") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["userId", "details", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,68 +33,6 @@ class UserServiceAddHumanUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddHumanUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddHumanUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceAddHumanUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_idp_link_request.py b/zitadel_client/models/user_service_add_idp_link_request.py index 51baed64..2ef370f3 100644 --- a/zitadel_client/models/user_service_add_idp_link_request.py +++ b/zitadel_client/models/user_service_add_idp_link_request.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_idp_link import UserServiceIDPLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddIDPLinkRequest(BaseModel): """ UserServiceAddIDPLinkRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") idp_link: Optional[UserServiceIDPLink] = Field(default=None, alias="idpLink") - __properties: ClassVar[List[str]] = ["userId", "idpLink"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +31,6 @@ class UserServiceAddIDPLinkRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddIDPLinkRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of idp_link - if self.idp_link: - _dict['idpLink'] = self.idp_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddIDPLinkRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "idpLink": UserServiceIDPLink.from_dict(obj["idpLink"]) if obj.get("idpLink") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_idp_link import UserServiceIDPLink +UserServiceAddIDPLinkRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_idp_link_response.py b/zitadel_client/models/user_service_add_idp_link_response.py index 57266e5f..3227989b 100644 --- a/zitadel_client/models/user_service_add_idp_link_response.py +++ b/zitadel_client/models/user_service_add_idp_link_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceAddIDPLinkResponse(BaseModel): """ UserServiceAddIDPLinkResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceAddIDPLinkResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddIDPLinkResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddIDPLinkResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceAddIDPLinkResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_key_request.py b/zitadel_client/models/user_service_add_key_request.py index 8384ec3c..f9557be8 100644 --- a/zitadel_client/models/user_service_add_key_request.py +++ b/zitadel_client/models/user_service_add_key_request.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddKeyRequest(BaseModel): """ UserServiceAddKeyRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - public_key: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Optionally provide a public key of your own generated RSA private key.", alias="publicKey") - __properties: ClassVar[List[str]] = ["userId", "expirationDate", "publicKey"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + public_key: Optional[Base64Bytes] = Field( + default=None, + alias="publicKey", + description="Optionally provide a public key of your own generated RSA private key.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,7 @@ class UserServiceAddKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "expirationDate": obj.get("expirationDate"), - "publicKey": obj.get("publicKey") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +UserServiceAddKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_key_response.py b/zitadel_client/models/user_service_add_key_response.py index 16053ba6..81982aac 100644 --- a/zitadel_client/models/user_service_add_key_response.py +++ b/zitadel_client/models/user_service_add_key_response.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddKeyResponse(BaseModel): """ UserServiceAddKeyResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - key_id: Optional[StrictStr] = Field(default=None, description="The keys ID.", alias="keyId") - key_content: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="The key which is usable to authenticate against the API.", alias="keyContent") - __properties: ClassVar[List[str]] = ["creationDate", "keyId", "keyContent"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + key_id: Optional[StrictStr] = Field( + default=None, alias="keyId", description="The keys ID." + ) + key_content: Optional[Base64Bytes] = Field( + default=None, + alias="keyContent", + description="The key which is usable to authenticate against the API.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,7 @@ class UserServiceAddKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "keyId": obj.get("keyId"), - "keyContent": obj.get("keyContent") - }) - return _obj - +from pydantic import AwareDatetime +from pydantic import Base64Bytes +UserServiceAddKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_otp_email_request.py b/zitadel_client/models/user_service_add_otp_email_request.py index be85b7ef..5a4d5fcf 100644 --- a/zitadel_client/models/user_service_add_otp_email_request.py +++ b/zitadel_client/models/user_service_add_otp_email_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddOTPEmailRequest(BaseModel): """ UserServiceAddOTPEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceAddOTPEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddOTPEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddOTPEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceAddOTPEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_otp_email_response.py b/zitadel_client/models/user_service_add_otp_email_response.py index 7f4d0c34..97a6b848 100644 --- a/zitadel_client/models/user_service_add_otp_email_response.py +++ b/zitadel_client/models/user_service_add_otp_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceAddOTPEmailResponse(BaseModel): """ UserServiceAddOTPEmailResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceAddOTPEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddOTPEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddOTPEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceAddOTPEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_otpsms_request.py b/zitadel_client/models/user_service_add_otpsms_request.py index 152d01ab..5aed7b70 100644 --- a/zitadel_client/models/user_service_add_otpsms_request.py +++ b/zitadel_client/models/user_service_add_otpsms_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddOTPSMSRequest(BaseModel): """ UserServiceAddOTPSMSRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceAddOTPSMSRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddOTPSMSRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddOTPSMSRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceAddOTPSMSRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_otpsms_response.py b/zitadel_client/models/user_service_add_otpsms_response.py index 263bd026..57d240af 100644 --- a/zitadel_client/models/user_service_add_otpsms_response.py +++ b/zitadel_client/models/user_service_add_otpsms_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceAddOTPSMSResponse(BaseModel): """ UserServiceAddOTPSMSResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceAddOTPSMSResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddOTPSMSResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddOTPSMSResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceAddOTPSMSResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_personal_access_token_request.py b/zitadel_client/models/user_service_add_personal_access_token_request.py index ba344453..7a06024f 100644 --- a/zitadel_client/models/user_service_add_personal_access_token_request.py +++ b/zitadel_client/models/user_service_add_personal_access_token_request.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddPersonalAccessTokenRequest(BaseModel): """ UserServiceAddPersonalAccessTokenRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["userId", "expirationDate"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +37,6 @@ class UserServiceAddPersonalAccessTokenRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddPersonalAccessTokenRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddPersonalAccessTokenRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceAddPersonalAccessTokenRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_personal_access_token_response.py b/zitadel_client/models/user_service_add_personal_access_token_response.py index 9731e86e..f4f17bf9 100644 --- a/zitadel_client/models/user_service_add_personal_access_token_response.py +++ b/zitadel_client/models/user_service_add_personal_access_token_response.py @@ -1,37 +1,40 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddPersonalAccessTokenResponse(BaseModel): """ UserServiceAddPersonalAccessTokenResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - token_id: Optional[StrictStr] = Field(default=None, description="The tokens ID.", alias="tokenId") - token: Optional[StrictStr] = Field(default=None, description="The personal access token that can be used to authenticate against the API") - __properties: ClassVar[List[str]] = ["creationDate", "tokenId", "token"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + token_id: Optional[StrictStr] = Field( + default=None, alias="tokenId", description="The tokens ID." + ) + token: Optional[StrictStr] = Field( + default=None, + alias="token", + description="The personal access token that can be used to authenticate against the API", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +42,6 @@ class UserServiceAddPersonalAccessTokenResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddPersonalAccessTokenResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddPersonalAccessTokenResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "tokenId": obj.get("tokenId"), - "token": obj.get("token") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceAddPersonalAccessTokenResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_secret_request.py b/zitadel_client/models/user_service_add_secret_request.py index f19028a0..bf37786a 100644 --- a/zitadel_client/models/user_service_add_secret_request.py +++ b/zitadel_client/models/user_service_add_secret_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddSecretRequest(BaseModel): """ UserServiceAddSecretRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class UserServiceAddSecretRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddSecretRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddSecretRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceAddSecretRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_add_secret_response.py b/zitadel_client/models/user_service_add_secret_response.py index 0d966d4c..ad213c40 100644 --- a/zitadel_client/models/user_service_add_secret_response.py +++ b/zitadel_client/models/user_service_add_secret_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAddSecretResponse(BaseModel): """ UserServiceAddSecretResponse - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - client_secret: Optional[StrictStr] = Field(default=None, description="The client secret. Store this secret in a secure place. It is not possible to retrieve it again.", alias="clientSecret") - __properties: ClassVar[List[str]] = ["creationDate", "clientSecret"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + client_secret: Optional[StrictStr] = Field( + default=None, + alias="clientSecret", + description="The client secret. Store this secret in a secure place. It is not possible to retrieve it again.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class UserServiceAddSecretResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAddSecretResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAddSecretResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "clientSecret": obj.get("clientSecret") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceAddSecretResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_and_query.py b/zitadel_client/models/user_service_and_query.py index bc471a35..23b0c957 100644 --- a/zitadel_client/models/user_service_and_query.py +++ b/zitadel_client/models/user_service_and_query.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceAndQuery(BaseModel): """ Connect multiple sub-condition with and AND operator. - """ # noqa: E501 - queries: Optional[List[UserServiceSearchQuery]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + + queries: Optional[List[UserServiceSearchQuery]] = Field( + default=None, alias="queries" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,6 @@ class UserServiceAndQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAndQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAndQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [UserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - from zitadel_client.models.user_service_search_query import UserServiceSearchQuery -# TODO: Rewrite to not use raise_errors -UserServiceAndQuery.model_rebuild(raise_errors=False) +UserServiceAndQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_any.py b/zitadel_client/models/user_service_any.py index 659a3617..33923faa 100644 --- a/zitadel_client/models/user_service_any.py +++ b/zitadel_client/models/user_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class UserServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +UserServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_auth_factor.py b/zitadel_client/models/user_service_auth_factor.py index 9199ad0e..577118a1 100644 --- a/zitadel_client/models/user_service_auth_factor.py +++ b/zitadel_client/models/user_service_auth_factor.py @@ -1,40 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_auth_factor_state import UserServiceAuthFactorState -from zitadel_client.models.user_service_auth_factor_u2_f import UserServiceAuthFactorU2F -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceAuthFactor(BaseModel): """ UserServiceAuthFactor - """ # noqa: E501 - state: Optional[UserServiceAuthFactorState] = None - otp: Optional[Dict[str, Any]] = None - otp_email: Optional[Dict[str, Any]] = Field(default=None, alias="otpEmail") - otp_sms: Optional[Dict[str, Any]] = Field(default=None, alias="otpSms") - u2f: Optional[UserServiceAuthFactorU2F] = None - __properties: ClassVar[List[str]] = ["state", "otp", "otpEmail", "otpSms", "u2f"] + """ + state: Optional[UserServiceAuthFactorState] = Field(default=None, alias="state") + otp: Optional[object] = Field(default=None, alias="otp") + otp_email: Optional[object] = Field(default=None, alias="otpEmail") + otp_sms: Optional[object] = Field(default=None, alias="otpSms") + u2f: Optional[UserServiceAuthFactorU2F] = Field(default=None, alias="u2f") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,59 +33,9 @@ class UserServiceAuthFactor(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAuthFactor from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of u2f - if self.u2f: - _dict['u2f'] = self.u2f.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAuthFactor from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state"), - "otp": obj.get("otp"), - "otpEmail": obj.get("otpEmail"), - "otpSms": obj.get("otpSms"), - "u2f": UserServiceAuthFactorU2F.from_dict(obj["u2f"]) if obj.get("u2f") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_auth_factor_state import ( + UserServiceAuthFactorState, +) +from zitadel_client.models.user_service_auth_factor_u2_f import UserServiceAuthFactorU2F +UserServiceAuthFactor.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_auth_factor_state.py b/zitadel_client/models/user_service_auth_factor_state.py index f4d63c48..834f5a95 100644 --- a/zitadel_client/models/user_service_auth_factor_state.py +++ b/zitadel_client/models/user_service_auth_factor_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceAuthFactorState(str, Enum): @@ -23,17 +13,7 @@ class UserServiceAuthFactorState(str, Enum): UserServiceAuthFactorState """ - """ - allowed enum values - """ - AUTH_FACTOR_STATE_UNSPECIFIED = 'AUTH_FACTOR_STATE_UNSPECIFIED' - AUTH_FACTOR_STATE_NOT_READY = 'AUTH_FACTOR_STATE_NOT_READY' - AUTH_FACTOR_STATE_READY = 'AUTH_FACTOR_STATE_READY' - AUTH_FACTOR_STATE_REMOVED = 'AUTH_FACTOR_STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceAuthFactorState from a JSON string""" - return cls(json.loads(json_str)) - - + AUTH_FACTOR_STATE_UNSPECIFIED = "AUTH_FACTOR_STATE_UNSPECIFIED" + AUTH_FACTOR_STATE_NOT_READY = "AUTH_FACTOR_STATE_NOT_READY" + AUTH_FACTOR_STATE_READY = "AUTH_FACTOR_STATE_READY" + AUTH_FACTOR_STATE_REMOVED = "AUTH_FACTOR_STATE_REMOVED" diff --git a/zitadel_client/models/user_service_auth_factor_u2_f.py b/zitadel_client/models/user_service_auth_factor_u2_f.py index d73a4aac..a9e04eab 100644 --- a/zitadel_client/models/user_service_auth_factor_u2_f.py +++ b/zitadel_client/models/user_service_auth_factor_u2_f.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceAuthFactorU2F(BaseModel): """ UserServiceAuthFactorU2F - """ # noqa: E501 - id: Optional[StrictStr] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "name"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + name: Optional[StrictStr] = Field(default=None, alias="name") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceAuthFactorU2F(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceAuthFactorU2F from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceAuthFactorU2F from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name") - }) - return _obj - - +UserServiceAuthFactorU2F.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_auth_factors.py b/zitadel_client/models/user_service_auth_factors.py index 119abaa3..1623820a 100644 --- a/zitadel_client/models/user_service_auth_factors.py +++ b/zitadel_client/models/user_service_auth_factors.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceAuthFactors(str, Enum): @@ -23,17 +13,7 @@ class UserServiceAuthFactors(str, Enum): UserServiceAuthFactors """ - """ - allowed enum values - """ - OTP = 'OTP' - OTP_SMS = 'OTP_SMS' - OTP_EMAIL = 'OTP_EMAIL' - U2F = 'U2F' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceAuthFactors from a JSON string""" - return cls(json.loads(json_str)) - - + OTP = "OTP" + OTP_SMS = "OTP_SMS" + OTP_EMAIL = "OTP_EMAIL" + U2_F = "U2F" diff --git a/zitadel_client/models/user_service_authentication_method_type.py b/zitadel_client/models/user_service_authentication_method_type.py index b281aa89..c3207dfd 100644 --- a/zitadel_client/models/user_service_authentication_method_type.py +++ b/zitadel_client/models/user_service_authentication_method_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceAuthenticationMethodType(str, Enum): @@ -23,22 +13,14 @@ class UserServiceAuthenticationMethodType(str, Enum): UserServiceAuthenticationMethodType """ - """ - allowed enum values - """ - AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = 'AUTHENTICATION_METHOD_TYPE_UNSPECIFIED' - AUTHENTICATION_METHOD_TYPE_PASSWORD = 'AUTHENTICATION_METHOD_TYPE_PASSWORD' - AUTHENTICATION_METHOD_TYPE_PASSKEY = 'AUTHENTICATION_METHOD_TYPE_PASSKEY' - AUTHENTICATION_METHOD_TYPE_IDP = 'AUTHENTICATION_METHOD_TYPE_IDP' - AUTHENTICATION_METHOD_TYPE_TOTP = 'AUTHENTICATION_METHOD_TYPE_TOTP' - AUTHENTICATION_METHOD_TYPE_U2_F = 'AUTHENTICATION_METHOD_TYPE_U2F' - AUTHENTICATION_METHOD_TYPE_OTP_SMS = 'AUTHENTICATION_METHOD_TYPE_OTP_SMS' - AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = 'AUTHENTICATION_METHOD_TYPE_OTP_EMAIL' - AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE = 'AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceAuthenticationMethodType from a JSON string""" - return cls(json.loads(json_str)) - - + AUTHENTICATION_METHOD_TYPE_UNSPECIFIED = "AUTHENTICATION_METHOD_TYPE_UNSPECIFIED" + AUTHENTICATION_METHOD_TYPE_PASSWORD = "AUTHENTICATION_METHOD_TYPE_PASSWORD" + AUTHENTICATION_METHOD_TYPE_PASSKEY = "AUTHENTICATION_METHOD_TYPE_PASSKEY" + AUTHENTICATION_METHOD_TYPE_IDP = "AUTHENTICATION_METHOD_TYPE_IDP" + AUTHENTICATION_METHOD_TYPE_TOTP = "AUTHENTICATION_METHOD_TYPE_TOTP" + AUTHENTICATION_METHOD_TYPE_U2_F = "AUTHENTICATION_METHOD_TYPE_U2F" + AUTHENTICATION_METHOD_TYPE_OTP_SMS = "AUTHENTICATION_METHOD_TYPE_OTP_SMS" + AUTHENTICATION_METHOD_TYPE_OTP_EMAIL = "AUTHENTICATION_METHOD_TYPE_OTP_EMAIL" + AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE = ( + "AUTHENTICATION_METHOD_TYPE_RECOVERY_CODE" + ) diff --git a/zitadel_client/models/user_service_byte_filter_method.py b/zitadel_client/models/user_service_byte_filter_method.py index e7a6c279..8cf153f1 100644 --- a/zitadel_client/models/user_service_byte_filter_method.py +++ b/zitadel_client/models/user_service_byte_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceByteFilterMethod(str, Enum): @@ -23,15 +13,5 @@ class UserServiceByteFilterMethod(str, Enum): UserServiceByteFilterMethod """ - """ - allowed enum values - """ - BYTE_FILTER_METHOD_EQUALS = 'BYTE_FILTER_METHOD_EQUALS' - BYTE_FILTER_METHOD_NOT_EQUALS = 'BYTE_FILTER_METHOD_NOT_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceByteFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + BYTE_FILTER_METHOD_EQUALS = "BYTE_FILTER_METHOD_EQUALS" + BYTE_FILTER_METHOD_NOT_EQUALS = "BYTE_FILTER_METHOD_NOT_EQUALS" diff --git a/zitadel_client/models/user_service_connect_error.py b/zitadel_client/models/user_service_connect_error.py index 5a1d6472..b85044ce 100644 --- a/zitadel_client/models/user_service_connect_error.py +++ b/zitadel_client/models/user_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_any import UserServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class UserServiceConnectErrorCodeEnum(str, Enum): + """UserServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class UserServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[UserServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[UserServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[UserServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [UserServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.user_service_any import UserServiceAny +UserServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_invite_code_request.py b/zitadel_client/models/user_service_create_invite_code_request.py index c6e5d9af..021ccac3 100644 --- a/zitadel_client/models/user_service_create_invite_code_request.py +++ b/zitadel_client/models/user_service_create_invite_code_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_invite_code import UserServiceSendInviteCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceCreateInviteCodeRequest(BaseModel): """ UserServiceCreateInviteCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[UserServiceSendInviteCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[UserServiceSendInviteCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class UserServiceCreateInviteCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreateInviteCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreateInviteCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": UserServiceSendInviteCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_invite_code import ( + UserServiceSendInviteCode, +) +UserServiceCreateInviteCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_invite_code_response.py b/zitadel_client/models/user_service_create_invite_code_response.py index 608dabfd..81eb1d3d 100644 --- a/zitadel_client/models/user_service_create_invite_code_response.py +++ b/zitadel_client/models/user_service_create_invite_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceCreateInviteCodeResponse(BaseModel): """ UserServiceCreateInviteCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - invite_code: Optional[StrictStr] = Field(default=None, description="The invite code is returned if the verification was set to return_code.", alias="inviteCode") - __properties: ClassVar[List[str]] = ["details", "inviteCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + invite_code: Optional[StrictStr] = Field( + default=None, + alias="inviteCode", + description="The invite code is returned if the verification was set to return_code.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceCreateInviteCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreateInviteCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if invite_code (nullable) is None - # and model_fields_set contains the field - if self.invite_code is None and "invite_code" in self.model_fields_set: - _dict['inviteCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreateInviteCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "inviteCode": obj.get("inviteCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceCreateInviteCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_passkey_registration_link_request.py b/zitadel_client/models/user_service_create_passkey_registration_link_request.py index adb57d07..abd5f520 100644 --- a/zitadel_client/models/user_service_create_passkey_registration_link_request.py +++ b/zitadel_client/models/user_service_create_passkey_registration_link_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_passkey_registration_link import UserServiceSendPasskeyRegistrationLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceCreatePasskeyRegistrationLinkRequest(BaseModel): """ UserServiceCreatePasskeyRegistrationLinkRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_link: Optional[UserServiceSendPasskeyRegistrationLink] = Field(default=None, alias="sendLink") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendLink"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_link: Optional[UserServiceSendPasskeyRegistrationLink] = Field( + default=None, alias="sendLink" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class UserServiceCreatePasskeyRegistrationLinkRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreatePasskeyRegistrationLinkRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_link - if self.send_link: - _dict['sendLink'] = self.send_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreatePasskeyRegistrationLinkRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendLink": UserServiceSendPasskeyRegistrationLink.from_dict(obj["sendLink"]) if obj.get("sendLink") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_passkey_registration_link import ( + UserServiceSendPasskeyRegistrationLink, +) +UserServiceCreatePasskeyRegistrationLinkRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_passkey_registration_link_response.py b/zitadel_client/models/user_service_create_passkey_registration_link_response.py index 87631727..0a4d8426 100644 --- a/zitadel_client/models/user_service_create_passkey_registration_link_response.py +++ b/zitadel_client/models/user_service_create_passkey_registration_link_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_passkey_registration_code import UserServicePasskeyRegistrationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceCreatePasskeyRegistrationLinkResponse(BaseModel): """ UserServiceCreatePasskeyRegistrationLinkResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - code: Optional[UserServicePasskeyRegistrationCode] = None - __properties: ClassVar[List[str]] = ["details", "code"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + code: Optional[UserServicePasskeyRegistrationCode] = Field( + default=None, alias="code" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +32,9 @@ class UserServiceCreatePasskeyRegistrationLinkResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreatePasskeyRegistrationLinkResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of code - if self.code: - _dict['code'] = self.code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreatePasskeyRegistrationLinkResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "code": UserServicePasskeyRegistrationCode.from_dict(obj["code"]) if obj.get("code") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +from zitadel_client.models.user_service_passkey_registration_code import ( + UserServicePasskeyRegistrationCode, +) +UserServiceCreatePasskeyRegistrationLinkResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_user_request.py b/zitadel_client/models/user_service_create_user_request.py index 7e006f39..4e11b265 100644 --- a/zitadel_client/models/user_service_create_user_request.py +++ b/zitadel_client/models/user_service_create_user_request.py @@ -1,40 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_human import UserServiceHuman -from zitadel_client.models.user_service_machine import UserServiceMachine -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceCreateUserRequest(BaseModel): """ UserServiceCreateUserRequest - """ # noqa: E501 - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the user belongs to.", alias="organizationId") - user_id: Optional[StrictStr] = Field(default=None, description="The ID is a unique identifier for the user in the instance. If not specified, it will be generated. You can set your own user id that is unique within the instance. This is useful in migration scenarios, for example if the user already has an ID in another Zitadel system. If not specified, it will be generated. It can't be changed after creation.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for users of type human and to the user_id for users of type machine. It is used to identify the user in the organization and can be used for login.") - human: Optional[UserServiceHuman] = None - machine: Optional[UserServiceMachine] = None - __properties: ClassVar[List[str]] = ["organizationId", "userId", "username", "human", "machine"] + """ + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the user belongs to.", + ) + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="The ID is a unique identifier for the user in the instance. If not specified, it will be generated. You can set your own user id that is unique within the instance. This is useful in migration scenarios, for example if the user already has an ID in another Zitadel system. If not specified, it will be generated. It can't be changed after creation.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="The username is a unique identifier for the user in the organization. If not specified, Zitadel sets the username to the email for users of type human and to the user_id for users of type machine. It is used to identify the user in the organization and can be used for login.", + ) + human: Optional[UserServiceHuman] = Field(default=None, alias="human") + machine: Optional[UserServiceMachine] = Field(default=None, alias="machine") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,72 +46,7 @@ class UserServiceCreateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - # override the default output from pydantic by calling `to_dict()` of machine - if self.machine: - _dict['machine'] = self.machine.to_dict() - # set to None if user_id (nullable) is None - # and model_fields_set contains the field - if self.user_id is None and "user_id" in self.model_fields_set: - _dict['userId'] = None - - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId"), - "userId": obj.get("userId"), - "username": obj.get("username"), - "human": UserServiceHuman.from_dict(obj["human"]) if obj.get("human") is not None else None, - "machine": UserServiceMachine.from_dict(obj["machine"]) if obj.get("machine") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_human import UserServiceHuman +from zitadel_client.models.user_service_machine import UserServiceMachine +UserServiceCreateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_create_user_response.py b/zitadel_client/models/user_service_create_user_response.py index 2ad46194..8ae2fdac 100644 --- a/zitadel_client/models/user_service_create_user_response.py +++ b/zitadel_client/models/user_service_create_user_response.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceCreateUserResponse(BaseModel): """ UserServiceCreateUserResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created user.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - email_code: Optional[StrictStr] = Field(default=None, description="The email verification code if it was requested by setting the email verification to return_code.", alias="emailCode") - phone_code: Optional[StrictStr] = Field(default=None, description="The phone verification code if it was requested by setting the phone verification to return_code.", alias="phoneCode") - __properties: ClassVar[List[str]] = ["id", "creationDate", "emailCode", "phoneCode"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created user.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + email_code: Optional[StrictStr] = Field( + default=None, + alias="emailCode", + description="The email verification code if it was requested by setting the email verification to return_code.", + ) + phone_code: Optional[StrictStr] = Field( + default=None, + alias="phoneCode", + description="The phone verification code if it was requested by setting the phone verification to return_code.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,65 +49,6 @@ class UserServiceCreateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceCreateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceCreateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceCreateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_deactivate_user_request.py b/zitadel_client/models/user_service_deactivate_user_request.py index 004a23f3..17569f82 100644 --- a/zitadel_client/models/user_service_deactivate_user_request.py +++ b/zitadel_client/models/user_service_deactivate_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceDeactivateUserRequest(BaseModel): """ UserServiceDeactivateUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceDeactivateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeactivateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeactivateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceDeactivateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_deactivate_user_response.py b/zitadel_client/models/user_service_deactivate_user_response.py index e405fdaa..dcc7dfba 100644 --- a/zitadel_client/models/user_service_deactivate_user_response.py +++ b/zitadel_client/models/user_service_deactivate_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceDeactivateUserResponse(BaseModel): """ UserServiceDeactivateUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceDeactivateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeactivateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeactivateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceDeactivateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_delete_user_metadata_request.py b/zitadel_client/models/user_service_delete_user_metadata_request.py index 304ca51a..f2761471 100644 --- a/zitadel_client/models/user_service_delete_user_metadata_request.py +++ b/zitadel_client/models/user_service_delete_user_metadata_request.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceDeleteUserMetadataRequest(BaseModel): """ UserServiceDeleteUserMetadataRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="ID of the user which metadata is to be deleted is stored on.", alias="userId") - keys: Optional[List[StrictStr]] = Field(default=None, description="The keys for the user metadata to be deleted.") - __properties: ClassVar[List[str]] = ["userId", "keys"] + """ + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="ID of the user which metadata is to be deleted is stored on.", + ) + keys: Optional[List[StrictStr]] = Field( + default=None, + alias="keys", + description="The keys for the user metadata to be deleted.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class UserServiceDeleteUserMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "keys": obj.get("keys") - }) - return _obj - - +UserServiceDeleteUserMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_delete_user_metadata_response.py b/zitadel_client/models/user_service_delete_user_metadata_response.py index 1557793d..8aa1da69 100644 --- a/zitadel_client/models/user_service_delete_user_metadata_response.py +++ b/zitadel_client/models/user_service_delete_user_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceDeleteUserMetadataResponse(BaseModel): """ UserServiceDeleteUserMetadataResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class UserServiceDeleteUserMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceDeleteUserMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_delete_user_request.py b/zitadel_client/models/user_service_delete_user_request.py index 578bcd83..c915b286 100644 --- a/zitadel_client/models/user_service_delete_user_request.py +++ b/zitadel_client/models/user_service_delete_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceDeleteUserRequest(BaseModel): """ UserServiceDeleteUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceDeleteUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceDeleteUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_delete_user_response.py b/zitadel_client/models/user_service_delete_user_response.py index 3ffe0779..0b4386e0 100644 --- a/zitadel_client/models/user_service_delete_user_response.py +++ b/zitadel_client/models/user_service_delete_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceDeleteUserResponse(BaseModel): """ UserServiceDeleteUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceDeleteUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDeleteUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceDeleteUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_details.py b/zitadel_client/models/user_service_details.py index d01ddefd..de96f6f5 100644 --- a/zitadel_client/models/user_service_details.py +++ b/zitadel_client/models/user_service_details.py @@ -1,38 +1,47 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceDetails(BaseModel): """ UserServiceDetails - """ # noqa: E501 - sequence: Optional[Any] = Field(default=None, description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - resource_owner: Optional[StrictStr] = Field(default=None, description="resource_owner is the organization or instance_id an object belongs to", alias="resourceOwner") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["sequence", "changeDate", "resourceOwner", "creationDate"] + """ + + sequence: Optional[object] = Field( + default=None, + alias="sequence", + description="sequence represents the order of events. It's always counting on read: the sequence of the last event reduced by the projection on manipulation: the timestamp of the event(s) added by the manipulation", + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + resource_owner: Optional[StrictStr] = Field( + default=None, + alias="resourceOwner", + description="resource_owner is the organization or instance_id an object belongs to", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +49,6 @@ class UserServiceDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if sequence (nullable) is None - # and model_fields_set contains the field - if self.sequence is None and "sequence" in self.model_fields_set: - _dict['sequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "sequence": obj.get("sequence"), - "changeDate": obj.get("changeDate"), - "resourceOwner": obj.get("resourceOwner"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_display_name_query.py b/zitadel_client/models/user_service_display_name_query.py index c25828d5..01bc28ac 100644 --- a/zitadel_client/models/user_service_display_name_query.py +++ b/zitadel_client/models/user_service_display_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceDisplayNameQuery(BaseModel): """ Query for users with a specific display name. - """ # noqa: E501 + """ + display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["displayName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceDisplayNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDisplayNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDisplayNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "displayName": obj.get("displayName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceDisplayNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_domain_query.py b/zitadel_client/models/user_service_domain_query.py index a1e20dab..e63794cf 100644 --- a/zitadel_client/models/user_service_domain_query.py +++ b/zitadel_client/models/user_service_domain_query.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceDomainQuery(BaseModel): """ UserServiceDomainQuery - """ # noqa: E501 - include_without_domain: Optional[StrictBool] = Field(default=None, description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.", alias="includeWithoutDomain") - domain: Optional[StrictStr] = Field(default=None, description="List only auth methods with specific domain.") - __properties: ClassVar[List[str]] = ["includeWithoutDomain", "domain"] + """ + include_without_domain: Optional[StrictBool] = Field( + default=None, + alias="includeWithoutDomain", + description="List also auth method types without domain information like passkey and U2F added through V1 APIs / Login UI.", + ) + domain: Optional[StrictStr] = Field( + default=None, + alias="domain", + description="List only auth methods with specific domain.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class UserServiceDomainQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceDomainQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceDomainQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "includeWithoutDomain": obj.get("includeWithoutDomain"), - "domain": obj.get("domain") - }) - return _obj - - +UserServiceDomainQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_email_query.py b/zitadel_client/models/user_service_email_query.py index 889e6115..65e3e965 100644 --- a/zitadel_client/models/user_service_email_query.py +++ b/zitadel_client/models/user_service_email_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceEmailQuery(BaseModel): """ Query for users with a specific email. - """ # noqa: E501 + """ + email_address: Optional[StrictStr] = Field(default=None, alias="emailAddress") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["emailAddress", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceEmailQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceEmailQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceEmailQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "emailAddress": obj.get("emailAddress"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceEmailQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_first_name_query.py b/zitadel_client/models/user_service_first_name_query.py index c4ecf66c..126b3d7c 100644 --- a/zitadel_client/models/user_service_first_name_query.py +++ b/zitadel_client/models/user_service_first_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceFirstNameQuery(BaseModel): """ Query for users with a specific first name. - """ # noqa: E501 + """ + first_name: Optional[StrictStr] = Field(default=None, alias="firstName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["firstName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceFirstNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceFirstNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceFirstNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "firstName": obj.get("firstName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceFirstNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_form_data.py b/zitadel_client/models/user_service_form_data.py index 89ca35f4..f13967cb 100644 --- a/zitadel_client/models/user_service_form_data.py +++ b/zitadel_client/models/user_service_form_data.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceFormData(BaseModel): """ UserServiceFormData - """ # noqa: E501 - url: Optional[StrictStr] = Field(default=None, description="The URL to which the form should be submitted using the POST method.") - fields: Optional[Dict[str, StrictStr]] = Field(default=None, description="The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type \"text\".") - __properties: ClassVar[List[str]] = ["url", "fields"] + """ + url: Optional[StrictStr] = Field( + default=None, + alias="url", + description="The URL to which the form should be submitted using the POST method.", + ) + fields: Optional[Dict[str, StrictStr]] = Field( + default=None, + alias="fields", + description='The form fields to be submitted. Each field is represented as a key-value pair, where the key is the field / input name and the value is the field / input value. All fields need to be submitted as is and as input type "text".', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +39,4 @@ class UserServiceFormData(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceFormData from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceFormData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "url": obj.get("url"), - "fields": obj.get("fields") - }) - return _obj - - +UserServiceFormData.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_gender.py b/zitadel_client/models/user_service_gender.py index 1e2d0efb..0a87aea3 100644 --- a/zitadel_client/models/user_service_gender.py +++ b/zitadel_client/models/user_service_gender.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceGender(str, Enum): @@ -23,17 +13,7 @@ class UserServiceGender(str, Enum): UserServiceGender """ - """ - allowed enum values - """ - GENDER_UNSPECIFIED = 'GENDER_UNSPECIFIED' - GENDER_FEMALE = 'GENDER_FEMALE' - GENDER_MALE = 'GENDER_MALE' - GENDER_DIVERSE = 'GENDER_DIVERSE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceGender from a JSON string""" - return cls(json.loads(json_str)) - - + GENDER_UNSPECIFIED = "GENDER_UNSPECIFIED" + GENDER_FEMALE = "GENDER_FEMALE" + GENDER_MALE = "GENDER_MALE" + GENDER_DIVERSE = "GENDER_DIVERSE" diff --git a/zitadel_client/models/user_service_generate_recovery_codes_request.py b/zitadel_client/models/user_service_generate_recovery_codes_request.py index 98b7c092..572cbcbc 100644 --- a/zitadel_client/models/user_service_generate_recovery_codes_request.py +++ b/zitadel_client/models/user_service_generate_recovery_codes_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictInt, StrictStr +from typing import Optional + class UserServiceGenerateRecoveryCodesRequest(BaseModel): """ UserServiceGenerateRecoveryCodesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - count: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["userId", "count"] + count: Optional[StrictInt] = Field(default=None, alias="count") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceGenerateRecoveryCodesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceGenerateRecoveryCodesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceGenerateRecoveryCodesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "count": obj.get("count") - }) - return _obj - - +UserServiceGenerateRecoveryCodesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_generate_recovery_codes_response.py b/zitadel_client/models/user_service_generate_recovery_codes_response.py index 4571fb1b..ba90ad98 100644 --- a/zitadel_client/models/user_service_generate_recovery_codes_response.py +++ b/zitadel_client/models/user_service_generate_recovery_codes_response.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceGenerateRecoveryCodesResponse(BaseModel): """ UserServiceGenerateRecoveryCodesResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - recovery_codes: Optional[List[StrictStr]] = Field(default=None, alias="recoveryCodes") - __properties: ClassVar[List[str]] = ["details", "recoveryCodes"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + recovery_codes: Optional[List[StrictStr]] = Field( + default=None, alias="recoveryCodes" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +33,6 @@ class UserServiceGenerateRecoveryCodesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceGenerateRecoveryCodesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceGenerateRecoveryCodesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "recoveryCodes": obj.get("recoveryCodes") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceGenerateRecoveryCodesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_get_user_by_id_request.py b/zitadel_client/models/user_service_get_user_by_id_request.py index 45f3c6b2..61703683 100644 --- a/zitadel_client/models/user_service_get_user_by_id_request.py +++ b/zitadel_client/models/user_service_get_user_by_id_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceGetUserByIDRequest(BaseModel): """ UserServiceGetUserByIDRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceGetUserByIDRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceGetUserByIDRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceGetUserByIDRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceGetUserByIDRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_get_user_by_id_response.py b/zitadel_client/models/user_service_get_user_by_id_response.py index 1dd9f515..75b24a62 100644 --- a/zitadel_client/models/user_service_get_user_by_id_response.py +++ b/zitadel_client/models/user_service_get_user_by_id_response.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_user import UserServiceUser -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceGetUserByIDResponse(BaseModel): """ UserServiceGetUserByIDResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - user: Optional[UserServiceUser] = None - __properties: ClassVar[List[str]] = ["details", "user"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + user: Optional[UserServiceUser] = Field(default=None, alias="user") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,59 +30,7 @@ class UserServiceGetUserByIDResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceGetUserByIDResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of user - if self.user: - _dict['user'] = self.user.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceGetUserByIDResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "user": UserServiceUser.from_dict(obj["user"]) if obj.get("user") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +from zitadel_client.models.user_service_user import UserServiceUser +UserServiceGetUserByIDResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_hashed_password.py b/zitadel_client/models/user_service_hashed_password.py index 3258a51c..20056717 100644 --- a/zitadel_client/models/user_service_hashed_password.py +++ b/zitadel_client/models/user_service_hashed_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceHashedPassword(BaseModel): """ UserServiceHashedPassword - """ # noqa: E501 - hash: Optional[StrictStr] = None + """ + + hash: Optional[StrictStr] = Field(default=None, alias="hash") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["hash", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceHashedPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHashedPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHashedPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hash": obj.get("hash"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +UserServiceHashedPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human.py b/zitadel_client/models/user_service_human.py index 0b1e39e2..136f7c58 100644 --- a/zitadel_client/models/user_service_human.py +++ b/zitadel_client/models/user_service_human.py @@ -1,41 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_profile import UserServiceProfile -from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail -from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone -from zitadel_client.models.user_service_set_password import UserServiceSetPassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceHuman(BaseModel): """ UserServiceHuman - """ # noqa: E501 - profile: Optional[UserServiceProfile] = None - email: Optional[UserServiceSetHumanEmail] = None - phone: Optional[UserServiceSetHumanPhone] = None - password: Optional[UserServiceSetPassword] = None - __properties: ClassVar[List[str]] = ["profile", "email", "phone", "password"] + """ + + profile: Optional[UserServiceProfile] = Field(default=None, alias="profile") + email: Optional[UserServiceSetHumanEmail] = Field(default=None, alias="email") + phone: Optional[UserServiceSetHumanPhone] = Field(default=None, alias="phone") + password: Optional[UserServiceSetPassword] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,67 +32,9 @@ class UserServiceHuman(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHuman from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHuman from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "profile": UserServiceProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": UserServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": UserServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "password": UserServiceSetPassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_profile import UserServiceProfile +from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail +from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone +from zitadel_client.models.user_service_set_password import UserServiceSetPassword +UserServiceHuman.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_email.py b/zitadel_client/models/user_service_human_email.py index bbf121f6..731d86f5 100644 --- a/zitadel_client/models/user_service_human_email.py +++ b/zitadel_client/models/user_service_human_email.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceHumanEmail(BaseModel): """ UserServiceHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - __properties: ClassVar[List[str]] = ["email", "isVerified"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified") - }) - return _obj - - +UserServiceHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_mfa_init_skipped_request.py b/zitadel_client/models/user_service_human_mfa_init_skipped_request.py index e6e46478..ba9210a5 100644 --- a/zitadel_client/models/user_service_human_mfa_init_skipped_request.py +++ b/zitadel_client/models/user_service_human_mfa_init_skipped_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceHumanMFAInitSkippedRequest(BaseModel): """ UserServiceHumanMFAInitSkippedRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceHumanMFAInitSkippedRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanMFAInitSkippedRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanMFAInitSkippedRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceHumanMFAInitSkippedRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_mfa_init_skipped_response.py b/zitadel_client/models/user_service_human_mfa_init_skipped_response.py index e714a2da..a3c2c17e 100644 --- a/zitadel_client/models/user_service_human_mfa_init_skipped_response.py +++ b/zitadel_client/models/user_service_human_mfa_init_skipped_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceHumanMFAInitSkippedResponse(BaseModel): """ UserServiceHumanMFAInitSkippedResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceHumanMFAInitSkippedResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanMFAInitSkippedResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanMFAInitSkippedResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceHumanMFAInitSkippedResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_phone.py b/zitadel_client/models/user_service_human_phone.py index 741e96cf..ac319241 100644 --- a/zitadel_client/models/user_service_human_phone.py +++ b/zitadel_client/models/user_service_human_phone.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceHumanPhone(BaseModel): """ UserServiceHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - __properties: ClassVar[List[str]] = ["phone", "isVerified"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified") - }) - return _obj - - +UserServiceHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_profile.py b/zitadel_client/models/user_service_human_profile.py index 02dc3562..6bac9660 100644 --- a/zitadel_client/models/user_service_human_profile.py +++ b/zitadel_client/models/user_service_human_profile.py @@ -1,41 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_gender import UserServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceHumanProfile(BaseModel): """ UserServiceHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[UserServiceGender] = None + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[UserServiceGender] = Field(default=None, alias="gender") avatar_url: Optional[StrictStr] = Field(default=None, alias="avatarUrl") - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender", "avatarUrl"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,73 +38,6 @@ class UserServiceHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender"), - "avatarUrl": obj.get("avatarUrl") - }) - return _obj - +from zitadel_client.models.user_service_gender import UserServiceGender +UserServiceHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_human_user.py b/zitadel_client/models/user_service_human_user.py index 16f860be..53e3d56b 100644 --- a/zitadel_client/models/user_service_human_user.py +++ b/zitadel_client/models/user_service_human_user.py @@ -1,49 +1,64 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_human_email import UserServiceHumanEmail -from zitadel_client.models.user_service_human_phone import UserServiceHumanPhone -from zitadel_client.models.user_service_human_profile import UserServiceHumanProfile -from zitadel_client.models.user_service_user_state import UserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import List, Optional + class UserServiceHumanUser(BaseModel): """ UserServiceHumanUser - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user.", alias="userId") - state: Optional[UserServiceUserState] = None - username: Optional[StrictStr] = Field(default=None, description="Username of the user, which can be globally unique or unique on organization level.") - login_names: Optional[List[StrictStr]] = Field(default=None, description="Possible usable login names for the user.", alias="loginNames") - preferred_login_name: Optional[StrictStr] = Field(default=None, description="Preferred login name of the user.", alias="preferredLoginName") - profile: Optional[UserServiceHumanProfile] = None - email: Optional[UserServiceHumanEmail] = None - phone: Optional[UserServiceHumanPhone] = None - password_change_required: Optional[StrictBool] = Field(default=None, description="User is required to change the used password on the next login.", alias="passwordChangeRequired") - password_changed: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="passwordChanged") - mfa_init_skipped: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="mfaInitSkipped") - __properties: ClassVar[List[str]] = ["userId", "state", "username", "loginNames", "preferredLoginName", "profile", "email", "phone", "passwordChangeRequired", "passwordChanged", "mfaInitSkipped"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="Unique identifier of the user." + ) + state: Optional[UserServiceUserState] = Field(default=None, alias="state") + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="Username of the user, which can be globally unique or unique on organization level.", + ) + login_names: Optional[List[StrictStr]] = Field( + default=None, + alias="loginNames", + description="Possible usable login names for the user.", + ) + preferred_login_name: Optional[StrictStr] = Field( + default=None, + alias="preferredLoginName", + description="Preferred login name of the user.", + ) + profile: Optional[UserServiceHumanProfile] = Field(default=None, alias="profile") + email: Optional[UserServiceHumanEmail] = Field(default=None, alias="email") + phone: Optional[UserServiceHumanPhone] = Field(default=None, alias="phone") + password_change_required: Optional[StrictBool] = Field( + default=None, + alias="passwordChangeRequired", + description="User is required to change the used password on the next login.", + ) + password_changed: Optional[AwareDatetime] = Field( + default=None, + alias="passwordChanged", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + mfa_init_skipped: Optional[AwareDatetime] = Field( + default=None, + alias="mfaInitSkipped", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -51,71 +66,10 @@ class UserServiceHumanUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceHumanUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceHumanUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "state": obj.get("state"), - "username": obj.get("username"), - "loginNames": obj.get("loginNames"), - "preferredLoginName": obj.get("preferredLoginName"), - "profile": UserServiceHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": UserServiceHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": UserServiceHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "passwordChangeRequired": obj.get("passwordChangeRequired"), - "passwordChanged": obj.get("passwordChanged"), - "mfaInitSkipped": obj.get("mfaInitSkipped") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.user_service_human_email import UserServiceHumanEmail +from zitadel_client.models.user_service_human_phone import UserServiceHumanPhone +from zitadel_client.models.user_service_human_profile import UserServiceHumanProfile +from zitadel_client.models.user_service_user_state import UserServiceUserState +UserServiceHumanUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_id_filter.py b/zitadel_client/models/user_service_id_filter.py index 9508deb5..701712bb 100644 --- a/zitadel_client/models/user_service_id_filter.py +++ b/zitadel_client/models/user_service_id_filter.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceIDFilter(BaseModel): """ UserServiceIDFilter - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Only return resources that belong to this id.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="Only return resources that belong to this id.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class UserServiceIDFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +UserServiceIDFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idp_information.py b/zitadel_client/models/user_service_idp_information.py index b70c6ca5..dc4bb02d 100644 --- a/zitadel_client/models/user_service_idp_information.py +++ b/zitadel_client/models/user_service_idp_information.py @@ -1,43 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_idpldap_access_information import UserServiceIDPLDAPAccessInformation -from zitadel_client.models.user_service_idpo_auth_access_information import UserServiceIDPOAuthAccessInformation -from zitadel_client.models.user_service_idpsaml_access_information import UserServiceIDPSAMLAccessInformation -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceIDPInformation(BaseModel): """ UserServiceIDPInformation - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - raw_information: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="rawInformation") - ldap: Optional[UserServiceIDPLDAPAccessInformation] = None - oauth: Optional[UserServiceIDPOAuthAccessInformation] = None - saml: Optional[UserServiceIDPSAMLAccessInformation] = None - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName", "rawInformation", "ldap", "oauth", "saml"] + raw_information: Optional[Dict[str, object]] = Field( + default=None, + alias="rawInformation", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + ldap: Optional[UserServiceIDPLDAPAccessInformation] = Field( + default=None, alias="ldap" + ) + oauth: Optional[UserServiceIDPOAuthAccessInformation] = Field( + default=None, alias="oauth" + ) + saml: Optional[UserServiceIDPSAMLAccessInformation] = Field( + default=None, alias="saml" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,67 +46,14 @@ class UserServiceIDPInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ldap - if self.ldap: - _dict['ldap'] = self.ldap.to_dict() - # override the default output from pydantic by calling `to_dict()` of oauth - if self.oauth: - _dict['oauth'] = self.oauth.to_dict() - # override the default output from pydantic by calling `to_dict()` of saml - if self.saml: - _dict['saml'] = self.saml.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName"), - "rawInformation": obj.get("rawInformation"), - "ldap": UserServiceIDPLDAPAccessInformation.from_dict(obj["ldap"]) if obj.get("ldap") is not None else None, - "oauth": UserServiceIDPOAuthAccessInformation.from_dict(obj["oauth"]) if obj.get("oauth") is not None else None, - "saml": UserServiceIDPSAMLAccessInformation.from_dict(obj["saml"]) if obj.get("saml") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_idpldap_access_information import ( + UserServiceIDPLDAPAccessInformation, +) +from zitadel_client.models.user_service_idpo_auth_access_information import ( + UserServiceIDPOAuthAccessInformation, +) +from zitadel_client.models.user_service_idpsaml_access_information import ( + UserServiceIDPSAMLAccessInformation, +) +UserServiceIDPInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idp_intent.py b/zitadel_client/models/user_service_idp_intent.py index 48fcee6e..15c96f84 100644 --- a/zitadel_client/models/user_service_idp_intent.py +++ b/zitadel_client/models/user_service_idp_intent.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceIDPIntent(BaseModel): """ UserServiceIDPIntent - """ # noqa: E501 + """ + idp_intent_id: Optional[StrictStr] = Field(default=None, alias="idpIntentId") idp_intent_token: Optional[StrictStr] = Field(default=None, alias="idpIntentToken") user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken", "userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class UserServiceIDPIntent(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPIntent from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPIntent from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken"), - "userId": obj.get("userId") - }) - return _obj - - +UserServiceIDPIntent.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idp_link.py b/zitadel_client/models/user_service_idp_link.py index c81592e0..a98f4307 100644 --- a/zitadel_client/models/user_service_idp_link.py +++ b/zitadel_client/models/user_service_idp_link.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceIDPLink(BaseModel): """ UserServiceIDPLink - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") user_id: Optional[StrictStr] = Field(default=None, alias="userId") user_name: Optional[StrictStr] = Field(default=None, alias="userName") - __properties: ClassVar[List[str]] = ["idpId", "userId", "userName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class UserServiceIDPLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "userId": obj.get("userId"), - "userName": obj.get("userName") - }) - return _obj - - +UserServiceIDPLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idpldap_access_information.py b/zitadel_client/models/user_service_idpldap_access_information.py index afcccd06..2579d95b 100644 --- a/zitadel_client/models/user_service_idpldap_access_information.py +++ b/zitadel_client/models/user_service_idpldap_access_information.py @@ -1,34 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Dict, Optional + class UserServiceIDPLDAPAccessInformation(BaseModel): """ UserServiceIDPLDAPAccessInformation - """ # noqa: E501 - attributes: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.") - __properties: ClassVar[List[str]] = ["attributes"] + """ + attributes: Optional[Dict[str, object]] = Field( + default=None, + alias="attributes", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +33,4 @@ class UserServiceIDPLDAPAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPLDAPAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPLDAPAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "attributes": obj.get("attributes") - }) - return _obj - - +UserServiceIDPLDAPAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idpo_auth_access_information.py b/zitadel_client/models/user_service_idpo_auth_access_information.py index d529893e..efe80a45 100644 --- a/zitadel_client/models/user_service_idpo_auth_access_information.py +++ b/zitadel_client/models/user_service_idpo_auth_access_information.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceIDPOAuthAccessInformation(BaseModel): """ UserServiceIDPOAuthAccessInformation - """ # noqa: E501 + """ + access_token: Optional[StrictStr] = Field(default=None, alias="accessToken") id_token: Optional[StrictStr] = Field(default=None, alias="idToken") - __properties: ClassVar[List[str]] = ["accessToken", "idToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,58 +31,4 @@ class UserServiceIDPOAuthAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPOAuthAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if id_token (nullable) is None - # and model_fields_set contains the field - if self.id_token is None and "id_token" in self.model_fields_set: - _dict['idToken'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPOAuthAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "accessToken": obj.get("accessToken"), - "idToken": obj.get("idToken") - }) - return _obj - - +UserServiceIDPOAuthAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_idpsaml_access_information.py b/zitadel_client/models/user_service_idpsaml_access_information.py index a5614a10..d4f6af50 100644 --- a/zitadel_client/models/user_service_idpsaml_access_information.py +++ b/zitadel_client/models/user_service_idpsaml_access_information.py @@ -1,34 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceIDPSAMLAccessInformation(BaseModel): """ UserServiceIDPSAMLAccessInformation - """ # noqa: E501 - assertion: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["assertion"] + """ + assertion: Optional[Base64Bytes] = Field(default=None, alias="assertion") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +29,6 @@ class UserServiceIDPSAMLAccessInformation(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceIDPSAMLAccessInformation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceIDPSAMLAccessInformation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "assertion": obj.get("assertion") - }) - return _obj - +from pydantic import Base64Bytes +UserServiceIDPSAMLAccessInformation.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_in_user_emails_query.py b/zitadel_client/models/user_service_in_user_emails_query.py index 8794bfe1..c267fbcc 100644 --- a/zitadel_client/models/user_service_in_user_emails_query.py +++ b/zitadel_client/models/user_service_in_user_emails_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceInUserEmailsQuery(BaseModel): """ Query for users with email in list of emails. - """ # noqa: E501 + """ + user_emails: Optional[List[StrictStr]] = Field(default=None, alias="userEmails") - __properties: ClassVar[List[str]] = ["userEmails"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceInUserEmailsQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceInUserEmailsQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceInUserEmailsQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userEmails": obj.get("userEmails") - }) - return _obj - - +UserServiceInUserEmailsQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_in_user_id_query.py b/zitadel_client/models/user_service_in_user_id_query.py index c22d39aa..f9632d69 100644 --- a/zitadel_client/models/user_service_in_user_id_query.py +++ b/zitadel_client/models/user_service_in_user_id_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceInUserIDQuery(BaseModel): """ Query for users with ID in list of IDs. - """ # noqa: E501 + """ + user_ids: Optional[List[StrictStr]] = Field(default=None, alias="userIds") - __properties: ClassVar[List[str]] = ["userIds"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceInUserIDQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceInUserIDQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceInUserIDQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userIds": obj.get("userIds") - }) - return _obj - - +UserServiceInUserIDQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_key.py b/zitadel_client/models/user_service_key.py index a7077fb8..8240bf15 100644 --- a/zitadel_client/models/user_service_key.py +++ b/zitadel_client/models/user_service_key.py @@ -1,40 +1,55 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceKey(BaseModel): """ UserServiceKey - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the key.") - user_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user the key belongs to.", alias="userId") - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the key belongs to.", alias="organizationId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["creationDate", "changeDate", "id", "userId", "organizationId", "expirationDate"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the key." + ) + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="The unique identifier of the user the key belongs to.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the key belongs to.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +57,6 @@ class UserServiceKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "id": obj.get("id"), - "userId": obj.get("userId"), - "organizationId": obj.get("organizationId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_key_field_name.py b/zitadel_client/models/user_service_key_field_name.py index a33f4028..8cc253e8 100644 --- a/zitadel_client/models/user_service_key_field_name.py +++ b/zitadel_client/models/user_service_key_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceKeyFieldName(str, Enum): @@ -23,19 +13,9 @@ class UserServiceKeyFieldName(str, Enum): UserServiceKeyFieldName """ - """ - allowed enum values - """ - KEY_FIELD_NAME_UNSPECIFIED = 'KEY_FIELD_NAME_UNSPECIFIED' - KEY_FIELD_NAME_CREATED_DATE = 'KEY_FIELD_NAME_CREATED_DATE' - KEY_FIELD_NAME_ID = 'KEY_FIELD_NAME_ID' - KEY_FIELD_NAME_USER_ID = 'KEY_FIELD_NAME_USER_ID' - KEY_FIELD_NAME_ORGANIZATION_ID = 'KEY_FIELD_NAME_ORGANIZATION_ID' - KEY_FIELD_NAME_KEY_EXPIRATION_DATE = 'KEY_FIELD_NAME_KEY_EXPIRATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceKeyFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + KEY_FIELD_NAME_UNSPECIFIED = "KEY_FIELD_NAME_UNSPECIFIED" + KEY_FIELD_NAME_CREATED_DATE = "KEY_FIELD_NAME_CREATED_DATE" + KEY_FIELD_NAME_ID = "KEY_FIELD_NAME_ID" + KEY_FIELD_NAME_USER_ID = "KEY_FIELD_NAME_USER_ID" + KEY_FIELD_NAME_ORGANIZATION_ID = "KEY_FIELD_NAME_ORGANIZATION_ID" + KEY_FIELD_NAME_KEY_EXPIRATION_DATE = "KEY_FIELD_NAME_KEY_EXPIRATION_DATE" diff --git a/zitadel_client/models/user_service_keys_search_filter.py b/zitadel_client/models/user_service_keys_search_filter.py index aa801fd1..b6fef4ad 100644 --- a/zitadel_client/models/user_service_keys_search_filter.py +++ b/zitadel_client/models/user_service_keys_search_filter.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_id_filter import UserServiceIDFilter -from zitadel_client.models.user_service_timestamp_filter import UserServiceTimestampFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceKeysSearchFilter(BaseModel): """ UserServiceKeysSearchFilter - """ # noqa: E501 - created_date_filter: Optional[UserServiceTimestampFilter] = Field(default=None, alias="createdDateFilter") - expiration_date_filter: Optional[UserServiceTimestampFilter] = Field(default=None, alias="expirationDateFilter") - key_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="keyIdFilter") - organization_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="organizationIdFilter") - user_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="userIdFilter") - __properties: ClassVar[List[str]] = ["createdDateFilter", "expirationDateFilter", "keyIdFilter", "organizationIdFilter", "userIdFilter"] + """ + created_date_filter: Optional[UserServiceTimestampFilter] = Field( + default=None, alias="createdDateFilter" + ) + expiration_date_filter: Optional[UserServiceTimestampFilter] = Field( + default=None, alias="expirationDateFilter" + ) + key_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="keyIdFilter" + ) + organization_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="organizationIdFilter" + ) + user_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="userIdFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,71 +43,9 @@ class UserServiceKeysSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceKeysSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of created_date_filter - if self.created_date_filter: - _dict['createdDateFilter'] = self.created_date_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of expiration_date_filter - if self.expiration_date_filter: - _dict['expirationDateFilter'] = self.expiration_date_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of key_id_filter - if self.key_id_filter: - _dict['keyIdFilter'] = self.key_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_filter - if self.organization_id_filter: - _dict['organizationIdFilter'] = self.organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_id_filter - if self.user_id_filter: - _dict['userIdFilter'] = self.user_id_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceKeysSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "createdDateFilter": UserServiceTimestampFilter.from_dict(obj["createdDateFilter"]) if obj.get("createdDateFilter") is not None else None, - "expirationDateFilter": UserServiceTimestampFilter.from_dict(obj["expirationDateFilter"]) if obj.get("expirationDateFilter") is not None else None, - "keyIdFilter": UserServiceIDFilter.from_dict(obj["keyIdFilter"]) if obj.get("keyIdFilter") is not None else None, - "organizationIdFilter": UserServiceIDFilter.from_dict(obj["organizationIdFilter"]) if obj.get("organizationIdFilter") is not None else None, - "userIdFilter": UserServiceIDFilter.from_dict(obj["userIdFilter"]) if obj.get("userIdFilter") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_id_filter import UserServiceIDFilter +from zitadel_client.models.user_service_timestamp_filter import ( + UserServiceTimestampFilter, +) +UserServiceKeysSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_last_name_query.py b/zitadel_client/models/user_service_last_name_query.py index c6e6d932..225d216f 100644 --- a/zitadel_client/models/user_service_last_name_query.py +++ b/zitadel_client/models/user_service_last_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceLastNameQuery(BaseModel): """ Query for users with a specific last name. - """ # noqa: E501 + """ + last_name: Optional[StrictStr] = Field(default=None, alias="lastName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["lastName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceLastNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceLastNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceLastNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "lastName": obj.get("lastName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceLastNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_ldap_credentials.py b/zitadel_client/models/user_service_ldap_credentials.py index 6ed25987..c74d059d 100644 --- a/zitadel_client/models/user_service_ldap_credentials.py +++ b/zitadel_client/models/user_service_ldap_credentials.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceLDAPCredentials(BaseModel): """ UserServiceLDAPCredentials - """ # noqa: E501 - username: Optional[StrictStr] = None - password: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["username", "password"] + """ + + username: Optional[StrictStr] = Field(default=None, alias="username") + password: Optional[StrictStr] = Field(default=None, alias="password") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceLDAPCredentials(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceLDAPCredentials from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceLDAPCredentials from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "username": obj.get("username"), - "password": obj.get("password") - }) - return _obj - - +UserServiceLDAPCredentials.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_authentication_factors_request.py b/zitadel_client/models/user_service_list_authentication_factors_request.py index 13aa9aad..1dd4578f 100644 --- a/zitadel_client/models/user_service_list_authentication_factors_request.py +++ b/zitadel_client/models/user_service_list_authentication_factors_request.py @@ -1,38 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_auth_factor_state import UserServiceAuthFactorState -from zitadel_client.models.user_service_auth_factors import UserServiceAuthFactors -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceListAuthenticationFactorsRequest(BaseModel): """ UserServiceListAuthenticationFactorsRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - auth_factors: Optional[List[UserServiceAuthFactors]] = Field(default=None, alias="authFactors") - states: Optional[List[UserServiceAuthFactorState]] = None - __properties: ClassVar[List[str]] = ["userId", "authFactors", "states"] + auth_factors: Optional[List[UserServiceAuthFactors]] = Field( + default=None, alias="authFactors" + ) + states: Optional[List[UserServiceAuthFactorState]] = Field( + default=None, alias="states" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,54 +36,9 @@ class UserServiceListAuthenticationFactorsRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationFactorsRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationFactorsRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "authFactors": obj.get("authFactors"), - "states": obj.get("states") - }) - return _obj - +from zitadel_client.models.user_service_auth_factor_state import ( + UserServiceAuthFactorState, +) +from zitadel_client.models.user_service_auth_factors import UserServiceAuthFactors +UserServiceListAuthenticationFactorsRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_authentication_factors_response.py b/zitadel_client/models/user_service_list_authentication_factors_response.py index 9ba3339f..a1b9a310 100644 --- a/zitadel_client/models/user_service_list_authentication_factors_response.py +++ b/zitadel_client/models/user_service_list_authentication_factors_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_auth_factor import UserServiceAuthFactor -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceListAuthenticationFactorsResponse(BaseModel): """ UserServiceListAuthenticationFactorsResponse - """ # noqa: E501 - result: Optional[List[UserServiceAuthFactor]] = None - __properties: ClassVar[List[str]] = ["result"] + """ + result: Optional[List[UserServiceAuthFactor]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,59 +29,6 @@ class UserServiceListAuthenticationFactorsResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationFactorsResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationFactorsResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "result": [UserServiceAuthFactor.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_auth_factor import UserServiceAuthFactor +UserServiceListAuthenticationFactorsResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_authentication_method_types_request.py b/zitadel_client/models/user_service_list_authentication_method_types_request.py index a01c8abf..bfe7c035 100644 --- a/zitadel_client/models/user_service_list_authentication_method_types_request.py +++ b/zitadel_client/models/user_service_list_authentication_method_types_request.py @@ -1,36 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_domain_query import UserServiceDomainQuery -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceListAuthenticationMethodTypesRequest(BaseModel): """ UserServiceListAuthenticationMethodTypesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - domain_query: Optional[UserServiceDomainQuery] = Field(default=None, alias="domainQuery") - __properties: ClassVar[List[str]] = ["userId", "domainQuery"] + domain_query: Optional[UserServiceDomainQuery] = Field( + default=None, alias="domainQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +33,6 @@ class UserServiceListAuthenticationMethodTypesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationMethodTypesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of domain_query - if self.domain_query: - _dict['domainQuery'] = self.domain_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationMethodTypesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "domainQuery": UserServiceDomainQuery.from_dict(obj["domainQuery"]) if obj.get("domainQuery") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_domain_query import UserServiceDomainQuery +UserServiceListAuthenticationMethodTypesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_authentication_method_types_response.py b/zitadel_client/models/user_service_list_authentication_method_types_response.py index 707df738..4bf26411 100644 --- a/zitadel_client/models/user_service_list_authentication_method_types_response.py +++ b/zitadel_client/models/user_service_list_authentication_method_types_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_authentication_method_type import UserServiceAuthenticationMethodType -from zitadel_client.models.user_service_list_details import UserServiceListDetails -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListAuthenticationMethodTypesResponse(BaseModel): """ UserServiceListAuthenticationMethodTypesResponse - """ # noqa: E501 - details: Optional[UserServiceListDetails] = None - auth_method_types: Optional[List[UserServiceAuthenticationMethodType]] = Field(default=None, alias="authMethodTypes") - __properties: ClassVar[List[str]] = ["details", "authMethodTypes"] + """ + details: Optional[UserServiceListDetails] = Field(default=None, alias="details") + auth_method_types: Optional[List[UserServiceAuthenticationMethodType]] = Field( + default=None, alias="authMethodTypes" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,56 +32,9 @@ class UserServiceListAuthenticationMethodTypesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationMethodTypesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListAuthenticationMethodTypesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "authMethodTypes": obj.get("authMethodTypes") - }) - return _obj - +from zitadel_client.models.user_service_authentication_method_type import ( + UserServiceAuthenticationMethodType, +) +from zitadel_client.models.user_service_list_details import UserServiceListDetails +UserServiceListAuthenticationMethodTypesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_details.py b/zitadel_client/models/user_service_list_details.py index c71c5ce6..13d8d961 100644 --- a/zitadel_client/models/user_service_list_details.py +++ b/zitadel_client/models/user_service_list_details.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceListDetails(BaseModel): """ UserServiceListDetails - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, alias="totalResult") - processed_sequence: Optional[Any] = Field(default=None, alias="processedSequence") - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - __properties: ClassVar[List[str]] = ["totalResult", "processedSequence", "timestamp"] + """ + total_result: Optional[object] = Field(default=None, alias="totalResult") + processed_sequence: Optional[object] = Field( + default=None, alias="processedSequence" + ) + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +37,6 @@ class UserServiceListDetails(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListDetails from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if processed_sequence (nullable) is None - # and model_fields_set contains the field - if self.processed_sequence is None and "processed_sequence" in self.model_fields_set: - _dict['processedSequence'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListDetails from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "processedSequence": obj.get("processedSequence"), - "timestamp": obj.get("timestamp") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceListDetails.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_idp_links_request.py b/zitadel_client/models/user_service_list_idp_links_request.py index f17f85a8..f282ccc3 100644 --- a/zitadel_client/models/user_service_list_idp_links_request.py +++ b/zitadel_client/models/user_service_list_idp_links_request.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_list_query import UserServiceListQuery -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceListIDPLinksRequest(BaseModel): """ UserServiceListIDPLinksRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - query: Optional[UserServiceListQuery] = None - __properties: ClassVar[List[str]] = ["userId", "query"] + query: Optional[UserServiceListQuery] = Field(default=None, alias="query") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,56 +31,6 @@ class UserServiceListIDPLinksRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListIDPLinksRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListIDPLinksRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "query": UserServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_list_query import UserServiceListQuery +UserServiceListIDPLinksRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_idp_links_response.py b/zitadel_client/models/user_service_list_idp_links_response.py index 9379311c..e9781ecb 100644 --- a/zitadel_client/models/user_service_list_idp_links_response.py +++ b/zitadel_client/models/user_service_list_idp_links_response.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_idp_link import UserServiceIDPLink -from zitadel_client.models.user_service_list_details import UserServiceListDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceListIDPLinksResponse(BaseModel): """ UserServiceListIDPLinksResponse - """ # noqa: E501 - details: Optional[UserServiceListDetails] = None - result: Optional[List[UserServiceIDPLink]] = None - __properties: ClassVar[List[str]] = ["details", "result"] + """ + details: Optional[UserServiceListDetails] = Field(default=None, alias="details") + result: Optional[List[UserServiceIDPLink]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +30,7 @@ class UserServiceListIDPLinksResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListIDPLinksResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListIDPLinksResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "result": [UserServiceIDPLink.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_idp_link import UserServiceIDPLink +from zitadel_client.models.user_service_list_details import UserServiceListDetails +UserServiceListIDPLinksResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_keys_request.py b/zitadel_client/models/user_service_list_keys_request.py index dc3ff6bc..3944d2b8 100644 --- a/zitadel_client/models/user_service_list_keys_request.py +++ b/zitadel_client/models/user_service_list_keys_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_key_field_name import UserServiceKeyFieldName -from zitadel_client.models.user_service_keys_search_filter import UserServiceKeysSearchFilter -from zitadel_client.models.user_service_pagination_request import UserServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListKeysRequest(BaseModel): """ UserServiceListKeysRequest - """ # noqa: E501 - pagination: Optional[UserServicePaginationRequest] = None - sorting_column: Optional[UserServiceKeyFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[UserServiceKeysSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[UserServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[UserServiceKeyFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[UserServiceKeysSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,12 @@ class UserServiceListKeysRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListKeysRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListKeysRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": UserServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [UserServiceKeysSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - - +from zitadel_client.models.user_service_key_field_name import UserServiceKeyFieldName +from zitadel_client.models.user_service_keys_search_filter import ( + UserServiceKeysSearchFilter, +) +from zitadel_client.models.user_service_pagination_request import ( + UserServicePaginationRequest, +) + +UserServiceListKeysRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_keys_response.py b/zitadel_client/models/user_service_list_keys_response.py index b18240b6..9d30ef4c 100644 --- a/zitadel_client/models/user_service_list_keys_response.py +++ b/zitadel_client/models/user_service_list_keys_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_key import UserServiceKey -from zitadel_client.models.user_service_pagination_response import UserServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceListKeysResponse(BaseModel): """ UserServiceListKeysResponse - """ # noqa: E501 - pagination: Optional[UserServicePaginationResponse] = None - result: Optional[List[UserServiceKey]] = None - __properties: ClassVar[List[str]] = ["pagination", "result"] + """ + pagination: Optional[UserServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + result: Optional[List[UserServiceKey]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +32,9 @@ class UserServiceListKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": UserServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "result": [UserServiceKey.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_key import UserServiceKey +from zitadel_client.models.user_service_pagination_response import ( + UserServicePaginationResponse, +) +UserServiceListKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_passkeys_request.py b/zitadel_client/models/user_service_list_passkeys_request.py index 469cbd98..3abe3649 100644 --- a/zitadel_client/models/user_service_list_passkeys_request.py +++ b/zitadel_client/models/user_service_list_passkeys_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceListPasskeysRequest(BaseModel): """ UserServiceListPasskeysRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceListPasskeysRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListPasskeysRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListPasskeysRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceListPasskeysRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_passkeys_response.py b/zitadel_client/models/user_service_list_passkeys_response.py index 86a7f162..26787c87 100644 --- a/zitadel_client/models/user_service_list_passkeys_response.py +++ b/zitadel_client/models/user_service_list_passkeys_response.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_list_details import UserServiceListDetails -from zitadel_client.models.user_service_passkey import UserServicePasskey -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceListPasskeysResponse(BaseModel): """ UserServiceListPasskeysResponse - """ # noqa: E501 - details: Optional[UserServiceListDetails] = None - result: Optional[List[UserServicePasskey]] = None - __properties: ClassVar[List[str]] = ["details", "result"] + """ + details: Optional[UserServiceListDetails] = Field(default=None, alias="details") + result: Optional[List[UserServicePasskey]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +30,7 @@ class UserServiceListPasskeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListPasskeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListPasskeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "result": [UserServicePasskey.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_list_details import UserServiceListDetails +from zitadel_client.models.user_service_passkey import UserServicePasskey +UserServiceListPasskeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_personal_access_tokens_request.py b/zitadel_client/models/user_service_list_personal_access_tokens_request.py index 07949601..bde14341 100644 --- a/zitadel_client/models/user_service_list_personal_access_tokens_request.py +++ b/zitadel_client/models/user_service_list_personal_access_tokens_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_pagination_request import UserServicePaginationRequest -from zitadel_client.models.user_service_personal_access_token_field_name import UserServicePersonalAccessTokenFieldName -from zitadel_client.models.user_service_personal_access_tokens_search_filter import UserServicePersonalAccessTokensSearchFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListPersonalAccessTokensRequest(BaseModel): """ UserServiceListPersonalAccessTokensRequest - """ # noqa: E501 - pagination: Optional[UserServicePaginationRequest] = None - sorting_column: Optional[UserServicePersonalAccessTokenFieldName] = Field(default=None, alias="sortingColumn") - filters: Optional[List[UserServicePersonalAccessTokensSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["pagination", "sortingColumn", "filters"] + """ + + pagination: Optional[UserServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + sorting_column: Optional[UserServicePersonalAccessTokenFieldName] = Field( + default=None, alias="sortingColumn" + ) + filters: Optional[List[UserServicePersonalAccessTokensSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +37,14 @@ class UserServiceListPersonalAccessTokensRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListPersonalAccessTokensRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListPersonalAccessTokensRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": UserServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "filters": [UserServicePersonalAccessTokensSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_pagination_request import ( + UserServicePaginationRequest, +) +from zitadel_client.models.user_service_personal_access_token_field_name import ( + UserServicePersonalAccessTokenFieldName, +) +from zitadel_client.models.user_service_personal_access_tokens_search_filter import ( + UserServicePersonalAccessTokensSearchFilter, +) +UserServiceListPersonalAccessTokensRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_personal_access_tokens_response.py b/zitadel_client/models/user_service_list_personal_access_tokens_response.py index ee70b36d..203f7b37 100644 --- a/zitadel_client/models/user_service_list_personal_access_tokens_response.py +++ b/zitadel_client/models/user_service_list_personal_access_tokens_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_pagination_response import UserServicePaginationResponse -from zitadel_client.models.user_service_personal_access_token import UserServicePersonalAccessToken -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceListPersonalAccessTokensResponse(BaseModel): """ UserServiceListPersonalAccessTokensResponse - """ # noqa: E501 - pagination: Optional[UserServicePaginationResponse] = None - result: Optional[List[UserServicePersonalAccessToken]] = None - __properties: ClassVar[List[str]] = ["pagination", "result"] + """ + + pagination: Optional[UserServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + result: Optional[List[UserServicePersonalAccessToken]] = Field( + default=None, alias="result" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,11 @@ class UserServiceListPersonalAccessTokensResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListPersonalAccessTokensResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListPersonalAccessTokensResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": UserServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "result": [UserServicePersonalAccessToken.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_pagination_response import ( + UserServicePaginationResponse, +) +from zitadel_client.models.user_service_personal_access_token import ( + UserServicePersonalAccessToken, +) +UserServiceListPersonalAccessTokensResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_query.py b/zitadel_client/models/user_service_list_query.py index 33cbe86c..36807cfd 100644 --- a/zitadel_client/models/user_service_list_query.py +++ b/zitadel_client/models/user_service_list_query.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class UserServiceListQuery(BaseModel): """ UserServiceListQuery - """ # noqa: E501 - offset: Optional[Any] = None - limit: Optional[StrictInt] = None - asc: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field(default=None, alias="offset") + limit: Optional[StrictInt] = Field(default=None, alias="limit") + asc: Optional[StrictBool] = Field(default=None, alias="asc") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +32,4 @@ class UserServiceListQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +UserServiceListQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_user_metadata_request.py b/zitadel_client/models/user_service_list_user_metadata_request.py index 143e9d9b..1510b5ef 100644 --- a/zitadel_client/models/user_service_list_user_metadata_request.py +++ b/zitadel_client/models/user_service_list_user_metadata_request.py @@ -1,38 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_metadata_search_filter import UserServiceMetadataSearchFilter -from zitadel_client.models.user_service_pagination_request import UserServicePaginationRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceListUserMetadataRequest(BaseModel): """ UserServiceListUserMetadataRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="ID of the user under which the metadata is to be listed.", alias="userId") - pagination: Optional[UserServicePaginationRequest] = None - filters: Optional[List[UserServiceMetadataSearchFilter]] = Field(default=None, description="Define the criteria to query for.") - __properties: ClassVar[List[str]] = ["userId", "pagination", "filters"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="ID of the user under which the metadata is to be listed.", + ) + pagination: Optional[UserServicePaginationRequest] = Field( + default=None, alias="pagination" + ) + filters: Optional[List[UserServiceMetadataSearchFilter]] = Field( + default=None, alias="filters", description="Define the criteria to query for." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,64 +40,11 @@ class UserServiceListUserMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListUserMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in filters (list) - _items = [] - if self.filters: - for _item_filters in self.filters: - if _item_filters: - _items.append(_item_filters.to_dict()) - _dict['filters'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListUserMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "pagination": UserServicePaginationRequest.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "filters": [UserServiceMetadataSearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_metadata_search_filter import ( + UserServiceMetadataSearchFilter, +) +from zitadel_client.models.user_service_pagination_request import ( + UserServicePaginationRequest, +) +UserServiceListUserMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_user_metadata_response.py b/zitadel_client/models/user_service_list_user_metadata_response.py index 7ad94560..8cdee6ee 100644 --- a/zitadel_client/models/user_service_list_user_metadata_response.py +++ b/zitadel_client/models/user_service_list_user_metadata_response.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_metadata import UserServiceMetadata -from zitadel_client.models.user_service_pagination_response import UserServicePaginationResponse -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListUserMetadataResponse(BaseModel): """ UserServiceListUserMetadataResponse - """ # noqa: E501 - pagination: Optional[UserServicePaginationResponse] = None - metadata: Optional[List[UserServiceMetadata]] = Field(default=None, description="The user metadata requested.") - __properties: ClassVar[List[str]] = ["pagination", "metadata"] + """ + + pagination: Optional[UserServicePaginationResponse] = Field( + default=None, alias="pagination" + ) + metadata: Optional[List[UserServiceMetadata]] = Field( + default=None, alias="metadata", description="The user metadata requested." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,63 +34,9 @@ class UserServiceListUserMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListUserMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of pagination - if self.pagination: - _dict['pagination'] = self.pagination.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListUserMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "pagination": UserServicePaginationResponse.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None, - "metadata": [UserServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_metadata import UserServiceMetadata +from zitadel_client.models.user_service_pagination_response import ( + UserServicePaginationResponse, +) +UserServiceListUserMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_users_request.py b/zitadel_client/models/user_service_list_users_request.py index bae37e78..ec6dcfc6 100644 --- a/zitadel_client/models/user_service_list_users_request.py +++ b/zitadel_client/models/user_service_list_users_request.py @@ -1,39 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_list_query import UserServiceListQuery -from zitadel_client.models.user_service_search_query import UserServiceSearchQuery -from zitadel_client.models.user_service_user_field_name import UserServiceUserFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListUsersRequest(BaseModel): """ UserServiceListUsersRequest - """ # noqa: E501 - query: Optional[UserServiceListQuery] = None - sorting_column: Optional[UserServiceUserFieldName] = Field(default=None, alias="sortingColumn") - queries: Optional[List[UserServiceSearchQuery]] = Field(default=None, description="criteria the client is looking for") - __properties: ClassVar[List[str]] = ["query", "sortingColumn", "queries"] + """ + + query: Optional[UserServiceListQuery] = Field(default=None, alias="query") + sorting_column: Optional[UserServiceUserFieldName] = Field( + default=None, alias="sortingColumn" + ) + queries: Optional[List[UserServiceSearchQuery]] = Field( + default=None, alias="queries", description="criteria the client is looking for" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +35,8 @@ class UserServiceListUsersRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListUsersRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListUsersRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": UserServiceListQuery.from_dict(obj["query"]) if obj.get("query") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "queries": [UserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_list_query import UserServiceListQuery +from zitadel_client.models.user_service_search_query import UserServiceSearchQuery +from zitadel_client.models.user_service_user_field_name import UserServiceUserFieldName +UserServiceListUsersRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_list_users_response.py b/zitadel_client/models/user_service_list_users_response.py index 7949ba16..5f0765ee 100644 --- a/zitadel_client/models/user_service_list_users_response.py +++ b/zitadel_client/models/user_service_list_users_response.py @@ -1,39 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_list_details import UserServiceListDetails -from zitadel_client.models.user_service_user import UserServiceUser -from zitadel_client.models.user_service_user_field_name import UserServiceUserFieldName -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class UserServiceListUsersResponse(BaseModel): """ UserServiceListUsersResponse - """ # noqa: E501 - details: Optional[UserServiceListDetails] = None - sorting_column: Optional[UserServiceUserFieldName] = Field(default=None, alias="sortingColumn") - result: Optional[List[UserServiceUser]] = None - __properties: ClassVar[List[str]] = ["details", "sortingColumn", "result"] + """ + details: Optional[UserServiceListDetails] = Field(default=None, alias="details") + sorting_column: Optional[UserServiceUserFieldName] = Field( + default=None, alias="sortingColumn" + ) + result: Optional[List[UserServiceUser]] = Field(default=None, alias="result") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,64 +33,8 @@ class UserServiceListUsersResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceListUsersResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in result (list) - _items = [] - if self.result: - for _item_result in self.result: - if _item_result: - _items.append(_item_result.to_dict()) - _dict['result'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceListUsersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceListDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "sortingColumn": obj.get("sortingColumn"), - "result": [UserServiceUser.from_dict(_item) for _item in obj["result"]] if obj.get("result") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_list_details import UserServiceListDetails +from zitadel_client.models.user_service_user import UserServiceUser +from zitadel_client.models.user_service_user_field_name import UserServiceUserFieldName +UserServiceListUsersResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_lock_user_request.py b/zitadel_client/models/user_service_lock_user_request.py index cc3f4f19..59a0cf05 100644 --- a/zitadel_client/models/user_service_lock_user_request.py +++ b/zitadel_client/models/user_service_lock_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceLockUserRequest(BaseModel): """ UserServiceLockUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceLockUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceLockUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceLockUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceLockUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_lock_user_response.py b/zitadel_client/models/user_service_lock_user_response.py index 372b5448..2f9d7184 100644 --- a/zitadel_client/models/user_service_lock_user_response.py +++ b/zitadel_client/models/user_service_lock_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceLockUserResponse(BaseModel): """ UserServiceLockUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceLockUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceLockUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceLockUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceLockUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_login_name_query.py b/zitadel_client/models/user_service_login_name_query.py index f68038bb..27022159 100644 --- a/zitadel_client/models/user_service_login_name_query.py +++ b/zitadel_client/models/user_service_login_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceLoginNameQuery(BaseModel): """ Query for users with a specific state. - """ # noqa: E501 + """ + login_name: Optional[StrictStr] = Field(default=None, alias="loginName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["loginName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceLoginNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceLoginNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceLoginNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "loginName": obj.get("loginName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceLoginNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_machine.py b/zitadel_client/models/user_service_machine.py index 017617d7..98cc044b 100644 --- a/zitadel_client/models/user_service_machine.py +++ b/zitadel_client/models/user_service_machine.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceMachine(BaseModel): """ UserServiceMachine - """ # noqa: E501 - name: Optional[StrictStr] = Field(default=None, description="The machine users name is a human readable field that helps identifying the user.") - description: Optional[StrictStr] = Field(default=None, description="The description is a field that helps to remember the purpose of the user.") - __properties: ClassVar[List[str]] = ["name", "description"] + """ + + name: Optional[StrictStr] = Field( + default=None, + alias="name", + description="The machine users name is a human readable field that helps identifying the user.", + ) + description: Optional[StrictStr] = Field( + default=None, + alias="description", + description="The description is a field that helps to remember the purpose of the user.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +39,4 @@ class UserServiceMachine(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMachine from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if description (nullable) is None - # and model_fields_set contains the field - if self.description is None and "description" in self.model_fields_set: - _dict['description'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMachine from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "description": obj.get("description") - }) - return _obj - - +UserServiceMachine.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_machine_user.py b/zitadel_client/models/user_service_machine_user.py index 92a95e36..23267661 100644 --- a/zitadel_client/models/user_service_machine_user.py +++ b/zitadel_client/models/user_service_machine_user.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_access_token_type import UserServiceAccessTokenType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceMachineUser(BaseModel): """ UserServiceMachineUser - """ # noqa: E501 - name: Optional[StrictStr] = None - description: Optional[StrictStr] = None + """ + + name: Optional[StrictStr] = Field(default=None, alias="name") + description: Optional[StrictStr] = Field(default=None, alias="description") has_secret: Optional[StrictBool] = Field(default=None, alias="hasSecret") - access_token_type: Optional[UserServiceAccessTokenType] = Field(default=None, alias="accessTokenType") - __properties: ClassVar[List[str]] = ["name", "description", "hasSecret", "accessTokenType"] + access_token_type: Optional[UserServiceAccessTokenType] = Field( + default=None, alias="accessTokenType" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,55 +35,8 @@ class UserServiceMachineUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMachineUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMachineUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "description": obj.get("description"), - "hasSecret": obj.get("hasSecret"), - "accessTokenType": obj.get("accessTokenType") - }) - return _obj - +from zitadel_client.models.user_service_access_token_type import ( + UserServiceAccessTokenType, +) +UserServiceMachineUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_metadata.py b/zitadel_client/models/user_service_metadata.py index c91f70bf..523028b4 100644 --- a/zitadel_client/models/user_service_metadata.py +++ b/zitadel_client/models/user_service_metadata.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceMetadata(BaseModel): """ UserServiceMetadata - """ # noqa: E501 - key: Optional[StrictStr] = Field(default=None, description="Key in the metadata key/value pair.") - value: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="Value in the metadata key/value pair.") - __properties: ClassVar[List[str]] = ["key", "value"] + """ + + key: Optional[StrictStr] = Field( + default=None, alias="key", description="Key in the metadata key/value pair." + ) + value: Optional[Base64Bytes] = Field( + default=None, alias="value", description="Value in the metadata key/value pair." + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,6 @@ class UserServiceMetadata(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMetadata from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMetadata from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +UserServiceMetadata.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_metadata_key_filter.py b/zitadel_client/models/user_service_metadata_key_filter.py index cbf64105..b09fc88e 100644 --- a/zitadel_client/models/user_service_metadata_key_filter.py +++ b/zitadel_client/models/user_service_metadata_key_filter.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_filter_method import UserServiceTextFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceMetadataKeyFilter(BaseModel): """ UserServiceMetadataKeyFilter - """ # noqa: E501 - key: Optional[StrictStr] = None - method: Optional[UserServiceTextFilterMethod] = None - __properties: ClassVar[List[str]] = ["key", "method"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + method: Optional[UserServiceTextFilterMethod] = Field(default=None, alias="method") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceMetadataKeyFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMetadataKeyFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMetadataKeyFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_filter_method import ( + UserServiceTextFilterMethod, +) +UserServiceMetadataKeyFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_metadata_search_filter.py b/zitadel_client/models/user_service_metadata_search_filter.py index 1437e224..2c4da216 100644 --- a/zitadel_client/models/user_service_metadata_search_filter.py +++ b/zitadel_client/models/user_service_metadata_search_filter.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_metadata_key_filter import UserServiceMetadataKeyFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceMetadataSearchFilter(BaseModel): """ UserServiceMetadataSearchFilter - """ # noqa: E501 - key_filter: Optional[UserServiceMetadataKeyFilter] = Field(default=None, alias="keyFilter") - __properties: ClassVar[List[str]] = ["keyFilter"] + """ + key_filter: Optional[UserServiceMetadataKeyFilter] = Field( + default=None, alias="keyFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +31,8 @@ class UserServiceMetadataSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMetadataSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of key_filter - if self.key_filter: - _dict['keyFilter'] = self.key_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMetadataSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "keyFilter": UserServiceMetadataKeyFilter.from_dict(obj["keyFilter"]) if obj.get("keyFilter") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_metadata_key_filter import ( + UserServiceMetadataKeyFilter, +) +UserServiceMetadataSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_metadata_value_filter.py b/zitadel_client/models/user_service_metadata_value_filter.py index 4896ae88..7185bf40 100644 --- a/zitadel_client/models/user_service_metadata_value_filter.py +++ b/zitadel_client/models/user_service_metadata_value_filter.py @@ -1,36 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.user_service_byte_filter_method import UserServiceByteFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceMetadataValueFilter(BaseModel): """ UserServiceMetadataValueFilter - """ # noqa: E501 - value: Optional[Union[StrictBytes, StrictStr]] = None - method: Optional[UserServiceByteFilterMethod] = None - __properties: ClassVar[List[str]] = ["value", "method"] + """ + value: Optional[Base64Bytes] = Field(default=None, alias="value") + method: Optional[UserServiceByteFilterMethod] = Field(default=None, alias="method") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +30,9 @@ class UserServiceMetadataValueFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceMetadataValueFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceMetadataValueFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "value": obj.get("value"), - "method": obj.get("method") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.user_service_byte_filter_method import ( + UserServiceByteFilterMethod, +) +UserServiceMetadataValueFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_nick_name_query.py b/zitadel_client/models/user_service_nick_name_query.py index 182628ac..4b901d42 100644 --- a/zitadel_client/models/user_service_nick_name_query.py +++ b/zitadel_client/models/user_service_nick_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceNickNameQuery(BaseModel): """ Query for users with a specific nickname. - """ # noqa: E501 + """ + nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["nickName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceNickNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceNickNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceNickNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "nickName": obj.get("nickName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceNickNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_not_query.py b/zitadel_client/models/user_service_not_query.py index 41a12dfd..c152bbed 100644 --- a/zitadel_client/models/user_service_not_query.py +++ b/zitadel_client/models/user_service_not_query.py @@ -1,34 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceNotQuery(BaseModel): """ Negate the sub-condition. - """ # noqa: E501 - query: Optional[UserServiceSearchQuery] = None - __properties: ClassVar[List[str]] = ["query"] + """ + + query: Optional[UserServiceSearchQuery] = Field(default=None, alias="query") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,58 +29,6 @@ class UserServiceNotQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceNotQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of query - if self.query: - _dict['query'] = self.query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceNotQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "query": UserServiceSearchQuery.from_dict(obj["query"]) if obj.get("query") is not None else None - }) - return _obj - from zitadel_client.models.user_service_search_query import UserServiceSearchQuery -# TODO: Rewrite to not use raise_errors -UserServiceNotQuery.model_rebuild(raise_errors=False) +UserServiceNotQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_notification_type.py b/zitadel_client/models/user_service_notification_type.py index eca507c3..6b3dd4e4 100644 --- a/zitadel_client/models/user_service_notification_type.py +++ b/zitadel_client/models/user_service_notification_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceNotificationType(str, Enum): @@ -23,16 +13,6 @@ class UserServiceNotificationType(str, Enum): UserServiceNotificationType """ - """ - allowed enum values - """ - NOTIFICATION_TYPE_UNSPECIFIED = 'NOTIFICATION_TYPE_Unspecified' - NOTIFICATION_TYPE_EMAIL = 'NOTIFICATION_TYPE_Email' - NOTIFICATION_TYPE_SMS = 'NOTIFICATION_TYPE_SMS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceNotificationType from a JSON string""" - return cls(json.loads(json_str)) - - + NOTIFICATION_TYPE_UNSPECIFIED = "NOTIFICATION_TYPE_Unspecified" + NOTIFICATION_TYPE_EMAIL = "NOTIFICATION_TYPE_Email" + NOTIFICATION_TYPE_SMS = "NOTIFICATION_TYPE_SMS" diff --git a/zitadel_client/models/user_service_or_query.py b/zitadel_client/models/user_service_or_query.py index 4dde7c89..04c945fa 100644 --- a/zitadel_client/models/user_service_or_query.py +++ b/zitadel_client/models/user_service_or_query.py @@ -1,34 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import List, Optional + class UserServiceOrQuery(BaseModel): """ Connect multiple sub-condition with and OR operator. - """ # noqa: E501 - queries: Optional[List[UserServiceSearchQuery]] = None - __properties: ClassVar[List[str]] = ["queries"] + """ + + queries: Optional[List[UserServiceSearchQuery]] = Field( + default=None, alias="queries" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,62 +31,6 @@ class UserServiceOrQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceOrQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in queries (list) - _items = [] - if self.queries: - for _item_queries in self.queries: - if _item_queries: - _items.append(_item_queries.to_dict()) - _dict['queries'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceOrQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "queries": [UserServiceSearchQuery.from_dict(_item) for _item in obj["queries"]] if obj.get("queries") is not None else None - }) - return _obj - from zitadel_client.models.user_service_search_query import UserServiceSearchQuery -# TODO: Rewrite to not use raise_errors -UserServiceOrQuery.model_rebuild(raise_errors=False) +UserServiceOrQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_organization.py b/zitadel_client/models/user_service_organization.py index f9df8ed7..e39643b7 100644 --- a/zitadel_client/models/user_service_organization.py +++ b/zitadel_client/models/user_service_organization.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceOrganization(BaseModel): """ UserServiceOrganization - """ # noqa: E501 + """ + org_domain: Optional[StrictStr] = Field(default=None, alias="orgDomain") org_id: Optional[StrictStr] = Field(default=None, alias="orgId") - __properties: ClassVar[List[str]] = ["orgDomain", "orgId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceOrganization(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceOrganization from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceOrganization from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "orgDomain": obj.get("orgDomain"), - "orgId": obj.get("orgId") - }) - return _obj - - +UserServiceOrganization.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_organization_id_query.py b/zitadel_client/models/user_service_organization_id_query.py index 68aea86d..5c5eb37c 100644 --- a/zitadel_client/models/user_service_organization_id_query.py +++ b/zitadel_client/models/user_service_organization_id_query.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceOrganizationIdQuery(BaseModel): """ Query for users under a specific organization as resource owner. - """ # noqa: E501 + """ + organization_id: Optional[StrictStr] = Field(default=None, alias="organizationId") - __properties: ClassVar[List[str]] = ["organizationId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceOrganizationIdQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceOrganizationIdQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceOrganizationIdQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "organizationId": obj.get("organizationId") - }) - return _obj - - +UserServiceOrganizationIdQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_pagination_request.py b/zitadel_client/models/user_service_pagination_request.py index dd98a4a0..d52a10bf 100644 --- a/zitadel_client/models/user_service_pagination_request.py +++ b/zitadel_client/models/user_service_pagination_request.py @@ -1,36 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictInt +from typing import Optional + class UserServicePaginationRequest(BaseModel): """ UserServicePaginationRequest - """ # noqa: E501 - offset: Optional[Any] = Field(default=None, description="Starting point for retrieval, in combination of offset used to query a set list of objects.") - limit: Optional[StrictInt] = Field(default=None, description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.") - asc: Optional[StrictBool] = Field(default=None, description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.") - __properties: ClassVar[List[str]] = ["offset", "limit", "asc"] + """ + + offset: Optional[object] = Field( + default=None, + alias="offset", + description="Starting point for retrieval, in combination of offset used to query a set list of objects.", + ) + limit: Optional[StrictInt] = Field( + default=None, + alias="limit", + description="limit is the maximum amount of objects returned. The default is set to 100 with a maximum of 1000 in the runtime configuration. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.", + ) + asc: Optional[StrictBool] = Field( + default=None, + alias="asc", + description="Asc is the sorting order. If true the list is sorted ascending, if false the list is sorted descending. The default is descending.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,59 +44,4 @@ class UserServicePaginationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePaginationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if offset (nullable) is None - # and model_fields_set contains the field - if self.offset is None and "offset" in self.model_fields_set: - _dict['offset'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePaginationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "offset": obj.get("offset"), - "limit": obj.get("limit"), - "asc": obj.get("asc") - }) - return _obj - - +UserServicePaginationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_pagination_response.py b/zitadel_client/models/user_service_pagination_response.py index c96dfdbe..b3cf1e77 100644 --- a/zitadel_client/models/user_service_pagination_response.py +++ b/zitadel_client/models/user_service_pagination_response.py @@ -1,35 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServicePaginationResponse(BaseModel): """ UserServicePaginationResponse - """ # noqa: E501 - total_result: Optional[Any] = Field(default=None, description="Absolute number of objects matching the query, regardless of applied limit.", alias="totalResult") - applied_limit: Optional[Any] = Field(default=None, description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", alias="appliedLimit") - __properties: ClassVar[List[str]] = ["totalResult", "appliedLimit"] + """ + + total_result: Optional[object] = Field( + default=None, + alias="totalResult", + description="Absolute number of objects matching the query, regardless of applied limit.", + ) + applied_limit: Optional[object] = Field( + default=None, + alias="appliedLimit", + description="Applied limit from query, defines maximum amount of objects per request, to compare if all objects are returned.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +38,4 @@ class UserServicePaginationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePaginationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if total_result (nullable) is None - # and model_fields_set contains the field - if self.total_result is None and "total_result" in self.model_fields_set: - _dict['totalResult'] = None - - # set to None if applied_limit (nullable) is None - # and model_fields_set contains the field - if self.applied_limit is None and "applied_limit" in self.model_fields_set: - _dict['appliedLimit'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePaginationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "totalResult": obj.get("totalResult"), - "appliedLimit": obj.get("appliedLimit") - }) - return _obj - - +UserServicePaginationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_passkey.py b/zitadel_client/models/user_service_passkey.py index 38535b13..2a9822b0 100644 --- a/zitadel_client/models/user_service_passkey.py +++ b/zitadel_client/models/user_service_passkey.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_auth_factor_state import UserServiceAuthFactorState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePasskey(BaseModel): """ UserServicePasskey - """ # noqa: E501 - id: Optional[StrictStr] = None - state: Optional[UserServiceAuthFactorState] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "state", "name"] + """ + id: Optional[StrictStr] = Field(default=None, alias="id") + state: Optional[UserServiceAuthFactorState] = Field(default=None, alias="state") + name: Optional[StrictStr] = Field(default=None, alias="name") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,54 +32,8 @@ class UserServicePasskey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePasskey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePasskey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "state": obj.get("state"), - "name": obj.get("name") - }) - return _obj - +from zitadel_client.models.user_service_auth_factor_state import ( + UserServiceAuthFactorState, +) +UserServicePasskey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_passkey_authenticator.py b/zitadel_client/models/user_service_passkey_authenticator.py index 1b69f049..f1ce5661 100644 --- a/zitadel_client/models/user_service_passkey_authenticator.py +++ b/zitadel_client/models/user_service_passkey_authenticator.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServicePasskeyAuthenticator(str, Enum): @@ -23,16 +13,6 @@ class UserServicePasskeyAuthenticator(str, Enum): UserServicePasskeyAuthenticator """ - """ - allowed enum values - """ - PASSKEY_AUTHENTICATOR_UNSPECIFIED = 'PASSKEY_AUTHENTICATOR_UNSPECIFIED' - PASSKEY_AUTHENTICATOR_PLATFORM = 'PASSKEY_AUTHENTICATOR_PLATFORM' - PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = 'PASSKEY_AUTHENTICATOR_CROSS_PLATFORM' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServicePasskeyAuthenticator from a JSON string""" - return cls(json.loads(json_str)) - - + PASSKEY_AUTHENTICATOR_UNSPECIFIED = "PASSKEY_AUTHENTICATOR_UNSPECIFIED" + PASSKEY_AUTHENTICATOR_PLATFORM = "PASSKEY_AUTHENTICATOR_PLATFORM" + PASSKEY_AUTHENTICATOR_CROSS_PLATFORM = "PASSKEY_AUTHENTICATOR_CROSS_PLATFORM" diff --git a/zitadel_client/models/user_service_passkey_registration_code.py b/zitadel_client/models/user_service_passkey_registration_code.py index 13035de9..cb34c1e5 100644 --- a/zitadel_client/models/user_service_passkey_registration_code.py +++ b/zitadel_client/models/user_service_passkey_registration_code.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePasskeyRegistrationCode(BaseModel): """ UserServicePasskeyRegistrationCode - """ # noqa: E501 - id: Optional[StrictStr] = None - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["id", "code"] + """ + + id: Optional[StrictStr] = Field(default=None, alias="id") + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServicePasskeyRegistrationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePasskeyRegistrationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePasskeyRegistrationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "code": obj.get("code") - }) - return _obj - - +UserServicePasskeyRegistrationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_password.py b/zitadel_client/models/user_service_password.py index c57e466d..15dc37c2 100644 --- a/zitadel_client/models/user_service_password.py +++ b/zitadel_client/models/user_service_password.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServicePassword(BaseModel): """ UserServicePassword - """ # noqa: E501 - password: Optional[StrictStr] = None + """ + + password: Optional[StrictStr] = Field(default=None, alias="password") change_required: Optional[StrictBool] = Field(default=None, alias="changeRequired") - __properties: ClassVar[List[str]] = ["password", "changeRequired"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServicePassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "password": obj.get("password"), - "changeRequired": obj.get("changeRequired") - }) - return _obj - - +UserServicePassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_password_reset_request.py b/zitadel_client/models/user_service_password_reset_request.py index db3f3520..d988f912 100644 --- a/zitadel_client/models/user_service_password_reset_request.py +++ b/zitadel_client/models/user_service_password_reset_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_password_reset_link import UserServiceSendPasswordResetLink -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePasswordResetRequest(BaseModel): """ UserServicePasswordResetRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_link: Optional[UserServiceSendPasswordResetLink] = Field(default=None, alias="sendLink") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendLink"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_link: Optional[UserServiceSendPasswordResetLink] = Field( + default=None, alias="sendLink" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class UserServicePasswordResetRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePasswordResetRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_link - if self.send_link: - _dict['sendLink'] = self.send_link.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePasswordResetRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendLink": UserServiceSendPasswordResetLink.from_dict(obj["sendLink"]) if obj.get("sendLink") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_password_reset_link import ( + UserServiceSendPasswordResetLink, +) +UserServicePasswordResetRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_password_reset_response.py b/zitadel_client/models/user_service_password_reset_response.py index 034cb6f7..f4b6faa8 100644 --- a/zitadel_client/models/user_service_password_reset_response.py +++ b/zitadel_client/models/user_service_password_reset_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePasswordResetResponse(BaseModel): """ UserServicePasswordResetResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the medium was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the medium was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServicePasswordResetResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePasswordResetResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePasswordResetResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServicePasswordResetResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_personal_access_token.py b/zitadel_client/models/user_service_personal_access_token.py index fcfe107b..d137776b 100644 --- a/zitadel_client/models/user_service_personal_access_token.py +++ b/zitadel_client/models/user_service_personal_access_token.py @@ -1,40 +1,57 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePersonalAccessToken(BaseModel): """ UserServicePersonalAccessToken - """ # noqa: E501 - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the personal access token.") - user_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the user the personal access token belongs to.", alias="userId") - organization_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the organization the personal access token belongs to.", alias="organizationId") - expiration_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="expirationDate") - __properties: ClassVar[List[str]] = ["creationDate", "changeDate", "id", "userId", "organizationId", "expirationDate"] + """ + + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the personal access token.", + ) + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="The unique identifier of the user the personal access token belongs to.", + ) + organization_id: Optional[StrictStr] = Field( + default=None, + alias="organizationId", + description="The unique identifier of the organization the personal access token belongs to.", + ) + expiration_date: Optional[AwareDatetime] = Field( + default=None, + alias="expirationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,57 +59,6 @@ class UserServicePersonalAccessToken(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePersonalAccessToken from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePersonalAccessToken from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "id": obj.get("id"), - "userId": obj.get("userId"), - "organizationId": obj.get("organizationId"), - "expirationDate": obj.get("expirationDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServicePersonalAccessToken.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_personal_access_token_field_name.py b/zitadel_client/models/user_service_personal_access_token_field_name.py index 2e181528..39284fb1 100644 --- a/zitadel_client/models/user_service_personal_access_token_field_name.py +++ b/zitadel_client/models/user_service_personal_access_token_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServicePersonalAccessTokenFieldName(str, Enum): @@ -23,19 +13,19 @@ class UserServicePersonalAccessTokenFieldName(str, Enum): UserServicePersonalAccessTokenFieldName """ - """ - allowed enum values - """ - PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED' - PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE' - PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID' - PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID' - PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID' - PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE = 'PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServicePersonalAccessTokenFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED = ( + "PERSONAL_ACCESS_TOKEN_FIELD_NAME_UNSPECIFIED" + ) + PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE = ( + "PERSONAL_ACCESS_TOKEN_FIELD_NAME_CREATED_DATE" + ) + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID = "PERSONAL_ACCESS_TOKEN_FIELD_NAME_ID" + PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID = ( + "PERSONAL_ACCESS_TOKEN_FIELD_NAME_USER_ID" + ) + PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID = ( + "PERSONAL_ACCESS_TOKEN_FIELD_NAME_ORGANIZATION_ID" + ) + PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE = ( + "PERSONAL_ACCESS_TOKEN_FIELD_NAME_EXPIRATION_DATE" + ) diff --git a/zitadel_client/models/user_service_personal_access_tokens_search_filter.py b/zitadel_client/models/user_service_personal_access_tokens_search_filter.py index 19eab47b..4be2ee5b 100644 --- a/zitadel_client/models/user_service_personal_access_tokens_search_filter.py +++ b/zitadel_client/models/user_service_personal_access_tokens_search_filter.py @@ -1,40 +1,41 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_id_filter import UserServiceIDFilter -from zitadel_client.models.user_service_timestamp_filter import UserServiceTimestampFilter -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServicePersonalAccessTokensSearchFilter(BaseModel): """ UserServicePersonalAccessTokensSearchFilter - """ # noqa: E501 - created_date_filter: Optional[UserServiceTimestampFilter] = Field(default=None, alias="createdDateFilter") - expiration_date_filter: Optional[UserServiceTimestampFilter] = Field(default=None, alias="expirationDateFilter") - organization_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="organizationIdFilter") - token_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="tokenIdFilter") - user_id_filter: Optional[UserServiceIDFilter] = Field(default=None, alias="userIdFilter") - __properties: ClassVar[List[str]] = ["createdDateFilter", "expirationDateFilter", "organizationIdFilter", "tokenIdFilter", "userIdFilter"] + """ + created_date_filter: Optional[UserServiceTimestampFilter] = Field( + default=None, alias="createdDateFilter" + ) + expiration_date_filter: Optional[UserServiceTimestampFilter] = Field( + default=None, alias="expirationDateFilter" + ) + organization_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="organizationIdFilter" + ) + token_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="tokenIdFilter" + ) + user_id_filter: Optional[UserServiceIDFilter] = Field( + default=None, alias="userIdFilter" + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,71 +43,9 @@ class UserServicePersonalAccessTokensSearchFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePersonalAccessTokensSearchFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of created_date_filter - if self.created_date_filter: - _dict['createdDateFilter'] = self.created_date_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of expiration_date_filter - if self.expiration_date_filter: - _dict['expirationDateFilter'] = self.expiration_date_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_filter - if self.organization_id_filter: - _dict['organizationIdFilter'] = self.organization_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of token_id_filter - if self.token_id_filter: - _dict['tokenIdFilter'] = self.token_id_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_id_filter - if self.user_id_filter: - _dict['userIdFilter'] = self.user_id_filter.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePersonalAccessTokensSearchFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "createdDateFilter": UserServiceTimestampFilter.from_dict(obj["createdDateFilter"]) if obj.get("createdDateFilter") is not None else None, - "expirationDateFilter": UserServiceTimestampFilter.from_dict(obj["expirationDateFilter"]) if obj.get("expirationDateFilter") is not None else None, - "organizationIdFilter": UserServiceIDFilter.from_dict(obj["organizationIdFilter"]) if obj.get("organizationIdFilter") is not None else None, - "tokenIdFilter": UserServiceIDFilter.from_dict(obj["tokenIdFilter"]) if obj.get("tokenIdFilter") is not None else None, - "userIdFilter": UserServiceIDFilter.from_dict(obj["userIdFilter"]) if obj.get("userIdFilter") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_id_filter import UserServiceIDFilter +from zitadel_client.models.user_service_timestamp_filter import ( + UserServiceTimestampFilter, +) +UserServicePersonalAccessTokensSearchFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_phone_query.py b/zitadel_client/models/user_service_phone_query.py index 4c864508..4e692eb9 100644 --- a/zitadel_client/models/user_service_phone_query.py +++ b/zitadel_client/models/user_service_phone_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServicePhoneQuery(BaseModel): """ Query for users with a specific phone. - """ # noqa: E501 - number: Optional[StrictStr] = None - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["number", "method"] + """ + number: Optional[StrictStr] = Field(default=None, alias="number") + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServicePhoneQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServicePhoneQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServicePhoneQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "number": obj.get("number"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServicePhoneQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_profile.py b/zitadel_client/models/user_service_profile.py index 829f78fc..01902d5a 100644 --- a/zitadel_client/models/user_service_profile.py +++ b/zitadel_client/models/user_service_profile.py @@ -1,40 +1,53 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_gender import UserServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceProfile(BaseModel): """ UserServiceProfile - """ # noqa: E501 - given_name: Optional[StrictStr] = Field(default=None, description="The given name is the first name of the user. For example, it can be used to personalize notifications and login UIs.", alias="givenName") - family_name: Optional[StrictStr] = Field(default=None, description="The family name is the last name of the user. For example, it can be used to personalize user interfaces and notifications.", alias="familyName") - nick_name: Optional[StrictStr] = Field(default=None, description="The nick name is the users short name. For example, it can be used to personalize user interfaces and notifications.", alias="nickName") - display_name: Optional[StrictStr] = Field(default=None, description="The display name is how a user should primarily be displayed in lists. It can also for example be used to personalize user interfaces and notifications.", alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, description="The users preferred language is the language that systems should use to interact with the user. It has the format of a [BCP-47 language tag](https://datatracker.ietf.org/doc/html/rfc3066). It is used by Zitadel where no higher prioritized preferred language can be used. For example, browser settings can overwrite a users preferred_language. Notification messages and standard login UIs use the users preferred language if it is supported and allowed on the instance. Else, the default language of the instance is used.", alias="preferredLanguage") - gender: Optional[UserServiceGender] = None - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender"] + """ + given_name: Optional[StrictStr] = Field( + default=None, + alias="givenName", + description="The given name is the first name of the user. For example, it can be used to personalize notifications and login UIs.", + ) + family_name: Optional[StrictStr] = Field( + default=None, + alias="familyName", + description="The family name is the last name of the user. For example, it can be used to personalize user interfaces and notifications.", + ) + nick_name: Optional[StrictStr] = Field( + default=None, + alias="nickName", + description="The nick name is the users short name. For example, it can be used to personalize user interfaces and notifications.", + ) + display_name: Optional[StrictStr] = Field( + default=None, + alias="displayName", + description="The display name is how a user should primarily be displayed in lists. It can also for example be used to personalize user interfaces and notifications.", + ) + preferred_language: Optional[StrictStr] = Field( + default=None, + alias="preferredLanguage", + description="The users preferred language is the language that systems should use to interact with the user. It has the format of a [BCP-47 language tag](https://datatracker.ietf.org/doc/html/rfc3066). It is used by Zitadel where no higher prioritized preferred language can be used. For example, browser settings can overwrite a users preferred_language. Notification messages and standard login UIs use the users preferred language if it is supported and allowed on the instance. Else, the default language of the instance is used.", + ) + gender: Optional[UserServiceGender] = Field(default=None, alias="gender") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,82 +55,6 @@ class UserServiceProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if given_name (nullable) is None - # and model_fields_set contains the field - if self.given_name is None and "given_name" in self.model_fields_set: - _dict['givenName'] = None - - # set to None if family_name (nullable) is None - # and model_fields_set contains the field - if self.family_name is None and "family_name" in self.model_fields_set: - _dict['familyName'] = None - - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender") - }) - return _obj - +from zitadel_client.models.user_service_gender import UserServiceGender +UserServiceProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_reactivate_user_request.py b/zitadel_client/models/user_service_reactivate_user_request.py index 076534fc..1653a276 100644 --- a/zitadel_client/models/user_service_reactivate_user_request.py +++ b/zitadel_client/models/user_service_reactivate_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceReactivateUserRequest(BaseModel): """ UserServiceReactivateUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceReactivateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceReactivateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceReactivateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceReactivateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_reactivate_user_response.py b/zitadel_client/models/user_service_reactivate_user_response.py index 7a8cd73f..707d9940 100644 --- a/zitadel_client/models/user_service_reactivate_user_response.py +++ b/zitadel_client/models/user_service_reactivate_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceReactivateUserResponse(BaseModel): """ UserServiceReactivateUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceReactivateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceReactivateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceReactivateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceReactivateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_redirect_urls.py b/zitadel_client/models/user_service_redirect_urls.py index 276f82a7..3bf70408 100644 --- a/zitadel_client/models/user_service_redirect_urls.py +++ b/zitadel_client/models/user_service_redirect_urls.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRedirectURLs(BaseModel): """ UserServiceRedirectURLs - """ # noqa: E501 + """ + success_url: Optional[StrictStr] = Field(default=None, alias="successUrl") failure_url: Optional[StrictStr] = Field(default=None, alias="failureUrl") - __properties: ClassVar[List[str]] = ["successUrl", "failureUrl"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceRedirectURLs(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRedirectURLs from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRedirectURLs from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "successUrl": obj.get("successUrl"), - "failureUrl": obj.get("failureUrl") - }) - return _obj - - +UserServiceRedirectURLs.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_passkey_request.py b/zitadel_client/models/user_service_register_passkey_request.py index a0ab83a8..bba1ab02 100644 --- a/zitadel_client/models/user_service_register_passkey_request.py +++ b/zitadel_client/models/user_service_register_passkey_request.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_passkey_authenticator import UserServicePasskeyAuthenticator -from zitadel_client.models.user_service_passkey_registration_code import UserServicePasskeyRegistrationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRegisterPasskeyRequest(BaseModel): """ UserServiceRegisterPasskeyRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - code: Optional[UserServicePasskeyRegistrationCode] = None - authenticator: Optional[UserServicePasskeyAuthenticator] = None - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "code", "authenticator", "domain"] + code: Optional[UserServicePasskeyRegistrationCode] = Field( + default=None, alias="code" + ) + authenticator: Optional[UserServicePasskeyAuthenticator] = Field( + default=None, alias="authenticator" + ) + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,58 +37,11 @@ class UserServiceRegisterPasskeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterPasskeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of code - if self.code: - _dict['code'] = self.code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterPasskeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "code": UserServicePasskeyRegistrationCode.from_dict(obj["code"]) if obj.get("code") is not None else None, - "authenticator": obj.get("authenticator"), - "domain": obj.get("domain") - }) - return _obj - +from zitadel_client.models.user_service_passkey_authenticator import ( + UserServicePasskeyAuthenticator, +) +from zitadel_client.models.user_service_passkey_registration_code import ( + UserServicePasskeyRegistrationCode, +) +UserServiceRegisterPasskeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_passkey_response.py b/zitadel_client/models/user_service_register_passkey_response.py index 32ba6be5..7664ed8e 100644 --- a/zitadel_client/models/user_service_register_passkey_response.py +++ b/zitadel_client/models/user_service_register_passkey_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceRegisterPasskeyResponse(BaseModel): """ UserServiceRegisterPasskeyResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None + """ + + details: Optional[UserServiceDetails] = Field(default=None, alias="details") passkey_id: Optional[StrictStr] = Field(default=None, alias="passkeyId") - public_key_credential_creation_options: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredentialCreationOptions") - __properties: ClassVar[List[str]] = ["details", "passkeyId", "publicKeyCredentialCreationOptions"] + public_key_credential_creation_options: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredentialCreationOptions", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +36,6 @@ class UserServiceRegisterPasskeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterPasskeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterPasskeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "passkeyId": obj.get("passkeyId"), - "publicKeyCredentialCreationOptions": obj.get("publicKeyCredentialCreationOptions") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRegisterPasskeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_totp_request.py b/zitadel_client/models/user_service_register_totp_request.py index 98e909bc..69c246ce 100644 --- a/zitadel_client/models/user_service_register_totp_request.py +++ b/zitadel_client/models/user_service_register_totp_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRegisterTOTPRequest(BaseModel): """ UserServiceRegisterTOTPRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRegisterTOTPRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterTOTPRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterTOTPRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRegisterTOTPRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_totp_response.py b/zitadel_client/models/user_service_register_totp_response.py index 01793738..9fd0a833 100644 --- a/zitadel_client/models/user_service_register_totp_response.py +++ b/zitadel_client/models/user_service_register_totp_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRegisterTOTPResponse(BaseModel): """ UserServiceRegisterTOTPResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - uri: Optional[StrictStr] = None - secret: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["details", "uri", "secret"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + uri: Optional[StrictStr] = Field(default=None, alias="uri") + secret: Optional[StrictStr] = Field(default=None, alias="secret") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +32,6 @@ class UserServiceRegisterTOTPResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterTOTPResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterTOTPResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "uri": obj.get("uri"), - "secret": obj.get("secret") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRegisterTOTPResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_u2_f_request.py b/zitadel_client/models/user_service_register_u2_f_request.py index 95f14ca8..56fcbb09 100644 --- a/zitadel_client/models/user_service_register_u2_f_request.py +++ b/zitadel_client/models/user_service_register_u2_f_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRegisterU2FRequest(BaseModel): """ UserServiceRegisterU2FRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - domain: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "domain"] + domain: Optional[StrictStr] = Field(default=None, alias="domain") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceRegisterU2FRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterU2FRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterU2FRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "domain": obj.get("domain") - }) - return _obj - - +UserServiceRegisterU2FRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_register_u2_f_response.py b/zitadel_client/models/user_service_register_u2_f_response.py index c3c7e74d..72f2dc05 100644 --- a/zitadel_client/models/user_service_register_u2_f_response.py +++ b/zitadel_client/models/user_service_register_u2_f_response.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceRegisterU2FResponse(BaseModel): """ UserServiceRegisterU2FResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None + """ + + details: Optional[UserServiceDetails] = Field(default=None, alias="details") u2f_id: Optional[StrictStr] = Field(default=None, alias="u2fId") - public_key_credential_creation_options: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredentialCreationOptions") - __properties: ClassVar[List[str]] = ["details", "u2fId", "publicKeyCredentialCreationOptions"] + public_key_credential_creation_options: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredentialCreationOptions", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +36,6 @@ class UserServiceRegisterU2FResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRegisterU2FResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRegisterU2FResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "u2fId": obj.get("u2fId"), - "publicKeyCredentialCreationOptions": obj.get("publicKeyCredentialCreationOptions") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRegisterU2FResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_idp_link_request.py b/zitadel_client/models/user_service_remove_idp_link_request.py index 694a1e38..a5b9b3a3 100644 --- a/zitadel_client/models/user_service_remove_idp_link_request.py +++ b/zitadel_client/models/user_service_remove_idp_link_request.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveIDPLinkRequest(BaseModel): """ UserServiceRemoveIDPLinkRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") linked_user_id: Optional[StrictStr] = Field(default=None, alias="linkedUserId") - __properties: ClassVar[List[str]] = ["userId", "idpId", "linkedUserId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class UserServiceRemoveIDPLinkRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveIDPLinkRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveIDPLinkRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "idpId": obj.get("idpId"), - "linkedUserId": obj.get("linkedUserId") - }) - return _obj - - +UserServiceRemoveIDPLinkRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_idp_link_response.py b/zitadel_client/models/user_service_remove_idp_link_response.py index 2dda8c12..cde5d57a 100644 --- a/zitadel_client/models/user_service_remove_idp_link_response.py +++ b/zitadel_client/models/user_service_remove_idp_link_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveIDPLinkResponse(BaseModel): """ UserServiceRemoveIDPLinkResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveIDPLinkResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveIDPLinkResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveIDPLinkResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveIDPLinkResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_key_request.py b/zitadel_client/models/user_service_remove_key_request.py index 9dc510df..6e05ddb3 100644 --- a/zitadel_client/models/user_service_remove_key_request.py +++ b/zitadel_client/models/user_service_remove_key_request.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveKeyRequest(BaseModel): """ UserServiceRemoveKeyRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - key_id: Optional[StrictStr] = Field(default=None, description="The keys ID.", alias="keyId") - __properties: ClassVar[List[str]] = ["userId", "keyId"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + key_id: Optional[StrictStr] = Field( + default=None, alias="keyId", description="The keys ID." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,4 @@ class UserServiceRemoveKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "keyId": obj.get("keyId") - }) - return _obj - - +UserServiceRemoveKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_key_response.py b/zitadel_client/models/user_service_remove_key_response.py index b50f160d..f3b663f2 100644 --- a/zitadel_client/models/user_service_remove_key_response.py +++ b/zitadel_client/models/user_service_remove_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceRemoveKeyResponse(BaseModel): """ UserServiceRemoveKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class UserServiceRemoveKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceRemoveKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_otp_email_request.py b/zitadel_client/models/user_service_remove_otp_email_request.py index e3436dfd..ad7480c5 100644 --- a/zitadel_client/models/user_service_remove_otp_email_request.py +++ b/zitadel_client/models/user_service_remove_otp_email_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveOTPEmailRequest(BaseModel): """ UserServiceRemoveOTPEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRemoveOTPEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemoveOTPEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_otp_email_response.py b/zitadel_client/models/user_service_remove_otp_email_response.py index a671e87d..b93f5da3 100644 --- a/zitadel_client/models/user_service_remove_otp_email_response.py +++ b/zitadel_client/models/user_service_remove_otp_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveOTPEmailResponse(BaseModel): """ UserServiceRemoveOTPEmailResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveOTPEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveOTPEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_otpsms_request.py b/zitadel_client/models/user_service_remove_otpsms_request.py index b528cb90..f39d274e 100644 --- a/zitadel_client/models/user_service_remove_otpsms_request.py +++ b/zitadel_client/models/user_service_remove_otpsms_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveOTPSMSRequest(BaseModel): """ UserServiceRemoveOTPSMSRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRemoveOTPSMSRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPSMSRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPSMSRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemoveOTPSMSRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_otpsms_response.py b/zitadel_client/models/user_service_remove_otpsms_response.py index 3eb1eb86..454adf30 100644 --- a/zitadel_client/models/user_service_remove_otpsms_response.py +++ b/zitadel_client/models/user_service_remove_otpsms_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveOTPSMSResponse(BaseModel): """ UserServiceRemoveOTPSMSResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveOTPSMSResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPSMSResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveOTPSMSResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveOTPSMSResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_passkey_request.py b/zitadel_client/models/user_service_remove_passkey_request.py index ceb1140b..64592f5e 100644 --- a/zitadel_client/models/user_service_remove_passkey_request.py +++ b/zitadel_client/models/user_service_remove_passkey_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemovePasskeyRequest(BaseModel): """ UserServiceRemovePasskeyRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") passkey_id: Optional[StrictStr] = Field(default=None, alias="passkeyId") - __properties: ClassVar[List[str]] = ["userId", "passkeyId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceRemovePasskeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePasskeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePasskeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "passkeyId": obj.get("passkeyId") - }) - return _obj - - +UserServiceRemovePasskeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_passkey_response.py b/zitadel_client/models/user_service_remove_passkey_response.py index a8df95eb..c95238f8 100644 --- a/zitadel_client/models/user_service_remove_passkey_response.py +++ b/zitadel_client/models/user_service_remove_passkey_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemovePasskeyResponse(BaseModel): """ UserServiceRemovePasskeyResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemovePasskeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePasskeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePasskeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemovePasskeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_personal_access_token_request.py b/zitadel_client/models/user_service_remove_personal_access_token_request.py index 344137de..13e2766a 100644 --- a/zitadel_client/models/user_service_remove_personal_access_token_request.py +++ b/zitadel_client/models/user_service_remove_personal_access_token_request.py @@ -1,35 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemovePersonalAccessTokenRequest(BaseModel): """ UserServiceRemovePersonalAccessTokenRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - token_id: Optional[StrictStr] = Field(default=None, description="The tokens ID.", alias="tokenId") - __properties: ClassVar[List[str]] = ["userId", "tokenId"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + token_id: Optional[StrictStr] = Field( + default=None, alias="tokenId", description="The tokens ID." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +35,4 @@ class UserServiceRemovePersonalAccessTokenRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePersonalAccessTokenRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePersonalAccessTokenRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "tokenId": obj.get("tokenId") - }) - return _obj - - +UserServiceRemovePersonalAccessTokenRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_personal_access_token_response.py b/zitadel_client/models/user_service_remove_personal_access_token_response.py index 4a675e5d..55965bff 100644 --- a/zitadel_client/models/user_service_remove_personal_access_token_response.py +++ b/zitadel_client/models/user_service_remove_personal_access_token_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceRemovePersonalAccessTokenResponse(BaseModel): """ UserServiceRemovePersonalAccessTokenResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class UserServiceRemovePersonalAccessTokenResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePersonalAccessTokenResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePersonalAccessTokenResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceRemovePersonalAccessTokenResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_phone_request.py b/zitadel_client/models/user_service_remove_phone_request.py index c4f6199c..bf2051dd 100644 --- a/zitadel_client/models/user_service_remove_phone_request.py +++ b/zitadel_client/models/user_service_remove_phone_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemovePhoneRequest(BaseModel): """ UserServiceRemovePhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRemovePhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemovePhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_phone_response.py b/zitadel_client/models/user_service_remove_phone_response.py index ab691710..48e12db1 100644 --- a/zitadel_client/models/user_service_remove_phone_response.py +++ b/zitadel_client/models/user_service_remove_phone_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemovePhoneResponse(BaseModel): """ UserServiceRemovePhoneResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemovePhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemovePhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemovePhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemovePhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_recovery_codes_request.py b/zitadel_client/models/user_service_remove_recovery_codes_request.py index 8f505d85..45151297 100644 --- a/zitadel_client/models/user_service_remove_recovery_codes_request.py +++ b/zitadel_client/models/user_service_remove_recovery_codes_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveRecoveryCodesRequest(BaseModel): """ UserServiceRemoveRecoveryCodesRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRemoveRecoveryCodesRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveRecoveryCodesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveRecoveryCodesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemoveRecoveryCodesRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_recovery_codes_response.py b/zitadel_client/models/user_service_remove_recovery_codes_response.py index ffeb5eda..c0bbbdaf 100644 --- a/zitadel_client/models/user_service_remove_recovery_codes_response.py +++ b/zitadel_client/models/user_service_remove_recovery_codes_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveRecoveryCodesResponse(BaseModel): """ UserServiceRemoveRecoveryCodesResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveRecoveryCodesResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveRecoveryCodesResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveRecoveryCodesResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveRecoveryCodesResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_secret_request.py b/zitadel_client/models/user_service_remove_secret_request.py index 2b52c6d5..7fdff1dd 100644 --- a/zitadel_client/models/user_service_remove_secret_request.py +++ b/zitadel_client/models/user_service_remove_secret_request.py @@ -1,34 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveSecretRequest(BaseModel): """ UserServiceRemoveSecretRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The users resource ID.", alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + """ + user_id: Optional[StrictStr] = Field( + default=None, alias="userId", description="The users resource ID." + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +32,4 @@ class UserServiceRemoveSecretRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveSecretRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveSecretRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemoveSecretRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_secret_response.py b/zitadel_client/models/user_service_remove_secret_response.py index 0dacbf92..bcd64456 100644 --- a/zitadel_client/models/user_service_remove_secret_response.py +++ b/zitadel_client/models/user_service_remove_secret_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceRemoveSecretResponse(BaseModel): """ UserServiceRemoveSecretResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class UserServiceRemoveSecretResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveSecretResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveSecretResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceRemoveSecretResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_totp_request.py b/zitadel_client/models/user_service_remove_totp_request.py index 2b368830..8a523bcb 100644 --- a/zitadel_client/models/user_service_remove_totp_request.py +++ b/zitadel_client/models/user_service_remove_totp_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveTOTPRequest(BaseModel): """ UserServiceRemoveTOTPRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceRemoveTOTPRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveTOTPRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveTOTPRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceRemoveTOTPRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_totp_response.py b/zitadel_client/models/user_service_remove_totp_response.py index c90e2cca..8e4fa940 100644 --- a/zitadel_client/models/user_service_remove_totp_response.py +++ b/zitadel_client/models/user_service_remove_totp_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveTOTPResponse(BaseModel): """ UserServiceRemoveTOTPResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveTOTPResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveTOTPResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveTOTPResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveTOTPResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_u2_f_request.py b/zitadel_client/models/user_service_remove_u2_f_request.py index 04eabd58..5e0b3032 100644 --- a/zitadel_client/models/user_service_remove_u2_f_request.py +++ b/zitadel_client/models/user_service_remove_u2_f_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRemoveU2FRequest(BaseModel): """ UserServiceRemoveU2FRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") u2f_id: Optional[StrictStr] = Field(default=None, alias="u2fId") - __properties: ClassVar[List[str]] = ["userId", "u2fId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceRemoveU2FRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveU2FRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveU2FRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "u2fId": obj.get("u2fId") - }) - return _obj - - +UserServiceRemoveU2FRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_remove_u2_f_response.py b/zitadel_client/models/user_service_remove_u2_f_response.py index 6a20cb6d..99367751 100644 --- a/zitadel_client/models/user_service_remove_u2_f_response.py +++ b/zitadel_client/models/user_service_remove_u2_f_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceRemoveU2FResponse(BaseModel): """ UserServiceRemoveU2FResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceRemoveU2FResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRemoveU2FResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRemoveU2FResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceRemoveU2FResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_email_code_request.py b/zitadel_client/models/user_service_resend_email_code_request.py index d6b6e85f..ec485828 100644 --- a/zitadel_client/models/user_service_resend_email_code_request.py +++ b/zitadel_client/models/user_service_resend_email_code_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_email_verification_code import UserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceResendEmailCodeRequest(BaseModel): """ UserServiceResendEmailCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[UserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[UserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class UserServiceResendEmailCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendEmailCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendEmailCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": UserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode, +) +UserServiceResendEmailCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_email_code_response.py b/zitadel_client/models/user_service_resend_email_code_response.py index d12745c7..0142a677 100644 --- a/zitadel_client/models/user_service_resend_email_code_response.py +++ b/zitadel_client/models/user_service_resend_email_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceResendEmailCodeResponse(BaseModel): """ UserServiceResendEmailCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceResendEmailCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendEmailCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendEmailCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceResendEmailCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_invite_code_request.py b/zitadel_client/models/user_service_resend_invite_code_request.py index 339c2e0c..eb0de6e1 100644 --- a/zitadel_client/models/user_service_resend_invite_code_request.py +++ b/zitadel_client/models/user_service_resend_invite_code_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceResendInviteCodeRequest(BaseModel): """ UserServiceResendInviteCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceResendInviteCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendInviteCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendInviteCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceResendInviteCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_invite_code_response.py b/zitadel_client/models/user_service_resend_invite_code_response.py index 33afe217..0afd23d7 100644 --- a/zitadel_client/models/user_service_resend_invite_code_response.py +++ b/zitadel_client/models/user_service_resend_invite_code_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceResendInviteCodeResponse(BaseModel): """ UserServiceResendInviteCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceResendInviteCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendInviteCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendInviteCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceResendInviteCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_phone_code_request.py b/zitadel_client/models/user_service_resend_phone_code_request.py index 0fbf5970..e6a95b31 100644 --- a/zitadel_client/models/user_service_resend_phone_code_request.py +++ b/zitadel_client/models/user_service_resend_phone_code_request.py @@ -1,36 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceResendPhoneCodeRequest(BaseModel): """ UserServiceResendPhoneCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,54 +32,4 @@ class UserServiceResendPhoneCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendPhoneCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendPhoneCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +UserServiceResendPhoneCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_resend_phone_code_response.py b/zitadel_client/models/user_service_resend_phone_code_response.py index 764375b4..1be1420e 100644 --- a/zitadel_client/models/user_service_resend_phone_code_response.py +++ b/zitadel_client/models/user_service_resend_phone_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceResendPhoneCodeResponse(BaseModel): """ UserServiceResendPhoneCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceResendPhoneCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceResendPhoneCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceResendPhoneCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceResendPhoneCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_retrieve_identity_provider_intent_request.py b/zitadel_client/models/user_service_retrieve_identity_provider_intent_request.py index 77b6ba22..167b0513 100644 --- a/zitadel_client/models/user_service_retrieve_identity_provider_intent_request.py +++ b/zitadel_client/models/user_service_retrieve_identity_provider_intent_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRetrieveIdentityProviderIntentRequest(BaseModel): """ UserServiceRetrieveIdentityProviderIntentRequest - """ # noqa: E501 + """ + idp_intent_id: Optional[StrictStr] = Field(default=None, alias="idpIntentId") idp_intent_token: Optional[StrictStr] = Field(default=None, alias="idpIntentToken") - __properties: ClassVar[List[str]] = ["idpIntentId", "idpIntentToken"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceRetrieveIdentityProviderIntentRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRetrieveIdentityProviderIntentRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRetrieveIdentityProviderIntentRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpIntentId": obj.get("idpIntentId"), - "idpIntentToken": obj.get("idpIntentToken") - }) - return _obj - - +UserServiceRetrieveIdentityProviderIntentRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_retrieve_identity_provider_intent_response.py b/zitadel_client/models/user_service_retrieve_identity_provider_intent_response.py index 6944cde3..d987a678 100644 --- a/zitadel_client/models/user_service_retrieve_identity_provider_intent_response.py +++ b/zitadel_client/models/user_service_retrieve_identity_provider_intent_response.py @@ -1,42 +1,38 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_add_human_user_request import UserServiceAddHumanUserRequest -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_idp_information import UserServiceIDPInformation -from zitadel_client.models.user_service_update_human_user_request import UserServiceUpdateHumanUserRequest -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceRetrieveIdentityProviderIntentResponse(BaseModel): """ UserServiceRetrieveIdentityProviderIntentResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - idp_information: Optional[UserServiceIDPInformation] = Field(default=None, alias="idpInformation") + """ + + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + idp_information: Optional[UserServiceIDPInformation] = Field( + default=None, alias="idpInformation" + ) user_id: Optional[StrictStr] = Field(default=None, alias="userId") - add_human_user: Optional[UserServiceAddHumanUserRequest] = Field(default=None, alias="addHumanUser") - update_human_user: Optional[UserServiceUpdateHumanUserRequest] = Field(default=None, alias="updateHumanUser") - __properties: ClassVar[List[str]] = ["details", "idpInformation", "userId", "addHumanUser", "updateHumanUser"] + add_human_user: Optional[UserServiceAddHumanUserRequest] = Field( + default=None, alias="addHumanUser" + ) + update_human_user: Optional[UserServiceUpdateHumanUserRequest] = Field( + default=None, alias="updateHumanUser" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -44,68 +40,13 @@ class UserServiceRetrieveIdentityProviderIntentResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceRetrieveIdentityProviderIntentResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_information - if self.idp_information: - _dict['idpInformation'] = self.idp_information.to_dict() - # override the default output from pydantic by calling `to_dict()` of add_human_user - if self.add_human_user: - _dict['addHumanUser'] = self.add_human_user.to_dict() - # override the default output from pydantic by calling `to_dict()` of update_human_user - if self.update_human_user: - _dict['updateHumanUser'] = self.update_human_user.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceRetrieveIdentityProviderIntentResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "idpInformation": UserServiceIDPInformation.from_dict(obj["idpInformation"]) if obj.get("idpInformation") is not None else None, - "userId": obj.get("userId"), - "addHumanUser": UserServiceAddHumanUserRequest.from_dict(obj["addHumanUser"]) if obj.get("addHumanUser") is not None else None, - "updateHumanUser": UserServiceUpdateHumanUserRequest.from_dict(obj["updateHumanUser"]) if obj.get("updateHumanUser") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_add_human_user_request import ( + UserServiceAddHumanUserRequest, +) +from zitadel_client.models.user_service_details import UserServiceDetails +from zitadel_client.models.user_service_idp_information import UserServiceIDPInformation +from zitadel_client.models.user_service_update_human_user_request import ( + UserServiceUpdateHumanUserRequest, +) +UserServiceRetrieveIdentityProviderIntentResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_search_query.py b/zitadel_client/models/user_service_search_query.py index 84797d7e..b06dd64e 100644 --- a/zitadel_client/models/user_service_search_query.py +++ b/zitadel_client/models/user_service_search_query.py @@ -1,66 +1,72 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_display_name_query import UserServiceDisplayNameQuery -from zitadel_client.models.user_service_email_query import UserServiceEmailQuery -from zitadel_client.models.user_service_first_name_query import UserServiceFirstNameQuery -from zitadel_client.models.user_service_in_user_emails_query import UserServiceInUserEmailsQuery -from zitadel_client.models.user_service_in_user_id_query import UserServiceInUserIDQuery -from zitadel_client.models.user_service_last_name_query import UserServiceLastNameQuery -from zitadel_client.models.user_service_login_name_query import UserServiceLoginNameQuery -from zitadel_client.models.user_service_metadata_key_filter import UserServiceMetadataKeyFilter -from zitadel_client.models.user_service_metadata_value_filter import UserServiceMetadataValueFilter -from zitadel_client.models.user_service_nick_name_query import UserServiceNickNameQuery -from zitadel_client.models.user_service_organization_id_query import UserServiceOrganizationIdQuery -from zitadel_client.models.user_service_phone_query import UserServicePhoneQuery -from zitadel_client.models.user_service_state_query import UserServiceStateQuery -from zitadel_client.models.user_service_type_query import UserServiceTypeQuery -from zitadel_client.models.user_service_user_name_query import UserServiceUserNameQuery -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceSearchQuery(BaseModel): """ UserServiceSearchQuery - """ # noqa: E501 + """ + and_query: Optional[UserServiceAndQuery] = Field(default=None, alias="andQuery") - display_name_query: Optional[UserServiceDisplayNameQuery] = Field(default=None, alias="displayNameQuery") - email_query: Optional[UserServiceEmailQuery] = Field(default=None, alias="emailQuery") - first_name_query: Optional[UserServiceFirstNameQuery] = Field(default=None, alias="firstNameQuery") - in_user_emails_query: Optional[UserServiceInUserEmailsQuery] = Field(default=None, alias="inUserEmailsQuery") - in_user_ids_query: Optional[UserServiceInUserIDQuery] = Field(default=None, alias="inUserIdsQuery") - last_name_query: Optional[UserServiceLastNameQuery] = Field(default=None, alias="lastNameQuery") - login_name_query: Optional[UserServiceLoginNameQuery] = Field(default=None, alias="loginNameQuery") - metadata_key_filter: Optional[UserServiceMetadataKeyFilter] = Field(default=None, alias="metadataKeyFilter") - metadata_value_filter: Optional[UserServiceMetadataValueFilter] = Field(default=None, alias="metadataValueFilter") - nick_name_query: Optional[UserServiceNickNameQuery] = Field(default=None, alias="nickNameQuery") + display_name_query: Optional[UserServiceDisplayNameQuery] = Field( + default=None, alias="displayNameQuery" + ) + email_query: Optional[UserServiceEmailQuery] = Field( + default=None, alias="emailQuery" + ) + first_name_query: Optional[UserServiceFirstNameQuery] = Field( + default=None, alias="firstNameQuery" + ) + in_user_emails_query: Optional[UserServiceInUserEmailsQuery] = Field( + default=None, alias="inUserEmailsQuery" + ) + in_user_ids_query: Optional[UserServiceInUserIDQuery] = Field( + default=None, alias="inUserIdsQuery" + ) + last_name_query: Optional[UserServiceLastNameQuery] = Field( + default=None, alias="lastNameQuery" + ) + login_name_query: Optional[UserServiceLoginNameQuery] = Field( + default=None, alias="loginNameQuery" + ) + metadata_key_filter: Optional[UserServiceMetadataKeyFilter] = Field( + default=None, alias="metadataKeyFilter" + ) + metadata_value_filter: Optional[UserServiceMetadataValueFilter] = Field( + default=None, alias="metadataValueFilter" + ) + nick_name_query: Optional[UserServiceNickNameQuery] = Field( + default=None, alias="nickNameQuery" + ) not_query: Optional[UserServiceNotQuery] = Field(default=None, alias="notQuery") or_query: Optional[UserServiceOrQuery] = Field(default=None, alias="orQuery") - organization_id_query: Optional[UserServiceOrganizationIdQuery] = Field(default=None, alias="organizationIdQuery") - phone_query: Optional[UserServicePhoneQuery] = Field(default=None, alias="phoneQuery") - state_query: Optional[UserServiceStateQuery] = Field(default=None, alias="stateQuery") + organization_id_query: Optional[UserServiceOrganizationIdQuery] = Field( + default=None, alias="organizationIdQuery" + ) + phone_query: Optional[UserServicePhoneQuery] = Field( + default=None, alias="phoneQuery" + ) + state_query: Optional[UserServiceStateQuery] = Field( + default=None, alias="stateQuery" + ) type_query: Optional[UserServiceTypeQuery] = Field(default=None, alias="typeQuery") - user_name_query: Optional[UserServiceUserNameQuery] = Field(default=None, alias="userNameQuery") - __properties: ClassVar[List[str]] = ["andQuery", "displayNameQuery", "emailQuery", "firstNameQuery", "inUserEmailsQuery", "inUserIdsQuery", "lastNameQuery", "loginNameQuery", "metadataKeyFilter", "metadataValueFilter", "nickNameQuery", "notQuery", "orQuery", "organizationIdQuery", "phoneQuery", "stateQuery", "typeQuery", "userNameQuery"] + user_name_query: Optional[UserServiceUserNameQuery] = Field( + default=None, alias="userNameQuery" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -68,128 +74,37 @@ class UserServiceSearchQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSearchQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of and_query - if self.and_query: - _dict['andQuery'] = self.and_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of display_name_query - if self.display_name_query: - _dict['displayNameQuery'] = self.display_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of email_query - if self.email_query: - _dict['emailQuery'] = self.email_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of first_name_query - if self.first_name_query: - _dict['firstNameQuery'] = self.first_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_emails_query - if self.in_user_emails_query: - _dict['inUserEmailsQuery'] = self.in_user_emails_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of in_user_ids_query - if self.in_user_ids_query: - _dict['inUserIdsQuery'] = self.in_user_ids_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of last_name_query - if self.last_name_query: - _dict['lastNameQuery'] = self.last_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of login_name_query - if self.login_name_query: - _dict['loginNameQuery'] = self.login_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of metadata_key_filter - if self.metadata_key_filter: - _dict['metadataKeyFilter'] = self.metadata_key_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of metadata_value_filter - if self.metadata_value_filter: - _dict['metadataValueFilter'] = self.metadata_value_filter.to_dict() - # override the default output from pydantic by calling `to_dict()` of nick_name_query - if self.nick_name_query: - _dict['nickNameQuery'] = self.nick_name_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of not_query - if self.not_query: - _dict['notQuery'] = self.not_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of or_query - if self.or_query: - _dict['orQuery'] = self.or_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of organization_id_query - if self.organization_id_query: - _dict['organizationIdQuery'] = self.organization_id_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone_query - if self.phone_query: - _dict['phoneQuery'] = self.phone_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of state_query - if self.state_query: - _dict['stateQuery'] = self.state_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of type_query - if self.type_query: - _dict['typeQuery'] = self.type_query.to_dict() - # override the default output from pydantic by calling `to_dict()` of user_name_query - if self.user_name_query: - _dict['userNameQuery'] = self.user_name_query.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSearchQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "andQuery": UserServiceAndQuery.from_dict(obj["andQuery"]) if obj.get("andQuery") is not None else None, - "displayNameQuery": UserServiceDisplayNameQuery.from_dict(obj["displayNameQuery"]) if obj.get("displayNameQuery") is not None else None, - "emailQuery": UserServiceEmailQuery.from_dict(obj["emailQuery"]) if obj.get("emailQuery") is not None else None, - "firstNameQuery": UserServiceFirstNameQuery.from_dict(obj["firstNameQuery"]) if obj.get("firstNameQuery") is not None else None, - "inUserEmailsQuery": UserServiceInUserEmailsQuery.from_dict(obj["inUserEmailsQuery"]) if obj.get("inUserEmailsQuery") is not None else None, - "inUserIdsQuery": UserServiceInUserIDQuery.from_dict(obj["inUserIdsQuery"]) if obj.get("inUserIdsQuery") is not None else None, - "lastNameQuery": UserServiceLastNameQuery.from_dict(obj["lastNameQuery"]) if obj.get("lastNameQuery") is not None else None, - "loginNameQuery": UserServiceLoginNameQuery.from_dict(obj["loginNameQuery"]) if obj.get("loginNameQuery") is not None else None, - "metadataKeyFilter": UserServiceMetadataKeyFilter.from_dict(obj["metadataKeyFilter"]) if obj.get("metadataKeyFilter") is not None else None, - "metadataValueFilter": UserServiceMetadataValueFilter.from_dict(obj["metadataValueFilter"]) if obj.get("metadataValueFilter") is not None else None, - "nickNameQuery": UserServiceNickNameQuery.from_dict(obj["nickNameQuery"]) if obj.get("nickNameQuery") is not None else None, - "notQuery": UserServiceNotQuery.from_dict(obj["notQuery"]) if obj.get("notQuery") is not None else None, - "orQuery": UserServiceOrQuery.from_dict(obj["orQuery"]) if obj.get("orQuery") is not None else None, - "organizationIdQuery": UserServiceOrganizationIdQuery.from_dict(obj["organizationIdQuery"]) if obj.get("organizationIdQuery") is not None else None, - "phoneQuery": UserServicePhoneQuery.from_dict(obj["phoneQuery"]) if obj.get("phoneQuery") is not None else None, - "stateQuery": UserServiceStateQuery.from_dict(obj["stateQuery"]) if obj.get("stateQuery") is not None else None, - "typeQuery": UserServiceTypeQuery.from_dict(obj["typeQuery"]) if obj.get("typeQuery") is not None else None, - "userNameQuery": UserServiceUserNameQuery.from_dict(obj["userNameQuery"]) if obj.get("userNameQuery") is not None else None - }) - return _obj - from zitadel_client.models.user_service_and_query import UserServiceAndQuery +from zitadel_client.models.user_service_display_name_query import ( + UserServiceDisplayNameQuery, +) +from zitadel_client.models.user_service_email_query import UserServiceEmailQuery +from zitadel_client.models.user_service_first_name_query import ( + UserServiceFirstNameQuery, +) +from zitadel_client.models.user_service_in_user_emails_query import ( + UserServiceInUserEmailsQuery, +) +from zitadel_client.models.user_service_in_user_id_query import UserServiceInUserIDQuery +from zitadel_client.models.user_service_last_name_query import UserServiceLastNameQuery +from zitadel_client.models.user_service_login_name_query import ( + UserServiceLoginNameQuery, +) +from zitadel_client.models.user_service_metadata_key_filter import ( + UserServiceMetadataKeyFilter, +) +from zitadel_client.models.user_service_metadata_value_filter import ( + UserServiceMetadataValueFilter, +) +from zitadel_client.models.user_service_nick_name_query import UserServiceNickNameQuery from zitadel_client.models.user_service_not_query import UserServiceNotQuery from zitadel_client.models.user_service_or_query import UserServiceOrQuery -# TODO: Rewrite to not use raise_errors -UserServiceSearchQuery.model_rebuild(raise_errors=False) +from zitadel_client.models.user_service_organization_id_query import ( + UserServiceOrganizationIdQuery, +) +from zitadel_client.models.user_service_phone_query import UserServicePhoneQuery +from zitadel_client.models.user_service_state_query import UserServiceStateQuery +from zitadel_client.models.user_service_type_query import UserServiceTypeQuery +from zitadel_client.models.user_service_user_name_query import UserServiceUserNameQuery +UserServiceSearchQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_email_code_request.py b/zitadel_client/models/user_service_send_email_code_request.py index 0588f4ee..fc36eb97 100644 --- a/zitadel_client/models/user_service_send_email_code_request.py +++ b/zitadel_client/models/user_service_send_email_code_request.py @@ -1,37 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_email_verification_code import UserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendEmailCodeRequest(BaseModel): """ UserServiceSendEmailCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[UserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[UserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,57 +34,8 @@ class UserServiceSendEmailCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendEmailCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendEmailCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "returnCode": obj.get("returnCode"), - "sendCode": UserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode, +) +UserServiceSendEmailCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_email_code_response.py b/zitadel_client/models/user_service_send_email_code_response.py index 92c201f1..c0c365f2 100644 --- a/zitadel_client/models/user_service_send_email_code_response.py +++ b/zitadel_client/models/user_service_send_email_code_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendEmailCodeResponse(BaseModel): """ UserServiceSendEmailCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceSendEmailCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendEmailCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendEmailCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceSendEmailCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_email_verification_code.py b/zitadel_client/models/user_service_send_email_verification_code.py index a526541a..116d1205 100644 --- a/zitadel_client/models/user_service_send_email_verification_code.py +++ b/zitadel_client/models/user_service_send_email_verification_code.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendEmailVerificationCode(BaseModel): """ UserServiceSendEmailVerificationCode - """ # noqa: E501 - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + """ + + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the verification mail sent by ZITADEL to guide the user to your verification page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class UserServiceSendEmailVerificationCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendEmailVerificationCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendEmailVerificationCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +UserServiceSendEmailVerificationCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_invite_code.py b/zitadel_client/models/user_service_send_invite_code.py index 7f87554a..d6d09883 100644 --- a/zitadel_client/models/user_service_send_invite_code.py +++ b/zitadel_client/models/user_service_send_invite_code.py @@ -1,35 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendInviteCode(BaseModel): """ UserServiceSendInviteCode - """ # noqa: E501 - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the invite mail sent by ZITADEL to guide the user to your invitation page. If no template is set and no previous code was created, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", alias="urlTemplate") - application_name: Optional[StrictStr] = Field(default=None, description="Optionally set an application name, which will be used in the invite mail sent by ZITADEL. If no application name is set and no previous code was created, ZITADEL will be used as default.", alias="applicationName") - __properties: ClassVar[List[str]] = ["urlTemplate", "applicationName"] + """ + + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the invite mail sent by ZITADEL to guide the user to your invitation page. If no template is set and no previous code was created, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", + ) + application_name: Optional[StrictStr] = Field( + default=None, + alias="applicationName", + description="Optionally set an application name, which will be used in the invite mail sent by ZITADEL. If no application name is set and no previous code was created, ZITADEL will be used as default.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,63 +39,4 @@ class UserServiceSendInviteCode(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendInviteCode from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - # set to None if application_name (nullable) is None - # and model_fields_set contains the field - if self.application_name is None and "application_name" in self.model_fields_set: - _dict['applicationName'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendInviteCode from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate"), - "applicationName": obj.get("applicationName") - }) - return _obj - - +UserServiceSendInviteCode.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_passkey_registration_link.py b/zitadel_client/models/user_service_send_passkey_registration_link.py index bb337b1c..719a51bb 100644 --- a/zitadel_client/models/user_service_send_passkey_registration_link.py +++ b/zitadel_client/models/user_service_send_passkey_registration_link.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendPasskeyRegistrationLink(BaseModel): """ UserServiceSendPasskeyRegistrationLink - """ # noqa: E501 - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your passkey registration page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, CodeID, Code", alias="urlTemplate") - __properties: ClassVar[List[str]] = ["urlTemplate"] + """ + + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the mail sent by ZITADEL to guide the user to your passkey registration page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, CodeID, Code", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,57 +34,4 @@ class UserServiceSendPasskeyRegistrationLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendPasskeyRegistrationLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendPasskeyRegistrationLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - - +UserServiceSendPasskeyRegistrationLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_send_password_reset_link.py b/zitadel_client/models/user_service_send_password_reset_link.py index 182d3cd2..8a5ab196 100644 --- a/zitadel_client/models/user_service_send_password_reset_link.py +++ b/zitadel_client/models/user_service_send_password_reset_link.py @@ -1,36 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_notification_type import UserServiceNotificationType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSendPasswordResetLink(BaseModel): """ UserServiceSendPasswordResetLink - """ # noqa: E501 - notification_type: Optional[UserServiceNotificationType] = Field(default=None, alias="notificationType") - url_template: Optional[StrictStr] = Field(default=None, description="Optionally set a url_template, which will be used in the password reset mail sent by ZITADEL to guide the user to your password change page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", alias="urlTemplate") - __properties: ClassVar[List[str]] = ["notificationType", "urlTemplate"] + """ + notification_type: Optional[UserServiceNotificationType] = Field( + default=None, alias="notificationType" + ) + url_template: Optional[StrictStr] = Field( + default=None, + alias="urlTemplate", + description="Optionally set a url_template, which will be used in the password reset mail sent by ZITADEL to guide the user to your password change page. If no template is set, the default ZITADEL url will be used. The following placeholders can be used: UserID, OrgID, Code", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,58 +37,8 @@ class UserServiceSendPasswordResetLink(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSendPasswordResetLink from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if url_template (nullable) is None - # and model_fields_set contains the field - if self.url_template is None and "url_template" in self.model_fields_set: - _dict['urlTemplate'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSendPasswordResetLink from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "notificationType": obj.get("notificationType"), - "urlTemplate": obj.get("urlTemplate") - }) - return _obj - +from zitadel_client.models.user_service_notification_type import ( + UserServiceNotificationType, +) +UserServiceSendPasswordResetLink.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_email_request.py b/zitadel_client/models/user_service_set_email_request.py index ab7a3163..4e5113f7 100644 --- a/zitadel_client/models/user_service_set_email_request.py +++ b/zitadel_client/models/user_service_set_email_request.py @@ -1,39 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_email_verification_code import UserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceSetEmailRequest(BaseModel): """ UserServiceSetEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - email: Optional[StrictStr] = None + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[UserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[UserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,59 +36,8 @@ class UserServiceSetEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": UserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode, +) +UserServiceSetEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_email_response.py b/zitadel_client/models/user_service_set_email_response.py index 93120c05..2342cb2c 100644 --- a/zitadel_client/models/user_service_set_email_response.py +++ b/zitadel_client/models/user_service_set_email_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetEmailResponse(BaseModel): """ UserServiceSetEmailResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceSetEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceSetEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_human_email.py b/zitadel_client/models/user_service_set_human_email.py index 28080109..401c7d5f 100644 --- a/zitadel_client/models/user_service_set_human_email.py +++ b/zitadel_client/models/user_service_set_human_email.py @@ -1,38 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_send_email_verification_code import UserServiceSendEmailVerificationCode -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceSetHumanEmail(BaseModel): """ UserServiceSetHumanEmail - """ # noqa: E501 - email: Optional[StrictStr] = None + """ + + email: Optional[StrictStr] = Field(default=None, alias="email") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[UserServiceSendEmailVerificationCode] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["email", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[UserServiceSendEmailVerificationCode] = Field( + default=None, alias="sendCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +35,8 @@ class UserServiceSetHumanEmail(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetHumanEmail from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of send_code - if self.send_code: - _dict['sendCode'] = self.send_code.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetHumanEmail from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "email": obj.get("email"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": UserServiceSendEmailVerificationCode.from_dict(obj["sendCode"]) if obj.get("sendCode") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_send_email_verification_code import ( + UserServiceSendEmailVerificationCode, +) +UserServiceSetHumanEmail.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_human_phone.py b/zitadel_client/models/user_service_set_human_phone.py index 0d01245b..7251710b 100644 --- a/zitadel_client/models/user_service_set_human_phone.py +++ b/zitadel_client/models/user_service_set_human_phone.py @@ -1,37 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceSetHumanPhone(BaseModel): """ UserServiceSetHumanPhone - """ # noqa: E501 - phone: Optional[StrictStr] = None + """ + + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +33,4 @@ class UserServiceSetHumanPhone(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetHumanPhone from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetHumanPhone from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +UserServiceSetHumanPhone.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_human_profile.py b/zitadel_client/models/user_service_set_human_profile.py index 3f177cda..2c4a8d0e 100644 --- a/zitadel_client/models/user_service_set_human_profile.py +++ b/zitadel_client/models/user_service_set_human_profile.py @@ -1,40 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_gender import UserServiceGender -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetHumanProfile(BaseModel): """ UserServiceSetHumanProfile - """ # noqa: E501 + """ + given_name: Optional[StrictStr] = Field(default=None, alias="givenName") family_name: Optional[StrictStr] = Field(default=None, alias="familyName") nick_name: Optional[StrictStr] = Field(default=None, alias="nickName") display_name: Optional[StrictStr] = Field(default=None, alias="displayName") - preferred_language: Optional[StrictStr] = Field(default=None, alias="preferredLanguage") - gender: Optional[UserServiceGender] = None - __properties: ClassVar[List[str]] = ["givenName", "familyName", "nickName", "displayName", "preferredLanguage", "gender"] + preferred_language: Optional[StrictStr] = Field( + default=None, alias="preferredLanguage" + ) + gender: Optional[UserServiceGender] = Field(default=None, alias="gender") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -42,72 +37,6 @@ class UserServiceSetHumanProfile(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetHumanProfile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if nick_name (nullable) is None - # and model_fields_set contains the field - if self.nick_name is None and "nick_name" in self.model_fields_set: - _dict['nickName'] = None - - # set to None if display_name (nullable) is None - # and model_fields_set contains the field - if self.display_name is None and "display_name" in self.model_fields_set: - _dict['displayName'] = None - - # set to None if preferred_language (nullable) is None - # and model_fields_set contains the field - if self.preferred_language is None and "preferred_language" in self.model_fields_set: - _dict['preferredLanguage'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetHumanProfile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "givenName": obj.get("givenName"), - "familyName": obj.get("familyName"), - "nickName": obj.get("nickName"), - "displayName": obj.get("displayName"), - "preferredLanguage": obj.get("preferredLanguage"), - "gender": obj.get("gender") - }) - return _obj - +from zitadel_client.models.user_service_gender import UserServiceGender +UserServiceSetHumanProfile.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_metadata_entry.py b/zitadel_client/models/user_service_set_metadata_entry.py index 8760607e..d721971f 100644 --- a/zitadel_client/models/user_service_set_metadata_entry.py +++ b/zitadel_client/models/user_service_set_metadata_entry.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetMetadataEntry(BaseModel): """ UserServiceSetMetadataEntry - """ # noqa: E501 - key: Optional[StrictStr] = None - value: Optional[Union[StrictBytes, StrictStr]] = None - __properties: ClassVar[List[str]] = ["key", "value"] + """ + key: Optional[StrictStr] = Field(default=None, alias="key") + value: Optional[Base64Bytes] = Field(default=None, alias="value") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,6 @@ class UserServiceSetMetadataEntry(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetMetadataEntry from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetMetadataEntry from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "key": obj.get("key"), - "value": obj.get("value") - }) - return _obj - +from pydantic import Base64Bytes +UserServiceSetMetadataEntry.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_password.py b/zitadel_client/models/user_service_set_password.py index 75402c60..d65f22fd 100644 --- a/zitadel_client/models/user_service_set_password.py +++ b/zitadel_client/models/user_service_set_password.py @@ -1,39 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_hashed_password import UserServiceHashedPassword -from zitadel_client.models.user_service_password import UserServicePassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetPassword(BaseModel): """ UserServiceSetPassword - """ # noqa: E501 - hashed_password: Optional[UserServiceHashedPassword] = Field(default=None, alias="hashedPassword") - password: Optional[UserServicePassword] = None + """ + + hashed_password: Optional[UserServiceHashedPassword] = Field( + default=None, alias="hashedPassword" + ) + password: Optional[UserServicePassword] = Field(default=None, alias="password") current_password: Optional[StrictStr] = Field(default=None, alias="currentPassword") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["hashedPassword", "password", "currentPassword", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,61 +37,7 @@ class UserServiceSetPassword(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetPassword from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of hashed_password - if self.hashed_password: - _dict['hashedPassword'] = self.hashed_password.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetPassword from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "hashedPassword": UserServiceHashedPassword.from_dict(obj["hashedPassword"]) if obj.get("hashedPassword") is not None else None, - "password": UserServicePassword.from_dict(obj["password"]) if obj.get("password") is not None else None, - "currentPassword": obj.get("currentPassword"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_hashed_password import UserServiceHashedPassword +from zitadel_client.models.user_service_password import UserServicePassword +UserServiceSetPassword.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_password_request.py b/zitadel_client/models/user_service_set_password_request.py index 2234a01c..10c4e328 100644 --- a/zitadel_client/models/user_service_set_password_request.py +++ b/zitadel_client/models/user_service_set_password_request.py @@ -1,38 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_password import UserServicePassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetPasswordRequest(BaseModel): """ UserServiceSetPasswordRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - new_password: Optional[UserServicePassword] = Field(default=None, alias="newPassword") + new_password: Optional[UserServicePassword] = Field( + default=None, alias="newPassword" + ) current_password: Optional[StrictStr] = Field(default=None, alias="currentPassword") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "newPassword", "currentPassword", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,58 +37,6 @@ class UserServiceSetPasswordRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetPasswordRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of new_password - if self.new_password: - _dict['newPassword'] = self.new_password.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetPasswordRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "newPassword": UserServicePassword.from_dict(obj["newPassword"]) if obj.get("newPassword") is not None else None, - "currentPassword": obj.get("currentPassword"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_password import UserServicePassword +UserServiceSetPasswordRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_password_response.py b/zitadel_client/models/user_service_set_password_response.py index d65b5a38..c335eeb5 100644 --- a/zitadel_client/models/user_service_set_password_response.py +++ b/zitadel_client/models/user_service_set_password_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceSetPasswordResponse(BaseModel): """ UserServiceSetPasswordResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceSetPasswordResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetPasswordResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetPasswordResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceSetPasswordResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_phone_request.py b/zitadel_client/models/user_service_set_phone_request.py index 0926607a..46dd8b02 100644 --- a/zitadel_client/models/user_service_set_phone_request.py +++ b/zitadel_client/models/user_service_set_phone_request.py @@ -1,38 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictBool, StrictStr +from typing import Optional + class UserServiceSetPhoneRequest(BaseModel): """ UserServiceSetPhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - phone: Optional[StrictStr] = None + phone: Optional[StrictStr] = Field(default=None, alias="phone") is_verified: Optional[StrictBool] = Field(default=None, alias="isVerified") - return_code: Optional[Dict[str, Any]] = Field(default=None, alias="returnCode") - send_code: Optional[Dict[str, Any]] = Field(default=None, alias="sendCode") - __properties: ClassVar[List[str]] = ["userId", "phone", "isVerified", "returnCode", "sendCode"] + return_code: Optional[object] = Field(default=None, alias="returnCode") + send_code: Optional[object] = Field(default=None, alias="sendCode") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,56 +34,4 @@ class UserServiceSetPhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetPhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetPhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "phone": obj.get("phone"), - "isVerified": obj.get("isVerified"), - "returnCode": obj.get("returnCode"), - "sendCode": obj.get("sendCode") - }) - return _obj - - +UserServiceSetPhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_phone_response.py b/zitadel_client/models/user_service_set_phone_response.py index 8372ed1e..dd64eb31 100644 --- a/zitadel_client/models/user_service_set_phone_response.py +++ b/zitadel_client/models/user_service_set_phone_response.py @@ -1,36 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceSetPhoneResponse(BaseModel): """ UserServiceSetPhoneResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - verification_code: Optional[StrictStr] = Field(default=None, description="in case the verification was set to return_code, the code will be returned", alias="verificationCode") - __properties: ClassVar[List[str]] = ["details", "verificationCode"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + verification_code: Optional[StrictStr] = Field( + default=None, + alias="verificationCode", + description="in case the verification was set to return_code, the code will be returned", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,61 +35,6 @@ class UserServiceSetPhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetPhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if verification_code (nullable) is None - # and model_fields_set contains the field - if self.verification_code is None and "verification_code" in self.model_fields_set: - _dict['verificationCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetPhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "verificationCode": obj.get("verificationCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceSetPhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_user_metadata_request.py b/zitadel_client/models/user_service_set_user_metadata_request.py index ea9c2563..30ef16f6 100644 --- a/zitadel_client/models/user_service_set_user_metadata_request.py +++ b/zitadel_client/models/user_service_set_user_metadata_request.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_metadata import UserServiceMetadata -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceSetUserMetadataRequest(BaseModel): """ UserServiceSetUserMetadataRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="ID of the user under which the metadata gets set.", alias="userId") - metadata: Optional[List[UserServiceMetadata]] = Field(default=None, description="Metadata to bet set. The values have to be base64 encoded.") - __properties: ClassVar[List[str]] = ["userId", "metadata"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="ID of the user under which the metadata gets set.", + ) + metadata: Optional[List[UserServiceMetadata]] = Field( + default=None, + alias="metadata", + description="Metadata to bet set. The values have to be base64 encoded.", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,60 +39,6 @@ class UserServiceSetUserMetadataRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetUserMetadataRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in metadata (list) - _items = [] - if self.metadata: - for _item_metadata in self.metadata: - if _item_metadata: - _items.append(_item_metadata.to_dict()) - _dict['metadata'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetUserMetadataRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "metadata": [UserServiceMetadata.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_metadata import UserServiceMetadata +UserServiceSetUserMetadataRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_set_user_metadata_response.py b/zitadel_client/models/user_service_set_user_metadata_response.py index d1298746..6ee8339f 100644 --- a/zitadel_client/models/user_service_set_user_metadata_response.py +++ b/zitadel_client/models/user_service_set_user_metadata_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceSetUserMetadataResponse(BaseModel): """ UserServiceSetUserMetadataResponse - """ # noqa: E501 - set_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="setDate") - __properties: ClassVar[List[str]] = ["setDate"] + """ + set_date: Optional[AwareDatetime] = Field( + default=None, + alias="setDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class UserServiceSetUserMetadataResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceSetUserMetadataResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceSetUserMetadataResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "setDate": obj.get("setDate") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceSetUserMetadataResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_start_identity_provider_intent_request.py b/zitadel_client/models/user_service_start_identity_provider_intent_request.py index eb7c3a50..c7bd340e 100644 --- a/zitadel_client/models/user_service_start_identity_provider_intent_request.py +++ b/zitadel_client/models/user_service_start_identity_provider_intent_request.py @@ -1,38 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_ldap_credentials import UserServiceLDAPCredentials -from zitadel_client.models.user_service_redirect_urls import UserServiceRedirectURLs -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceStartIdentityProviderIntentRequest(BaseModel): """ UserServiceStartIdentityProviderIntentRequest - """ # noqa: E501 + """ + idp_id: Optional[StrictStr] = Field(default=None, alias="idpId") - ldap: Optional[UserServiceLDAPCredentials] = None - urls: Optional[UserServiceRedirectURLs] = None - __properties: ClassVar[List[str]] = ["idpId", "ldap", "urls"] + ldap: Optional[UserServiceLDAPCredentials] = Field(default=None, alias="ldap") + urls: Optional[UserServiceRedirectURLs] = Field(default=None, alias="urls") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +32,9 @@ class UserServiceStartIdentityProviderIntentRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceStartIdentityProviderIntentRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ldap - if self.ldap: - _dict['ldap'] = self.ldap.to_dict() - # override the default output from pydantic by calling `to_dict()` of urls - if self.urls: - _dict['urls'] = self.urls.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceStartIdentityProviderIntentRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "idpId": obj.get("idpId"), - "ldap": UserServiceLDAPCredentials.from_dict(obj["ldap"]) if obj.get("ldap") is not None else None, - "urls": UserServiceRedirectURLs.from_dict(obj["urls"]) if obj.get("urls") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_ldap_credentials import ( + UserServiceLDAPCredentials, +) +from zitadel_client.models.user_service_redirect_urls import UserServiceRedirectURLs +UserServiceStartIdentityProviderIntentRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_start_identity_provider_intent_response.py b/zitadel_client/models/user_service_start_identity_provider_intent_response.py index 3409d512..2cd7b43a 100644 --- a/zitadel_client/models/user_service_start_identity_provider_intent_response.py +++ b/zitadel_client/models/user_service_start_identity_provider_intent_response.py @@ -1,41 +1,36 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, Optional, Union -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_form_data import UserServiceFormData -from zitadel_client.models.user_service_idp_intent import UserServiceIDPIntent -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceStartIdentityProviderIntentResponse(BaseModel): """ UserServiceStartIdentityProviderIntentResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None + """ + + details: Optional[UserServiceDetails] = Field(default=None, alias="details") auth_url: Optional[StrictStr] = Field(default=None, alias="authUrl") form_data: Optional[UserServiceFormData] = Field(default=None, alias="formData") idp_intent: Optional[UserServiceIDPIntent] = Field(default=None, alias="idpIntent") - post_form: Optional[Union[StrictBytes, StrictStr]] = Field(default=None, description="POST call information Deprecated: Use form_data instead", alias="postForm") - __properties: ClassVar[List[str]] = ["details", "authUrl", "formData", "idpIntent", "postForm"] + post_form: Optional[Base64Bytes] = Field( + default=None, + alias="postForm", + description="POST call information Deprecated: Use form_data instead", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -43,65 +38,9 @@ class UserServiceStartIdentityProviderIntentResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceStartIdentityProviderIntentResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of form_data - if self.form_data: - _dict['formData'] = self.form_data.to_dict() - # override the default output from pydantic by calling `to_dict()` of idp_intent - if self.idp_intent: - _dict['idpIntent'] = self.idp_intent.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceStartIdentityProviderIntentResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "authUrl": obj.get("authUrl"), - "formData": UserServiceFormData.from_dict(obj["formData"]) if obj.get("formData") is not None else None, - "idpIntent": UserServiceIDPIntent.from_dict(obj["idpIntent"]) if obj.get("idpIntent") is not None else None, - "postForm": obj.get("postForm") - }) - return _obj - +from pydantic import Base64Bytes +from zitadel_client.models.user_service_details import UserServiceDetails +from zitadel_client.models.user_service_form_data import UserServiceFormData +from zitadel_client.models.user_service_idp_intent import UserServiceIDPIntent +UserServiceStartIdentityProviderIntentResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_state_query.py b/zitadel_client/models/user_service_state_query.py index 83a4f3f5..20baf14c 100644 --- a/zitadel_client/models/user_service_state_query.py +++ b/zitadel_client/models/user_service_state_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_user_state import UserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceStateQuery(BaseModel): """ Query for users with a specific state. - """ # noqa: E501 - state: Optional[UserServiceUserState] = None - __properties: ClassVar[List[str]] = ["state"] + """ + state: Optional[UserServiceUserState] = Field(default=None, alias="state") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class UserServiceStateQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceStateQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceStateQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "state": obj.get("state") - }) - return _obj - +from zitadel_client.models.user_service_user_state import UserServiceUserState +UserServiceStateQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_text_filter_method.py b/zitadel_client/models/user_service_text_filter_method.py index fa82bcd4..a714a631 100644 --- a/zitadel_client/models/user_service_text_filter_method.py +++ b/zitadel_client/models/user_service_text_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceTextFilterMethod(str, Enum): @@ -23,21 +13,15 @@ class UserServiceTextFilterMethod(str, Enum): UserServiceTextFilterMethod """ - """ - allowed enum values - """ - TEXT_FILTER_METHOD_EQUALS = 'TEXT_FILTER_METHOD_EQUALS' - TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = 'TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE' - TEXT_FILTER_METHOD_STARTS_WITH = 'TEXT_FILTER_METHOD_STARTS_WITH' - TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_FILTER_METHOD_CONTAINS = 'TEXT_FILTER_METHOD_CONTAINS' - TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE' - TEXT_FILTER_METHOD_ENDS_WITH = 'TEXT_FILTER_METHOD_ENDS_WITH' - TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceTextFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_FILTER_METHOD_EQUALS = "TEXT_FILTER_METHOD_EQUALS" + TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE = "TEXT_FILTER_METHOD_EQUALS_IGNORE_CASE" + TEXT_FILTER_METHOD_STARTS_WITH = "TEXT_FILTER_METHOD_STARTS_WITH" + TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_FILTER_METHOD_CONTAINS = "TEXT_FILTER_METHOD_CONTAINS" + TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE = "TEXT_FILTER_METHOD_CONTAINS_IGNORE_CASE" + TEXT_FILTER_METHOD_ENDS_WITH = "TEXT_FILTER_METHOD_ENDS_WITH" + TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE = ( + "TEXT_FILTER_METHOD_ENDS_WITH_IGNORE_CASE" + ) diff --git a/zitadel_client/models/user_service_text_query_method.py b/zitadel_client/models/user_service_text_query_method.py index 2b6a07d9..853b72b3 100644 --- a/zitadel_client/models/user_service_text_query_method.py +++ b/zitadel_client/models/user_service_text_query_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceTextQueryMethod(str, Enum): @@ -23,21 +13,13 @@ class UserServiceTextQueryMethod(str, Enum): UserServiceTextQueryMethod """ - """ - allowed enum values - """ - TEXT_QUERY_METHOD_EQUALS = 'TEXT_QUERY_METHOD_EQUALS' - TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = 'TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE' - TEXT_QUERY_METHOD_STARTS_WITH = 'TEXT_QUERY_METHOD_STARTS_WITH' - TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE' - TEXT_QUERY_METHOD_CONTAINS = 'TEXT_QUERY_METHOD_CONTAINS' - TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = 'TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE' - TEXT_QUERY_METHOD_ENDS_WITH = 'TEXT_QUERY_METHOD_ENDS_WITH' - TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = 'TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceTextQueryMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TEXT_QUERY_METHOD_EQUALS = "TEXT_QUERY_METHOD_EQUALS" + TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE = "TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE" + TEXT_QUERY_METHOD_STARTS_WITH = "TEXT_QUERY_METHOD_STARTS_WITH" + TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE = ( + "TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE" + ) + TEXT_QUERY_METHOD_CONTAINS = "TEXT_QUERY_METHOD_CONTAINS" + TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE = "TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE" + TEXT_QUERY_METHOD_ENDS_WITH = "TEXT_QUERY_METHOD_ENDS_WITH" + TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE = "TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE" diff --git a/zitadel_client/models/user_service_timestamp_filter.py b/zitadel_client/models/user_service_timestamp_filter.py index d30d1501..62aacc79 100644 --- a/zitadel_client/models/user_service_timestamp_filter.py +++ b/zitadel_client/models/user_service_timestamp_filter.py @@ -1,37 +1,34 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_timestamp_filter_method import UserServiceTimestampFilterMethod -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class UserServiceTimestampFilter(BaseModel): """ UserServiceTimestampFilter - """ # noqa: E501 - timestamp: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.") - method: Optional[UserServiceTimestampFilterMethod] = None - __properties: ClassVar[List[str]] = ["timestamp", "method"] + """ + + timestamp: Optional[AwareDatetime] = Field( + default=None, + alias="timestamp", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + method: Optional[UserServiceTimestampFilterMethod] = Field( + default=None, alias="method" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +36,9 @@ class UserServiceTimestampFilter(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceTimestampFilter from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceTimestampFilter from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "timestamp": obj.get("timestamp"), - "method": obj.get("method") - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.user_service_timestamp_filter_method import ( + UserServiceTimestampFilterMethod, +) +UserServiceTimestampFilter.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_timestamp_filter_method.py b/zitadel_client/models/user_service_timestamp_filter_method.py index c7100e8e..9c697019 100644 --- a/zitadel_client/models/user_service_timestamp_filter_method.py +++ b/zitadel_client/models/user_service_timestamp_filter_method.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceTimestampFilterMethod(str, Enum): @@ -23,18 +13,10 @@ class UserServiceTimestampFilterMethod(str, Enum): UserServiceTimestampFilterMethod """ - """ - allowed enum values - """ - TIMESTAMP_FILTER_METHOD_EQUALS = 'TIMESTAMP_FILTER_METHOD_EQUALS' - TIMESTAMP_FILTER_METHOD_AFTER = 'TIMESTAMP_FILTER_METHOD_AFTER' - TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS' - TIMESTAMP_FILTER_METHOD_BEFORE = 'TIMESTAMP_FILTER_METHOD_BEFORE' - TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = 'TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceTimestampFilterMethod from a JSON string""" - return cls(json.loads(json_str)) - - + TIMESTAMP_FILTER_METHOD_EQUALS = "TIMESTAMP_FILTER_METHOD_EQUALS" + TIMESTAMP_FILTER_METHOD_AFTER = "TIMESTAMP_FILTER_METHOD_AFTER" + TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS = "TIMESTAMP_FILTER_METHOD_AFTER_OR_EQUALS" + TIMESTAMP_FILTER_METHOD_BEFORE = "TIMESTAMP_FILTER_METHOD_BEFORE" + TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS = ( + "TIMESTAMP_FILTER_METHOD_BEFORE_OR_EQUALS" + ) diff --git a/zitadel_client/models/user_service_type.py b/zitadel_client/models/user_service_type.py index 6766a405..5cd4d483 100644 --- a/zitadel_client/models/user_service_type.py +++ b/zitadel_client/models/user_service_type.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceType(str, Enum): @@ -23,16 +13,6 @@ class UserServiceType(str, Enum): UserServiceType """ - """ - allowed enum values - """ - TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED' - TYPE_HUMAN = 'TYPE_HUMAN' - TYPE_MACHINE = 'TYPE_MACHINE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceType from a JSON string""" - return cls(json.loads(json_str)) - - + TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED" + TYPE_HUMAN = "TYPE_HUMAN" + TYPE_MACHINE = "TYPE_MACHINE" diff --git a/zitadel_client/models/user_service_type_query.py b/zitadel_client/models/user_service_type_query.py index c56afefa..0e0c2d89 100644 --- a/zitadel_client/models/user_service_type_query.py +++ b/zitadel_client/models/user_service_type_query.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_type import UserServiceType -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceTypeQuery(BaseModel): """ Query for users with a specific type. - """ # noqa: E501 - type: Optional[UserServiceType] = None - __properties: ClassVar[List[str]] = ["type"] + """ + type: Optional[UserServiceType] = Field(default=None, alias="type") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class UserServiceTypeQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceTypeQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceTypeQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type") - }) - return _obj - +from zitadel_client.models.user_service_type import UserServiceType +UserServiceTypeQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_unlock_user_request.py b/zitadel_client/models/user_service_unlock_user_request.py index 9ed61ce9..d684bfa3 100644 --- a/zitadel_client/models/user_service_unlock_user_request.py +++ b/zitadel_client/models/user_service_unlock_user_request.py @@ -1,34 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUnlockUserRequest(BaseModel): """ UserServiceUnlockUserRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - __properties: ClassVar[List[str]] = ["userId"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +30,4 @@ class UserServiceUnlockUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUnlockUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUnlockUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId") - }) - return _obj - - +UserServiceUnlockUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_unlock_user_response.py b/zitadel_client/models/user_service_unlock_user_response.py index 7d87502d..9cfde1c1 100644 --- a/zitadel_client/models/user_service_unlock_user_response.py +++ b/zitadel_client/models/user_service_unlock_user_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceUnlockUserResponse(BaseModel): """ UserServiceUnlockUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceUnlockUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUnlockUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUnlockUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceUnlockUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_update_human_user_request.py b/zitadel_client/models/user_service_update_human_user_request.py index ced387aa..83a18b18 100644 --- a/zitadel_client/models/user_service_update_human_user_request.py +++ b/zitadel_client/models/user_service_update_human_user_request.py @@ -1,43 +1,33 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail -from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone -from zitadel_client.models.user_service_set_human_profile import UserServiceSetHumanProfile -from zitadel_client.models.user_service_set_password import UserServiceSetPassword -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUpdateHumanUserRequest(BaseModel): """ UserServiceUpdateHumanUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, alias="userId") - username: Optional[StrictStr] = None - profile: Optional[UserServiceSetHumanProfile] = None - email: Optional[UserServiceSetHumanEmail] = None - phone: Optional[UserServiceSetHumanPhone] = None - password: Optional[UserServiceSetPassword] = None - __properties: ClassVar[List[str]] = ["userId", "username", "profile", "email", "phone", "password"] + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") + username: Optional[StrictStr] = Field(default=None, alias="username") + profile: Optional[UserServiceSetHumanProfile] = Field(default=None, alias="profile") + email: Optional[UserServiceSetHumanEmail] = Field(default=None, alias="email") + phone: Optional[UserServiceSetHumanPhone] = Field(default=None, alias="phone") + password: Optional[UserServiceSetPassword] = Field(default=None, alias="password") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -45,74 +35,11 @@ class UserServiceUpdateHumanUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUpdateHumanUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of profile - if self.profile: - _dict['profile'] = self.profile.to_dict() - # override the default output from pydantic by calling `to_dict()` of email - if self.email: - _dict['email'] = self.email.to_dict() - # override the default output from pydantic by calling `to_dict()` of phone - if self.phone: - _dict['phone'] = self.phone.to_dict() - # override the default output from pydantic by calling `to_dict()` of password - if self.password: - _dict['password'] = self.password.to_dict() - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUpdateHumanUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "profile": UserServiceSetHumanProfile.from_dict(obj["profile"]) if obj.get("profile") is not None else None, - "email": UserServiceSetHumanEmail.from_dict(obj["email"]) if obj.get("email") is not None else None, - "phone": UserServiceSetHumanPhone.from_dict(obj["phone"]) if obj.get("phone") is not None else None, - "password": UserServiceSetPassword.from_dict(obj["password"]) if obj.get("password") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_set_human_email import UserServiceSetHumanEmail +from zitadel_client.models.user_service_set_human_phone import UserServiceSetHumanPhone +from zitadel_client.models.user_service_set_human_profile import ( + UserServiceSetHumanProfile, +) +from zitadel_client.models.user_service_set_password import UserServiceSetPassword +UserServiceUpdateHumanUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_update_human_user_response.py b/zitadel_client/models/user_service_update_human_user_response.py index 380537f3..ffece696 100644 --- a/zitadel_client/models/user_service_update_human_user_response.py +++ b/zitadel_client/models/user_service_update_human_user_response.py @@ -1,37 +1,30 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUpdateHumanUserResponse(BaseModel): """ UserServiceUpdateHumanUserResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None + """ + + details: Optional[UserServiceDetails] = Field(default=None, alias="details") email_code: Optional[StrictStr] = Field(default=None, alias="emailCode") phone_code: Optional[StrictStr] = Field(default=None, alias="phoneCode") - __properties: ClassVar[List[str]] = ["details", "emailCode", "phoneCode"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,67 +32,6 @@ class UserServiceUpdateHumanUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUpdateHumanUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUpdateHumanUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceUpdateHumanUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_update_user_request.py b/zitadel_client/models/user_service_update_user_request.py index 2d8c987e..d899575a 100644 --- a/zitadel_client/models/user_service_update_user_request.py +++ b/zitadel_client/models/user_service_update_user_request.py @@ -1,39 +1,39 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_human import UserServiceHuman -from zitadel_client.models.user_service_machine import UserServiceMachine -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUpdateUserRequest(BaseModel): """ UserServiceUpdateUserRequest - """ # noqa: E501 - user_id: Optional[StrictStr] = Field(default=None, description="The user id is the users unique identifier in the instance. It can't be changed.", alias="userId") - username: Optional[StrictStr] = Field(default=None, description="Set a new username that is unique within the instance. Beware that active tokens and sessions are invalidated when the username is changed.") - human: Optional[UserServiceHuman] = None - machine: Optional[UserServiceMachine] = None - __properties: ClassVar[List[str]] = ["userId", "username", "human", "machine"] + """ + + user_id: Optional[StrictStr] = Field( + default=None, + alias="userId", + description="The user id is the users unique identifier in the instance. It can't be changed.", + ) + username: Optional[StrictStr] = Field( + default=None, + alias="username", + description="Set a new username that is unique within the instance. Beware that active tokens and sessions are invalidated when the username is changed.", + ) + human: Optional[UserServiceHuman] = Field(default=None, alias="human") + machine: Optional[UserServiceMachine] = Field(default=None, alias="machine") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -41,66 +41,7 @@ class UserServiceUpdateUserRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUpdateUserRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - # override the default output from pydantic by calling `to_dict()` of machine - if self.machine: - _dict['machine'] = self.machine.to_dict() - # set to None if username (nullable) is None - # and model_fields_set contains the field - if self.username is None and "username" in self.model_fields_set: - _dict['username'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUpdateUserRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "username": obj.get("username"), - "human": UserServiceHuman.from_dict(obj["human"]) if obj.get("human") is not None else None, - "machine": UserServiceMachine.from_dict(obj["machine"]) if obj.get("machine") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_human import UserServiceHuman +from zitadel_client.models.user_service_machine import UserServiceMachine +UserServiceUpdateUserRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_update_user_response.py b/zitadel_client/models/user_service_update_user_response.py index 741d90f1..5eec3bb9 100644 --- a/zitadel_client/models/user_service_update_user_response.py +++ b/zitadel_client/models/user_service_update_user_response.py @@ -1,37 +1,42 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUpdateUserResponse(BaseModel): """ UserServiceUpdateUserResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - email_code: Optional[StrictStr] = Field(default=None, description="In case the email verification was set to return_code, the code will be returned", alias="emailCode") - phone_code: Optional[StrictStr] = Field(default=None, description="In case the phone verification was set to return_code, the code will be returned", alias="phoneCode") - __properties: ClassVar[List[str]] = ["changeDate", "emailCode", "phoneCode"] + """ + + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + email_code: Optional[StrictStr] = Field( + default=None, + alias="emailCode", + description="In case the email verification was set to return_code, the code will be returned", + ) + phone_code: Optional[StrictStr] = Field( + default=None, + alias="phoneCode", + description="In case the phone verification was set to return_code, the code will be returned", + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,64 +44,6 @@ class UserServiceUpdateUserResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUpdateUserResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if email_code (nullable) is None - # and model_fields_set contains the field - if self.email_code is None and "email_code" in self.model_fields_set: - _dict['emailCode'] = None - - # set to None if phone_code (nullable) is None - # and model_fields_set contains the field - if self.phone_code is None and "phone_code" in self.model_fields_set: - _dict['phoneCode'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUpdateUserResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate"), - "emailCode": obj.get("emailCode"), - "phoneCode": obj.get("phoneCode") - }) - return _obj - +from pydantic import AwareDatetime +UserServiceUpdateUserResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_user.py b/zitadel_client/models/user_service_user.py index 34af4ee9..fccbdef8 100644 --- a/zitadel_client/models/user_service_user.py +++ b/zitadel_client/models/user_service_user.py @@ -1,45 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from zitadel_client.models.user_service_human_user import UserServiceHumanUser -from zitadel_client.models.user_service_machine_user import UserServiceMachineUser -from zitadel_client.models.user_service_user_state import UserServiceUserState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import List, Optional + class UserServiceUser(BaseModel): """ UserServiceUser - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - details: Optional[UserServiceDetails] = None - state: Optional[UserServiceUserState] = None - username: Optional[StrictStr] = None + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + state: Optional[UserServiceUserState] = Field(default=None, alias="state") + username: Optional[StrictStr] = Field(default=None, alias="username") login_names: Optional[List[StrictStr]] = Field(default=None, alias="loginNames") - preferred_login_name: Optional[StrictStr] = Field(default=None, alias="preferredLoginName") - human: Optional[UserServiceHumanUser] = None - machine: Optional[UserServiceMachineUser] = None - __properties: ClassVar[List[str]] = ["userId", "details", "state", "username", "loginNames", "preferredLoginName", "human", "machine"] + preferred_login_name: Optional[StrictStr] = Field( + default=None, alias="preferredLoginName" + ) + human: Optional[UserServiceHumanUser] = Field(default=None, alias="human") + machine: Optional[UserServiceMachineUser] = Field(default=None, alias="machine") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -47,68 +39,9 @@ class UserServiceUser(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUser from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - # override the default output from pydantic by calling `to_dict()` of human - if self.human: - _dict['human'] = self.human.to_dict() - # override the default output from pydantic by calling `to_dict()` of machine - if self.machine: - _dict['machine'] = self.machine.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUser from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None, - "state": obj.get("state"), - "username": obj.get("username"), - "loginNames": obj.get("loginNames"), - "preferredLoginName": obj.get("preferredLoginName"), - "human": UserServiceHumanUser.from_dict(obj["human"]) if obj.get("human") is not None else None, - "machine": UserServiceMachineUser.from_dict(obj["machine"]) if obj.get("machine") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +from zitadel_client.models.user_service_human_user import UserServiceHumanUser +from zitadel_client.models.user_service_machine_user import UserServiceMachineUser +from zitadel_client.models.user_service_user_state import UserServiceUserState +UserServiceUser.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_user_field_name.py b/zitadel_client/models/user_service_user_field_name.py index 2c8b7641..fe6e3166 100644 --- a/zitadel_client/models/user_service_user_field_name.py +++ b/zitadel_client/models/user_service_user_field_name.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceUserFieldName(str, Enum): @@ -23,23 +13,13 @@ class UserServiceUserFieldName(str, Enum): UserServiceUserFieldName """ - """ - allowed enum values - """ - USER_FIELD_NAME_UNSPECIFIED = 'USER_FIELD_NAME_UNSPECIFIED' - USER_FIELD_NAME_USER_NAME = 'USER_FIELD_NAME_USER_NAME' - USER_FIELD_NAME_FIRST_NAME = 'USER_FIELD_NAME_FIRST_NAME' - USER_FIELD_NAME_LAST_NAME = 'USER_FIELD_NAME_LAST_NAME' - USER_FIELD_NAME_NICK_NAME = 'USER_FIELD_NAME_NICK_NAME' - USER_FIELD_NAME_DISPLAY_NAME = 'USER_FIELD_NAME_DISPLAY_NAME' - USER_FIELD_NAME_EMAIL = 'USER_FIELD_NAME_EMAIL' - USER_FIELD_NAME_STATE = 'USER_FIELD_NAME_STATE' - USER_FIELD_NAME_TYPE = 'USER_FIELD_NAME_TYPE' - USER_FIELD_NAME_CREATION_DATE = 'USER_FIELD_NAME_CREATION_DATE' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceUserFieldName from a JSON string""" - return cls(json.loads(json_str)) - - + USER_FIELD_NAME_UNSPECIFIED = "USER_FIELD_NAME_UNSPECIFIED" + USER_FIELD_NAME_USER_NAME = "USER_FIELD_NAME_USER_NAME" + USER_FIELD_NAME_FIRST_NAME = "USER_FIELD_NAME_FIRST_NAME" + USER_FIELD_NAME_LAST_NAME = "USER_FIELD_NAME_LAST_NAME" + USER_FIELD_NAME_NICK_NAME = "USER_FIELD_NAME_NICK_NAME" + USER_FIELD_NAME_DISPLAY_NAME = "USER_FIELD_NAME_DISPLAY_NAME" + USER_FIELD_NAME_EMAIL = "USER_FIELD_NAME_EMAIL" + USER_FIELD_NAME_STATE = "USER_FIELD_NAME_STATE" + USER_FIELD_NAME_TYPE = "USER_FIELD_NAME_TYPE" + USER_FIELD_NAME_CREATION_DATE = "USER_FIELD_NAME_CREATION_DATE" diff --git a/zitadel_client/models/user_service_user_name_query.py b/zitadel_client/models/user_service_user_name_query.py index 17a1721f..62980cab 100644 --- a/zitadel_client/models/user_service_user_name_query.py +++ b/zitadel_client/models/user_service_user_name_query.py @@ -1,36 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_text_query_method import UserServiceTextQueryMethod -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceUserNameQuery(BaseModel): """ Query for users with a specific user name. - """ # noqa: E501 + """ + user_name: Optional[StrictStr] = Field(default=None, alias="userName") - method: Optional[UserServiceTextQueryMethod] = None - __properties: ClassVar[List[str]] = ["userName", "method"] + method: Optional[UserServiceTextQueryMethod] = Field(default=None, alias="method") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +31,8 @@ class UserServiceUserNameQuery(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceUserNameQuery from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceUserNameQuery from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userName": obj.get("userName"), - "method": obj.get("method") - }) - return _obj - +from zitadel_client.models.user_service_text_query_method import ( + UserServiceTextQueryMethod, +) +UserServiceUserNameQuery.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_user_state.py b/zitadel_client/models/user_service_user_state.py index 04c77734..c311b092 100644 --- a/zitadel_client/models/user_service_user_state.py +++ b/zitadel_client/models/user_service_user_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class UserServiceUserState(str, Enum): @@ -23,19 +13,9 @@ class UserServiceUserState(str, Enum): UserServiceUserState """ - """ - allowed enum values - """ - USER_STATE_UNSPECIFIED = 'USER_STATE_UNSPECIFIED' - USER_STATE_ACTIVE = 'USER_STATE_ACTIVE' - USER_STATE_INACTIVE = 'USER_STATE_INACTIVE' - USER_STATE_DELETED = 'USER_STATE_DELETED' - USER_STATE_LOCKED = 'USER_STATE_LOCKED' - USER_STATE_INITIAL = 'USER_STATE_INITIAL' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of UserServiceUserState from a JSON string""" - return cls(json.loads(json_str)) - - + USER_STATE_UNSPECIFIED = "USER_STATE_UNSPECIFIED" + USER_STATE_ACTIVE = "USER_STATE_ACTIVE" + USER_STATE_INACTIVE = "USER_STATE_INACTIVE" + USER_STATE_DELETED = "USER_STATE_DELETED" + USER_STATE_LOCKED = "USER_STATE_LOCKED" + USER_STATE_INITIAL = "USER_STATE_INITIAL" diff --git a/zitadel_client/models/user_service_verify_email_request.py b/zitadel_client/models/user_service_verify_email_request.py index 86647d64..404724be 100644 --- a/zitadel_client/models/user_service_verify_email_request.py +++ b/zitadel_client/models/user_service_verify_email_request.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceVerifyEmailRequest(BaseModel): """ UserServiceVerifyEmailRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class UserServiceVerifyEmailRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyEmailRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyEmailRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - - +UserServiceVerifyEmailRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_email_response.py b/zitadel_client/models/user_service_verify_email_response.py index 685dc0e5..2489f866 100644 --- a/zitadel_client/models/user_service_verify_email_response.py +++ b/zitadel_client/models/user_service_verify_email_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyEmailResponse(BaseModel): """ UserServiceVerifyEmailResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyEmailResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyEmailResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyEmailResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyEmailResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_invite_code_request.py b/zitadel_client/models/user_service_verify_invite_code_request.py index 65c636db..c6ff8aef 100644 --- a/zitadel_client/models/user_service_verify_invite_code_request.py +++ b/zitadel_client/models/user_service_verify_invite_code_request.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceVerifyInviteCodeRequest(BaseModel): """ UserServiceVerifyInviteCodeRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class UserServiceVerifyInviteCodeRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyInviteCodeRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyInviteCodeRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - - +UserServiceVerifyInviteCodeRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_invite_code_response.py b/zitadel_client/models/user_service_verify_invite_code_response.py index a7a9c4b4..421aa504 100644 --- a/zitadel_client/models/user_service_verify_invite_code_response.py +++ b/zitadel_client/models/user_service_verify_invite_code_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyInviteCodeResponse(BaseModel): """ UserServiceVerifyInviteCodeResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyInviteCodeResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyInviteCodeResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyInviteCodeResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyInviteCodeResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_passkey_registration_request.py b/zitadel_client/models/user_service_verify_passkey_registration_request.py index 3e9bb7dc..3350e7b7 100644 --- a/zitadel_client/models/user_service_verify_passkey_registration_request.py +++ b/zitadel_client/models/user_service_verify_passkey_registration_request.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceVerifyPasskeyRegistrationRequest(BaseModel): """ UserServiceVerifyPasskeyRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") passkey_id: Optional[StrictStr] = Field(default=None, alias="passkeyId") - public_key_credential: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredential") + public_key_credential: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredential", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) passkey_name: Optional[StrictStr] = Field(default=None, alias="passkeyName") - __properties: ClassVar[List[str]] = ["userId", "passkeyId", "publicKeyCredential", "passkeyName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +37,4 @@ class UserServiceVerifyPasskeyRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyPasskeyRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyPasskeyRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "passkeyId": obj.get("passkeyId"), - "publicKeyCredential": obj.get("publicKeyCredential"), - "passkeyName": obj.get("passkeyName") - }) - return _obj - - +UserServiceVerifyPasskeyRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_passkey_registration_response.py b/zitadel_client/models/user_service_verify_passkey_registration_response.py index 1d02a4df..84549a4c 100644 --- a/zitadel_client/models/user_service_verify_passkey_registration_response.py +++ b/zitadel_client/models/user_service_verify_passkey_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyPasskeyRegistrationResponse(BaseModel): """ UserServiceVerifyPasskeyRegistrationResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyPasskeyRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyPasskeyRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyPasskeyRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyPasskeyRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_phone_request.py b/zitadel_client/models/user_service_verify_phone_request.py index fc5036a8..f729c47a 100644 --- a/zitadel_client/models/user_service_verify_phone_request.py +++ b/zitadel_client/models/user_service_verify_phone_request.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceVerifyPhoneRequest(BaseModel): """ UserServiceVerifyPhoneRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - verification_code: Optional[StrictStr] = Field(default=None, alias="verificationCode") - __properties: ClassVar[List[str]] = ["userId", "verificationCode"] + verification_code: Optional[StrictStr] = Field( + default=None, alias="verificationCode" + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +33,4 @@ class UserServiceVerifyPhoneRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyPhoneRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyPhoneRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "verificationCode": obj.get("verificationCode") - }) - return _obj - - +UserServiceVerifyPhoneRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_phone_response.py b/zitadel_client/models/user_service_verify_phone_response.py index 6d1fecbb..0b1aea91 100644 --- a/zitadel_client/models/user_service_verify_phone_response.py +++ b/zitadel_client/models/user_service_verify_phone_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyPhoneResponse(BaseModel): """ UserServiceVerifyPhoneResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyPhoneResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyPhoneResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyPhoneResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyPhoneResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_totp_registration_request.py b/zitadel_client/models/user_service_verify_totp_registration_request.py index 0607f8df..14399c23 100644 --- a/zitadel_client/models/user_service_verify_totp_registration_request.py +++ b/zitadel_client/models/user_service_verify_totp_registration_request.py @@ -1,35 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class UserServiceVerifyTOTPRegistrationRequest(BaseModel): """ UserServiceVerifyTOTPRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") - code: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["userId", "code"] + code: Optional[StrictStr] = Field(default=None, alias="code") + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,53 +31,4 @@ class UserServiceVerifyTOTPRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyTOTPRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyTOTPRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "code": obj.get("code") - }) - return _obj - - +UserServiceVerifyTOTPRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_totp_registration_response.py b/zitadel_client/models/user_service_verify_totp_registration_response.py index dee98177..2be0974c 100644 --- a/zitadel_client/models/user_service_verify_totp_registration_response.py +++ b/zitadel_client/models/user_service_verify_totp_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyTOTPRegistrationResponse(BaseModel): """ UserServiceVerifyTOTPRegistrationResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyTOTPRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyTOTPRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyTOTPRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyTOTPRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_u2_f_registration_request.py b/zitadel_client/models/user_service_verify_u2_f_registration_request.py index f8cb7daa..0c8d5392 100644 --- a/zitadel_client/models/user_service_verify_u2_f_registration_request.py +++ b/zitadel_client/models/user_service_verify_u2_f_registration_request.py @@ -1,37 +1,35 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Dict, Optional + class UserServiceVerifyU2FRegistrationRequest(BaseModel): """ UserServiceVerifyU2FRegistrationRequest - """ # noqa: E501 + """ + user_id: Optional[StrictStr] = Field(default=None, alias="userId") u2f_id: Optional[StrictStr] = Field(default=None, alias="u2fId") - public_key_credential: Optional[Dict[str, Any]] = Field(default=None, description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", alias="publicKeyCredential") + public_key_credential: Optional[Dict[str, object]] = Field( + default=None, + alias="publicKeyCredential", + description="`Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.", + ) token_name: Optional[StrictStr] = Field(default=None, alias="tokenName") - __properties: ClassVar[List[str]] = ["userId", "u2fId", "publicKeyCredential", "tokenName"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,55 +37,4 @@ class UserServiceVerifyU2FRegistrationRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyU2FRegistrationRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyU2FRegistrationRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "userId": obj.get("userId"), - "u2fId": obj.get("u2fId"), - "publicKeyCredential": obj.get("publicKeyCredential"), - "tokenName": obj.get("tokenName") - }) - return _obj - - +UserServiceVerifyU2FRegistrationRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/user_service_verify_u2_f_registration_response.py b/zitadel_client/models/user_service_verify_u2_f_registration_response.py index 62fdc59e..55c4e2f5 100644 --- a/zitadel_client/models/user_service_verify_u2_f_registration_response.py +++ b/zitadel_client/models/user_service_verify_u2_f_registration_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.user_service_details import UserServiceDetails -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class UserServiceVerifyU2FRegistrationResponse(BaseModel): """ UserServiceVerifyU2FRegistrationResponse - """ # noqa: E501 - details: Optional[UserServiceDetails] = None - __properties: ClassVar[List[str]] = ["details"] + """ + details: Optional[UserServiceDetails] = Field(default=None, alias="details") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,55 +29,6 @@ class UserServiceVerifyU2FRegistrationResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserServiceVerifyU2FRegistrationResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of details - if self.details: - _dict['details'] = self.details.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserServiceVerifyU2FRegistrationResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "details": UserServiceDetails.from_dict(obj["details"]) if obj.get("details") is not None else None - }) - return _obj - +from zitadel_client.models.user_service_details import UserServiceDetails +UserServiceVerifyU2FRegistrationResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_activate_web_key_request.py b/zitadel_client/models/web_key_service_activate_web_key_request.py index 76aeca64..8397e9a2 100644 --- a/zitadel_client/models/web_key_service_activate_web_key_request.py +++ b/zitadel_client/models/web_key_service_activate_web_key_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class WebKeyServiceActivateWebKeyRequest(BaseModel): """ WebKeyServiceActivateWebKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the key to activate.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the key to activate.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class WebKeyServiceActivateWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceActivateWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceActivateWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +WebKeyServiceActivateWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_activate_web_key_response.py b/zitadel_client/models/web_key_service_activate_web_key_response.py index b6918095..59cd3392 100644 --- a/zitadel_client/models/web_key_service_activate_web_key_response.py +++ b/zitadel_client/models/web_key_service_activate_web_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class WebKeyServiceActivateWebKeyResponse(BaseModel): """ WebKeyServiceActivateWebKeyResponse - """ # noqa: E501 - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - __properties: ClassVar[List[str]] = ["changeDate"] + """ + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class WebKeyServiceActivateWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceActivateWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceActivateWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "changeDate": obj.get("changeDate") - }) - return _obj - +from pydantic import AwareDatetime +WebKeyServiceActivateWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_any.py b/zitadel_client/models/web_key_service_any.py index 4787e74c..143cddd5 100644 --- a/zitadel_client/models/web_key_service_any.py +++ b/zitadel_client/models/web_key_service_any.py @@ -1,109 +1,145 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, Optional, Set + class WebKeyServiceAny(BaseModel): """ Contains an arbitrary serialized message along with a @type that describes the type of the serialized message, with an additional debug field for ConnectRPC error details. - """ # noqa: E501 - type: Optional[StrictStr] = Field(default=None, description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.") - value: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = Field(default=None, description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.") - debug: Optional[Any] = Field(default=None, description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["type", "value", "debug"] + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + type: Optional[StrictStr] = Field( + default=None, + alias="type", + description="A URL that acts as a globally unique identifier for the type of the serialized message. For example: `type.googleapis.com/google.rpc.ErrorInfo`. This is used to determine the schema of the data in the `value` field and is the discriminator for the `debug` field.", ) + value: Optional[bytes] = Field( + default=None, + alias="value", + description="The Protobuf message, serialized as bytes and base64-encoded. The specific message type is identified by the `type` field.", + ) + debug: Optional[object] = Field( + default=None, + alias="debug", + description="Deserialized error detail payload. The 'type' field indicates the schema. This field is for easier debugging and should not be relied upon for application logic.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceAny from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - # set to None if debug (nullable) is None - # and model_fields_set contains the field - if self.debug is None and "debug" in self.model_fields_set: - _dict['debug'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceAny from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "value": obj.get("value"), - "debug": obj.get("debug") - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) - - return _obj + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) +WebKeyServiceAny.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_connect_error.py b/zitadel_client/models/web_key_service_connect_error.py index 9147cba0..35aa16b0 100644 --- a/zitadel_client/models/web_key_service_connect_error.py +++ b/zitadel_client/models/web_key_service_connect_error.py @@ -1,122 +1,169 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.web_key_service_any import WebKeyServiceAny -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field, model_serializer, model_validator +from pydantic import StrictStr +from typing import Any, Callable, Dict, List, Optional, Set +from enum import Enum + + +class WebKeyServiceConnectErrorCodeEnum(str, Enum): + """WebKeyServiceConnectError - code""" + + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "data_loss" + UNAUTHENTICATED = "unauthenticated" + class WebKeyServiceConnectError(BaseModel): """ Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation - """ # noqa: E501 - code: Optional[StrictStr] = Field(default=None, description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].") - message: Optional[StrictStr] = Field(default=None, description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.") - details: Optional[List[WebKeyServiceAny]] = Field(default=None, description="A list of messages that carry the error details. There is no limit on the number of messages.") - additional_properties: Dict[str, Any] = {} - __properties: ClassVar[List[str]] = ["code", "message", "details"] - - @field_validator('code') - def code_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated']): - raise ValueError("must be one of enum values ('canceled', 'unknown', 'invalid_argument', 'deadline_exceeded', 'not_found', 'already_exists', 'permission_denied', 'resource_exhausted', 'failed_precondition', 'aborted', 'out_of_range', 'unimplemented', 'internal', 'unavailable', 'data_loss', 'unauthenticated')") - return value + """ - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), + code: Optional[WebKeyServiceConnectErrorCodeEnum] = Field( + default=None, + alias="code", + description="The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].", ) + message: Optional[StrictStr] = Field( + default=None, + alias="message", + description="A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.", + ) + details: Optional[List[WebKeyServiceAny]] = Field( + default=None, + alias="details", + description="A list of messages that carry the error details. There is no limit on the number of messages.", + ) + additional_properties: Dict[str, Any] = Field(default_factory=dict) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - + @model_validator(mode="before") @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceConnectError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - * Fields in `self.additional_properties` are added to the output dict. + def _capture_additional_properties(cls, values: Any) -> Any: + """Collect JSON keys not declared as fields into additional_properties. + + Pydantic v2 doesn't auto-merge unknown keys into a typed dict + field. Here we walk the incoming mapping, split known-vs-extra + based on the model's declared fields (by alias and by name), and + funnel extras into `additional_properties`. This makes the + Metadata-style schema (fixed fields + additionalProperties: {...}) + round-trip without dropping data, matching the cross-language + contract. """ - excluded_fields: Set[str] = set([ - "additional_properties", - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, + if not isinstance(values, dict): + return values + known: Set[str] = set() + # `aliases` holds only the WIRE aliases that differ from the Python + # field name (e.g. 'createdAt' for the field 'created_at'). Their + # presence in the incoming mapping is the PATH signal that this dict is + # a flat WIRE payload rather than field-name kwargs / re-validation. + aliases: Set[str] = set() + for fname, finfo in cls.model_fields.items(): + known.add(fname) + if finfo.alias is not None: + known.add(finfo.alias) + if finfo.alias != fname: + aliases.add(finfo.alias) + # The `additional_properties` key carries two distinct meanings and we + # must distinguish them by the call PATH / declared field, NOT by the + # value's runtime type (a dict value is ambiguous — see below): + # 1. Internal bucket — the declared `additional_properties` field. + # When re-validating a value we produced ourselves or constructing + # from field-name kwargs (e.g. `Metadata(additional_properties= + # {...})`), the captured extras arrive under this field name and + # must be spread back out, never nested. + # 2. Real wire key — a server may legitimately send a property named + # literally `additional_properties` whose value is itself a dict + # (additionalProperties allows any name). This must be funnelled + # into extras under its real name rather than dropped. + # A flat wire payload addresses declared fields by their WIRE ALIAS, so + # a mapping that carries any aliased key is a wire payload and its + # `additional_properties` entry is a real wire property. Only when the + # mapping uses field NAMES (no wire alias present) do we treat an + # `additional_properties` dict as the internal bucket to seed from. + # This keys the decision on the path, so a dict-valued wire property is + # preserved instead of being silently swallowed by an `isinstance` test. + is_wire_payload = bool(aliases & values.keys()) + raw_bucket = values.get("additional_properties") + extras: Dict[str, Any] = ( + dict(raw_bucket) + if not is_wire_payload and isinstance(raw_bucket, dict) + else {} ) - # override the default output from pydantic by calling `to_dict()` of each item in details (list) - _items = [] - if self.details: - for _item_details in self.details: - if _item_details: - _items.append(_item_details.to_dict()) - _dict['details'] = _items - # puts key-value pairs in additional_properties in the top level - if self.additional_properties is not None: - for _key, _value in self.additional_properties.items(): - _dict[_key] = _value - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceConnectError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message"), - "details": [WebKeyServiceAny.from_dict(_item) for _item in obj["details"]] if obj.get("details") is not None else None - }) - # store additional fields in additional_properties - for _key in obj.keys(): - if _key not in cls.__properties: - _obj.additional_properties[_key] = obj.get(_key) + merged: Dict[str, Any] = {} + for key, value in values.items(): + if ( + key == "additional_properties" + and not is_wire_payload + and isinstance(value, dict) + ): + # Internal bucket on the field-name path: already consumed as + # the seed above, so drop the wrapper key here. + continue + if key in known and key != "additional_properties": + merged[key] = value + else: + # Everything else — including a real wire property literally + # named `additional_properties` — lands in extras under its own + # name so no data is lost. + extras[key] = value + merged["additional_properties"] = extras + return merged + + @model_serializer(mode="wrap") + def _flatten_additional_properties( + self, handler: Callable[[Any], Dict[str, Any]] + ) -> Dict[str, Any]: + """Re-flatten additional_properties to top level on serialize. + + The mirror of `_capture_additional_properties`. Without this, + pydantic emits the captured extras nested under a literal + `additional_properties` key (e.g. `{"createdAt": ..., + "additional_properties": {"foo": "bar"}}`) instead of the + round-trip-faithful flat form `{"createdAt": ..., "foo": "bar"}`. + We run the default serializer, lift the captured extras out of the + `additional_properties` key, and merge them back at the top level. + Declared fields win on key collisions so an explicit field is never + clobbered by a stale extra. + """ + data = handler(self) + extras = data.pop("additional_properties", None) + if isinstance(extras, dict): + for key, value in extras.items(): + if key not in data: + data[key] = value + return data + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - return _obj +from zitadel_client.models.web_key_service_any import WebKeyServiceAny +WebKeyServiceConnectError.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_create_web_key_request.py b/zitadel_client/models/web_key_service_create_web_key_request.py index 7f3c440e..1d5b5d4d 100644 --- a/zitadel_client/models/web_key_service_create_web_key_request.py +++ b/zitadel_client/models/web_key_service_create_web_key_request.py @@ -1,38 +1,29 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.web_key_service_ecdsa import WebKeyServiceECDSA -from zitadel_client.models.web_key_service_rsa import WebKeyServiceRSA -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class WebKeyServiceCreateWebKeyRequest(BaseModel): """ WebKeyServiceCreateWebKeyRequest - """ # noqa: E501 - ecdsa: Optional[WebKeyServiceECDSA] = None - ed25519: Optional[Dict[str, Any]] = None - rsa: Optional[WebKeyServiceRSA] = None - __properties: ClassVar[List[str]] = ["ecdsa", "ed25519", "rsa"] + """ + ecdsa: Optional[WebKeyServiceECDSA] = Field(default=None, alias="ecdsa") + ed25519: Optional[object] = Field(default=None, alias="ed25519") + rsa: Optional[WebKeyServiceRSA] = Field(default=None, alias="rsa") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -40,60 +31,7 @@ class WebKeyServiceCreateWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceCreateWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ecdsa - if self.ecdsa: - _dict['ecdsa'] = self.ecdsa.to_dict() - # override the default output from pydantic by calling `to_dict()` of rsa - if self.rsa: - _dict['rsa'] = self.rsa.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceCreateWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "ecdsa": WebKeyServiceECDSA.from_dict(obj["ecdsa"]) if obj.get("ecdsa") is not None else None, - "ed25519": obj.get("ed25519"), - "rsa": WebKeyServiceRSA.from_dict(obj["rsa"]) if obj.get("rsa") is not None else None - }) - return _obj - +from zitadel_client.models.web_key_service_ecdsa import WebKeyServiceECDSA +from zitadel_client.models.web_key_service_rsa import WebKeyServiceRSA +WebKeyServiceCreateWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_create_web_key_response.py b/zitadel_client/models/web_key_service_create_web_key_response.py index e73b3f07..985c007e 100644 --- a/zitadel_client/models/web_key_service_create_web_key_response.py +++ b/zitadel_client/models/web_key_service_create_web_key_response.py @@ -1,36 +1,37 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class WebKeyServiceCreateWebKeyResponse(BaseModel): """ WebKeyServiceCreateWebKeyResponse - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the newly created key.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - __properties: ClassVar[List[str]] = ["id", "creationDate"] + """ + + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the newly created key.", + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -38,53 +39,6 @@ class WebKeyServiceCreateWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceCreateWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceCreateWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate") - }) - return _obj - +from pydantic import AwareDatetime +WebKeyServiceCreateWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_delete_web_key_request.py b/zitadel_client/models/web_key_service_delete_web_key_request.py index 2aaeab17..f8968059 100644 --- a/zitadel_client/models/web_key_service_delete_web_key_request.py +++ b/zitadel_client/models/web_key_service_delete_web_key_request.py @@ -1,34 +1,32 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class WebKeyServiceDeleteWebKeyRequest(BaseModel): """ WebKeyServiceDeleteWebKeyRequest - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the key to delete.") - __properties: ClassVar[List[str]] = ["id"] + """ + id: Optional[StrictStr] = Field( + default=None, + alias="id", + description="The unique identifier of the key to delete.", + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -36,52 +34,4 @@ class WebKeyServiceDeleteWebKeyRequest(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceDeleteWebKeyRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceDeleteWebKeyRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - +WebKeyServiceDeleteWebKeyRequest.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_delete_web_key_response.py b/zitadel_client/models/web_key_service_delete_web_key_response.py index 49ba451e..cc526bc8 100644 --- a/zitadel_client/models/web_key_service_delete_web_key_response.py +++ b/zitadel_client/models/web_key_service_delete_web_key_response.py @@ -1,35 +1,31 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, Optional -from typing import Optional, Set -from typing_extensions import Self +from typing import Optional + class WebKeyServiceDeleteWebKeyResponse(BaseModel): """ WebKeyServiceDeleteWebKeyResponse - """ # noqa: E501 - deletion_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="deletionDate") - __properties: ClassVar[List[str]] = ["deletionDate"] + """ + deletion_date: Optional[AwareDatetime] = Field( + default=None, + alias="deletionDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +33,6 @@ class WebKeyServiceDeleteWebKeyResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceDeleteWebKeyResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceDeleteWebKeyResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "deletionDate": obj.get("deletionDate") - }) - return _obj - +from pydantic import AwareDatetime +WebKeyServiceDeleteWebKeyResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_ecdsa.py b/zitadel_client/models/web_key_service_ecdsa.py index ed47690c..e9c3439c 100644 --- a/zitadel_client/models/web_key_service_ecdsa.py +++ b/zitadel_client/models/web_key_service_ecdsa.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.web_key_service_ecdsa_curve import WebKeyServiceECDSACurve -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class WebKeyServiceECDSA(BaseModel): """ WebKeyServiceECDSA - """ # noqa: E501 - curve: Optional[WebKeyServiceECDSACurve] = None - __properties: ClassVar[List[str]] = ["curve"] + """ + curve: Optional[WebKeyServiceECDSACurve] = Field(default=None, alias="curve") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,52 +29,6 @@ class WebKeyServiceECDSA(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceECDSA from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceECDSA from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "curve": obj.get("curve") - }) - return _obj - +from zitadel_client.models.web_key_service_ecdsa_curve import WebKeyServiceECDSACurve +WebKeyServiceECDSA.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_ecdsa_curve.py b/zitadel_client/models/web_key_service_ecdsa_curve.py index 07afee80..10d1f942 100644 --- a/zitadel_client/models/web_key_service_ecdsa_curve.py +++ b/zitadel_client/models/web_key_service_ecdsa_curve.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class WebKeyServiceECDSACurve(str, Enum): @@ -23,17 +13,7 @@ class WebKeyServiceECDSACurve(str, Enum): WebKeyServiceECDSACurve """ - """ - allowed enum values - """ - ECDSA_CURVE_UNSPECIFIED = 'ECDSA_CURVE_UNSPECIFIED' - ECDSA_CURVE_P256 = 'ECDSA_CURVE_P256' - ECDSA_CURVE_P384 = 'ECDSA_CURVE_P384' - ECDSA_CURVE_P512 = 'ECDSA_CURVE_P512' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of WebKeyServiceECDSACurve from a JSON string""" - return cls(json.loads(json_str)) - - + ECDSA_CURVE_UNSPECIFIED = "ECDSA_CURVE_UNSPECIFIED" + ECDSA_CURVE_P256 = "ECDSA_CURVE_P256" + ECDSA_CURVE_P384 = "ECDSA_CURVE_P384" + ECDSA_CURVE_P512 = "ECDSA_CURVE_P512" diff --git a/zitadel_client/models/web_key_service_list_web_keys_response.py b/zitadel_client/models/web_key_service_list_web_keys_response.py index 603df87e..2d5cff63 100644 --- a/zitadel_client/models/web_key_service_list_web_keys_response.py +++ b/zitadel_client/models/web_key_service_list_web_keys_response.py @@ -1,35 +1,27 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json from pydantic import BaseModel, ConfigDict, Field -from typing import Any, ClassVar, Dict, List, Optional -from zitadel_client.models.web_key_service_web_key import WebKeyServiceWebKey -from typing import Optional, Set -from typing_extensions import Self +from typing import List, Optional + class WebKeyServiceListWebKeysResponse(BaseModel): """ WebKeyServiceListWebKeysResponse - """ # noqa: E501 + """ + web_keys: Optional[List[WebKeyServiceWebKey]] = Field(default=None, alias="webKeys") - __properties: ClassVar[List[str]] = ["webKeys"] + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -37,59 +29,6 @@ class WebKeyServiceListWebKeysResponse(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceListWebKeysResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in web_keys (list) - _items = [] - if self.web_keys: - for _item_web_keys in self.web_keys: - if _item_web_keys: - _items.append(_item_web_keys.to_dict()) - _dict['webKeys'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceListWebKeysResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "webKeys": [WebKeyServiceWebKey.from_dict(_item) for _item in obj["webKeys"]] if obj.get("webKeys") is not None else None - }) - return _obj - +from zitadel_client.models.web_key_service_web_key import WebKeyServiceWebKey +WebKeyServiceListWebKeysResponse.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_rsa.py b/zitadel_client/models/web_key_service_rsa.py index f548a876..4f9245fd 100644 --- a/zitadel_client/models/web_key_service_rsa.py +++ b/zitadel_client/models/web_key_service_rsa.py @@ -1,37 +1,28 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.web_key_service_rsa_bits import WebKeyServiceRSABits -from zitadel_client.models.web_key_service_rsa_hasher import WebKeyServiceRSAHasher -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from typing import Optional + class WebKeyServiceRSA(BaseModel): """ WebKeyServiceRSA - """ # noqa: E501 - bits: Optional[WebKeyServiceRSABits] = None - hasher: Optional[WebKeyServiceRSAHasher] = None - __properties: ClassVar[List[str]] = ["bits", "hasher"] + """ + bits: Optional[WebKeyServiceRSABits] = Field(default=None, alias="bits") + hasher: Optional[WebKeyServiceRSAHasher] = Field(default=None, alias="hasher") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -39,53 +30,7 @@ class WebKeyServiceRSA(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceRSA from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceRSA from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "bits": obj.get("bits"), - "hasher": obj.get("hasher") - }) - return _obj - +from zitadel_client.models.web_key_service_rsa_bits import WebKeyServiceRSABits +from zitadel_client.models.web_key_service_rsa_hasher import WebKeyServiceRSAHasher +WebKeyServiceRSA.model_rebuild(raise_errors=False) diff --git a/zitadel_client/models/web_key_service_rsa_bits.py b/zitadel_client/models/web_key_service_rsa_bits.py index bc6523bf..3ad5b4ab 100644 --- a/zitadel_client/models/web_key_service_rsa_bits.py +++ b/zitadel_client/models/web_key_service_rsa_bits.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class WebKeyServiceRSABits(str, Enum): @@ -23,17 +13,7 @@ class WebKeyServiceRSABits(str, Enum): WebKeyServiceRSABits """ - """ - allowed enum values - """ - RSA_BITS_UNSPECIFIED = 'RSA_BITS_UNSPECIFIED' - RSA_BITS_2048 = 'RSA_BITS_2048' - RSA_BITS_3072 = 'RSA_BITS_3072' - RSA_BITS_4096 = 'RSA_BITS_4096' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of WebKeyServiceRSABits from a JSON string""" - return cls(json.loads(json_str)) - - + RSA_BITS_UNSPECIFIED = "RSA_BITS_UNSPECIFIED" + RSA_BITS_2048 = "RSA_BITS_2048" + RSA_BITS_3072 = "RSA_BITS_3072" + RSA_BITS_4096 = "RSA_BITS_4096" diff --git a/zitadel_client/models/web_key_service_rsa_hasher.py b/zitadel_client/models/web_key_service_rsa_hasher.py index d3992a8d..b82e2dbd 100644 --- a/zitadel_client/models/web_key_service_rsa_hasher.py +++ b/zitadel_client/models/web_key_service_rsa_hasher.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class WebKeyServiceRSAHasher(str, Enum): @@ -23,17 +13,7 @@ class WebKeyServiceRSAHasher(str, Enum): WebKeyServiceRSAHasher """ - """ - allowed enum values - """ - RSA_HASHER_UNSPECIFIED = 'RSA_HASHER_UNSPECIFIED' - RSA_HASHER_SHA256 = 'RSA_HASHER_SHA256' - RSA_HASHER_SHA384 = 'RSA_HASHER_SHA384' - RSA_HASHER_SHA512 = 'RSA_HASHER_SHA512' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of WebKeyServiceRSAHasher from a JSON string""" - return cls(json.loads(json_str)) - - + RSA_HASHER_UNSPECIFIED = "RSA_HASHER_UNSPECIFIED" + RSA_HASHER_SHA256 = "RSA_HASHER_SHA256" + RSA_HASHER_SHA384 = "RSA_HASHER_SHA384" + RSA_HASHER_SHA512 = "RSA_HASHER_SHA512" diff --git a/zitadel_client/models/web_key_service_state.py b/zitadel_client/models/web_key_service_state.py index 8b6f25a5..59ddf596 100644 --- a/zitadel_client/models/web_key_service_state.py +++ b/zitadel_client/models/web_key_service_state.py @@ -1,21 +1,11 @@ -# coding: utf-8 +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json from enum import Enum -from typing_extensions import Self class WebKeyServiceState(str, Enum): @@ -23,18 +13,8 @@ class WebKeyServiceState(str, Enum): WebKeyServiceState """ - """ - allowed enum values - """ - STATE_UNSPECIFIED = 'STATE_UNSPECIFIED' - STATE_INITIAL = 'STATE_INITIAL' - STATE_ACTIVE = 'STATE_ACTIVE' - STATE_INACTIVE = 'STATE_INACTIVE' - STATE_REMOVED = 'STATE_REMOVED' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of WebKeyServiceState from a JSON string""" - return cls(json.loads(json_str)) - - + STATE_UNSPECIFIED = "STATE_UNSPECIFIED" + STATE_INITIAL = "STATE_INITIAL" + STATE_ACTIVE = "STATE_ACTIVE" + STATE_INACTIVE = "STATE_INACTIVE" + STATE_REMOVED = "STATE_REMOVED" diff --git a/zitadel_client/models/web_key_service_web_key.py b/zitadel_client/models/web_key_service_web_key.py index 562ab910..686da555 100644 --- a/zitadel_client/models/web_key_service_web_key.py +++ b/zitadel_client/models/web_key_service_web_key.py @@ -1,44 +1,44 @@ -# coding: utf-8 - -""" - Zitadel SDK - - The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. - - The version of the OpenAPI document: 1.0.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech from __future__ import annotations -import pprint -import re # noqa: F401 -import json -from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, Optional -from zitadel_client.models.web_key_service_ecdsa import WebKeyServiceECDSA -from zitadel_client.models.web_key_service_rsa import WebKeyServiceRSA -from zitadel_client.models.web_key_service_state import WebKeyServiceState -from typing import Optional, Set -from typing_extensions import Self +from pydantic import BaseModel, ConfigDict, Field +from pydantic import StrictStr +from typing import Optional + class WebKeyServiceWebKey(BaseModel): """ WebKeyServiceWebKey - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the key.") - creation_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="creationDate") - change_date: Optional[datetime] = Field(default=None, description="A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by \"Z\") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.", alias="changeDate") - state: Optional[WebKeyServiceState] = None - ecdsa: Optional[WebKeyServiceECDSA] = None - ed25519: Optional[Dict[str, Any]] = None - rsa: Optional[WebKeyServiceRSA] = None - __properties: ClassVar[List[str]] = ["id", "creationDate", "changeDate", "state", "ecdsa", "ed25519", "rsa"] + """ + id: Optional[StrictStr] = Field( + default=None, alias="id", description="The unique identifier of the key." + ) + creation_date: Optional[AwareDatetime] = Field( + default=None, + alias="creationDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + change_date: Optional[AwareDatetime] = Field( + default=None, + alias="changeDate", + description='A Timestamp represents a point in time independent of any time zone or local calendar, encoded as a count of seconds and fractions of seconds at nanosecond resolution. The count is relative to an epoch at UTC midnight on January 1, 1970, in the proleptic Gregorian calendar which extends the Gregorian calendar backwards to year one. All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap second table is needed for interpretation, using a [24-hour linear smear](https://developers.google.com/time/smear). The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that we can convert to and from [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; gettimeofday(&tv, NULL); Timestamp timestamp; timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long millis = System.currentTimeMillis(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % 1000) * 1000000)).build(); Example 5: Compute Timestamp from Java `Instant.now()`. Instant now = Instant.now(); Timestamp timestamp = Timestamp.newBuilder().setSeconds(now.getEpochSecond()) .setNanos(now.getNano()).build(); Example 6: Compute Timestamp from current time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON Mapping In JSON format, the Timestamp type is encoded as a string in the [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone is required. A proto3 JSON serializer should always use UTC (as indicated by "Z") when printing the Timestamp type and a proto3 JSON parser should be able to accept both UTC and other timezones (as indicated by an offset). For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one can convert a Date object to this format using the standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) method. In Python, a standard `datetime.datetime` object can be converted to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use the Joda Time\'s [`ISODateTimeFormat.dateTime()`]( http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() ) to obtain a formatter capable of generating timestamps in this format.', + ) + state: Optional[WebKeyServiceState] = Field(default=None, alias="state") + ecdsa: Optional[WebKeyServiceECDSA] = Field(default=None, alias="ecdsa") + ed25519: Optional[object] = Field(default=None, alias="ed25519") + rsa: Optional[WebKeyServiceRSA] = Field(default=None, alias="rsa") + + # Strict primitives (Item 8 — StrictInt/StrictStr/...) carry the + # per-field strictness, so the model-wide ConfigDict no longer needs + # strict=True. populate_by_name keeps both alias and snake_case + # field-name kwargs working in constructors. model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -46,64 +46,9 @@ class WebKeyServiceWebKey(BaseModel): ) - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebKeyServiceWebKey from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of ecdsa - if self.ecdsa: - _dict['ecdsa'] = self.ecdsa.to_dict() - # override the default output from pydantic by calling `to_dict()` of rsa - if self.rsa: - _dict['rsa'] = self.rsa.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebKeyServiceWebKey from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "creationDate": obj.get("creationDate"), - "changeDate": obj.get("changeDate"), - "state": obj.get("state"), - "ecdsa": WebKeyServiceECDSA.from_dict(obj["ecdsa"]) if obj.get("ecdsa") is not None else None, - "ed25519": obj.get("ed25519"), - "rsa": WebKeyServiceRSA.from_dict(obj["rsa"]) if obj.get("rsa") is not None else None - }) - return _obj - +from pydantic import AwareDatetime +from zitadel_client.models.web_key_service_ecdsa import WebKeyServiceECDSA +from zitadel_client.models.web_key_service_rsa import WebKeyServiceRSA +from zitadel_client.models.web_key_service_state import WebKeyServiceState +WebKeyServiceWebKey.model_rebuild(raise_errors=False) diff --git a/zitadel_client/object_serializer.py b/zitadel_client/object_serializer.py new file mode 100644 index 00000000..2b860707 --- /dev/null +++ b/zitadel_client/object_serializer.py @@ -0,0 +1,642 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +import base64 +import datetime +import decimal +import json +import re +import uuid +from datetime import timezone +from enum import Enum +from typing import Any, ClassVar, Optional, Type, TypeVar, Union, cast, overload + +from dateutil.parser import parse +from pydantic import BaseModel, SecretStr, TypeAdapter + +# The protobuf-JSON duration helpers live in a tiny dependency-free module so +# both this serializer and the generated pydantic models (via the +# ProtobufDuration annotated type) can import them without a circular import +# back through zitadel_client.models. +from zitadel_client._duration import ( + _format_timedelta_protobuf, + _parse_timedelta_protobuf, +) + +# The errors package imports ObjectSerializer lazily (inside a method), so this +# top-level import does not create a cycle. +from zitadel_client.errors.serialization_exception import SerializationException + +import zitadel_client.models + +T = TypeVar("T") + +# Module-level TypeAdapter cache for Item 10. TypeAdapter compiles a +# validator + serializer for a generic type once; reusing the instance +# across calls avoids paying that cost on every list/dict deserialization. +_LIST_ADAPTER_CACHE: dict[type, TypeAdapter[Any]] = {} +_DICT_ADAPTER_CACHE: dict[type, TypeAdapter[Any]] = {} + + +# `inner` is a runtime type object used to build a parametrized container +# type for pydantic. It is annotated as Any (not `type`) because subscripting +# `list[inner]` / `dict[str, inner]` with a `type`-annotated variable is not a +# valid static type expression; Any lets mypy treat the result as the +# (correct) `list[Any]` / `dict[str, Any]` without an inline override. +def _list_adapter(inner: Any) -> TypeAdapter[Any]: + cached = _LIST_ADAPTER_CACHE.get(inner) + if cached is None: + cached = TypeAdapter(list[inner]) + _LIST_ADAPTER_CACHE[inner] = cached + return cached + + +def _dict_adapter(inner: Any) -> TypeAdapter[Any]: + cached = _DICT_ADAPTER_CACHE.get(inner) + if cached is None: + cached = TypeAdapter(dict[str, inner]) + _DICT_ADAPTER_CACHE[inner] = cached + return cached + + +# Maximum allowed JSON nesting depth. Python's json.loads recurses through +# the interpreter stack, so a malicious 100k-deep `{"a":{"a":...}}` payload +# would exhaust it. All twelve SDKs use the same cap. +_MAX_JSON_DEPTH = 1000 + + +def _json_max_depth(data: str) -> int: + """Return the maximum nesting depth of ``{``/``[`` containers. + + Characters inside string literals are ignored. A cheap pre-flight scan + used to refuse a deeply-nested payload before invoking ``json.loads``. + """ + depth = 0 + deepest = 0 + in_string = False + escaped = False + for char in data: + if in_string: + if escaped: + escaped = False + elif char == "\\": + escaped = True + elif char == '"': + in_string = False + continue + if char == '"': + in_string = True + elif char in "{[": + depth += 1 + if depth > deepest: + deepest = depth + elif char in "}]": + if depth > 0: + depth -= 1 + return deepest + + +class ObjectSerializer: + """Handles JSON serialization and deserialization for API requests and responses. + + All serde operations in the generated client route through this class. + The parameter encoding methods provide consistent value conversion for + URL path, query string, header, and form parameters. + """ + + _PRIMITIVE_TYPES = (float, bool, bytes, str, int) + + _NATIVE_TYPES_MAPPING: ClassVar[dict[str, type]] = { + "int": int, + "long": int, + "float": float, + "str": str, + "bool": bool, + "bytes": bytes, + "date": datetime.date, + "datetime": datetime.datetime, + # Item 5 — pydantic AwareDatetime resolves to the stdlib datetime + # at runtime; pydantic enforces the tz-awareness invariant during + # model validation, not in this hand-rolled fallback path. + "AwareDatetime": datetime.datetime, + "datetime.time": datetime.time, + "datetime.timedelta": datetime.timedelta, + "decimal": decimal.Decimal, + "uuid.UUID": uuid.UUID, + "object": object, + # Item 8 — pydantic StrictXxx aliases resolve to their stdlib + # primitives for the top-level _deserialize() fallback path. + # Strictness is enforced by per-field StrictXxx annotations on + # generated models, not by this map. + "StrictInt": int, + "StrictFloat": float, + "StrictBool": bool, + "StrictStr": str, + # LaxFloat (format: float/double) and UrlStr (format: uri) are the + # SDK's own Annotated aliases over float/str. They normally appear only + # as scalar model-field annotations resolved by pydantic, but mapping + # them here keeps a container element type-name string (e.g. an inner + # 'LaxFloat' of a List[...]) resolvable on the hand-rolled fallback path. + "LaxFloat": float, + "UrlStr": str, + } + + def __init__(self) -> None: + pass + + def serialize(self, obj: Any) -> str: + """Serialize an object to a JSON string. + + Uses allow_nan=False so NaN/Infinity/-Infinity raise ValueError + instead of being emitted as `NaN`/`Infinity` (which RFC 8259 + forbids — Python's default allow_nan=True is non-spec-compliant). + Aligns Python with the 10 SDKs that already reject non-finite + floats both on encode and decode. + + This is the single source of truth for turning a model into its JSON + wire form, used by BOTH the JSON request-body path and the model part + of a multipart/form-data body (see DefaultApiClient._multipart_part). + Pydantic ``model_dump_json(by_alias=True, ...)`` emits the configured + WIRE property names (field aliases such as ``isEnabled``/``recordedAt``, + never the snake_case attribute names) and the model's declared + date-time / duration serializers, so the multipart model part is + byte-identical to a JSON request body for the same model. + """ + try: + if isinstance(obj, BaseModel): + if hasattr(obj, "anyof_merged_dump"): + # anyOf retain-all: emit the union of every retained + # variant's fields so co-satisfied data round-trips + # losslessly instead of dropping all but the first variant. + return json.dumps( + obj.anyof_merged_dump(), + default=str, + ensure_ascii=False, + allow_nan=False, + ) + if hasattr(obj, "actual_instance"): + return self.serialize(obj.actual_instance) + return obj.model_dump_json(by_alias=True, exclude_none=True) + return json.dumps( + ObjectSerializer._sanitize_for_serialization(obj), + default=str, + ensure_ascii=False, + allow_nan=False, + ) + except Exception as e: + raise SerializationException(f"Failed to serialize object to JSON: {e}", e) + + @staticmethod + def _reject_nonfinite_constant(name: str) -> Any: + # Raised when json.loads encounters NaN/Infinity/-Infinity literals. + # The default parse_constant accepts them silently; we reject so + # non-spec-compliant JSON from a misbehaving server fails loudly. + raise SerializationException( + f"Non-finite JSON number '{name}' is forbidden by RFC 8259", None + ) + + @staticmethod + def parse_json(json_string: str) -> Any: + """Parse JSON text into a plain Python value. + + Payloads that exceed the ``_MAX_JSON_DEPTH`` nesting cap are refused + (DoS guard for malicious deeply-nested payloads). + + :param json_string: the raw JSON text + :return: the parsed value + :raises SerializationException: if the depth limit is exceeded or + parsing fails + """ + depth = _json_max_depth(json_string) + if depth > _MAX_JSON_DEPTH: + raise SerializationException( + f"JSON nesting depth {depth} exceeds limit {_MAX_JSON_DEPTH}", None + ) + try: + return json.loads( + json_string, + parse_constant=ObjectSerializer._reject_nonfinite_constant, + ) + except SerializationException: + raise + except Exception as e: + raise SerializationException(f"Failed to parse JSON: {e}", e) + + @overload + def deserialize(self, json_string: Optional[str], target_type: str) -> Any: ... + + @overload + def deserialize( + self, json_string: Optional[str], target_type: Type[T] + ) -> Optional[T]: ... + + def deserialize( + self, json_string: Optional[str], target_type: Union[str, Type[T]] + ) -> Any: + """Deserialize a JSON string to an object of the specified type. + + A target named by a string (a model name, or a ``List[...]`` or + ``Dict[...]`` of one) cannot be typed statically, so that form + returns ``Any``; a class target + returns an instance of that class, or ``None`` for an empty body. + """ + try: + if json_string is None or json_string == "": + return None + + # RFC 8259 §8.1 forbids a UTF-8 BOM at the start of JSON text, + # but Windows-generated payloads often include one and Python's + # json.loads rejects it. Strip silently for parity with Java + # Jackson / C# System.Text.Json which strip transparently. + if json_string.startswith(""): + json_string = json_string[1:] + + data = ObjectSerializer.parse_json(json_string) + # _deserialize is dynamically typed (returns Any); narrow it back + # to the declared Optional[T] for callers without an inline override. + return cast(Optional[T], self._deserialize(data, target_type)) + except SerializationException: + raise + except Exception as e: + raise SerializationException( + f"Failed to deserialize JSON to {target_type}: {e}", e + ) + + @classmethod + def _sanitize_for_serialization( + cls, obj: Any, _visited: Optional[set[int]] = None + ) -> Any: + """Convert an object to a JSON-safe dict/list/primitive. + + For Pydantic models, delegates to model_dump(). + A visited set tracks object ids to detect circular references. + """ + if obj is None: + return None + elif isinstance(obj, BaseModel): + return obj.model_dump(by_alias=True, exclude_none=True) + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, bytes): + return base64.b64encode(obj).decode("ascii") + elif isinstance(obj, cls._PRIMITIVE_TYPES): + return obj + elif isinstance(obj, datetime.datetime): + dt = obj if obj.tzinfo is not None else obj.replace(tzinfo=timezone.utc) + # Emit with millisecond precision so a sub-second instant is not + # silently truncated to whole seconds on the wire. The decode path + # (dateutil.parser.parse) accepts the fraction, so dropping it on + # encode would make the round-trip lossy and asymmetric. timespec= + # 'milliseconds' always renders exactly three fractional digits, + # matching the cross-SDK common denominator. + return dt.isoformat(timespec="milliseconds") + elif isinstance(obj, datetime.timedelta): + # Must precede the datetime.date branch only because timedelta + # is not a date subclass; ordered alongside the other temporal + # types for readability. + return _format_timedelta_protobuf(obj) + elif isinstance(obj, datetime.time): + return obj.isoformat(timespec="seconds") + elif isinstance(obj, datetime.date): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, (list, tuple, set, frozenset, dict)) or hasattr( + obj, "__dict__" + ): + if _visited is None: + _visited = set() + obj_id = id(obj) + if obj_id in _visited: + raise SerializationException( + "Circular reference detected during serialization" + ) + _visited.add(obj_id) + try: + if isinstance(obj, list): + sanitized: Any = [ + cls._sanitize_for_serialization(item, _visited) for item in obj + ] + elif isinstance(obj, tuple): + sanitized = tuple( + cls._sanitize_for_serialization(item, _visited) for item in obj + ) + elif isinstance(obj, (set, frozenset)): + # JSON has no set type, so a set/frozenset must emit as a + # JSON ARRAY — not the Python repr string ('{1, 2, 3}') the + # bare `str(obj)` fallback used to produce. Sets are + # unordered; sort when the elements are mutually comparable + # so the wire form is deterministic, and fall back to + # insertion/hash order for mixed-type sets that can't be + # ordered (sorting would raise TypeError there). + items = [ + cls._sanitize_for_serialization(item, _visited) for item in obj + ] + try: + sanitized = sorted(items) + except TypeError: + sanitized = items + elif isinstance(obj, dict): + sanitized = { + key: cls._sanitize_for_serialization(val, _visited) + for key, val in obj.items() + } + else: + sanitized = str(obj) + finally: + _visited.discard(obj_id) + return sanitized + else: + return str(obj) + + def _resolve_klass_name(self, name: str) -> Optional[type]: + """Resolve a flat type-name string to a Python type for TypeAdapter. + + Returns ``None`` when the name is a composite (``List[...]`` / + ``Dict[...]``) so the caller falls back to recursive deserialization. + Used by the Item 10 TypeAdapter fast path for ``List[T]`` / + ``Dict[str, T]`` collections. + """ + if name.startswith("List[") or name.startswith("Dict["): + return None + # ``bytes`` carries an OAS ``format: byte`` payload that travels on the + # wire as a base64 STRING. The dedicated ``klass is bytes`` branch in + # ``_deserialize`` base64-DECODES it; a plain ``TypeAdapter(bytes)`` + # does NOT — it UTF-8-encodes the string verbatim, so the base64 text + # ``"AQIDBA=="`` would come back as the raw bytes of that text instead + # of ``b'\x01\x02\x03\x04'``. Returning None here keeps the inner + # ``bytes`` element of a ``List[bytes]`` / ``Dict[str, bytes]`` (and the + # byte branch of a oneOf/anyOf union) on the recursive element-wise + # path so each element is correctly base64-decoded. + if name == "bytes": + return None + # ``datetime`` / ``AwareDatetime`` carry an OAS ``format: date-time`` + # payload whose decode rule must reject NAIVE (offset-less) instants for + # parity with the AwareDatetime model fields. A plain + # ``TypeAdapter(list[datetime])`` accepts naive values, so keep these on + # the recursive element-wise path where the ``datetime.datetime`` branch + # of ``_deserialize`` applies the consistent tz-awareness rule. + if name in ("datetime", "AwareDatetime"): + return None + if name in self._NATIVE_TYPES_MAPPING: + return self._NATIVE_TYPES_MAPPING[name] + resolved = getattr(zitadel_client.models, name, None) + if isinstance(resolved, type): + return resolved + return None + + def _deserialize(self, data: Any, klass: Any) -> Any: + """Deserialize parsed data to the target type. + + For Pydantic models, delegates to model_validate(). + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + inner = self._resolve_klass_name(sub_kls) + # Item 10 — pydantic TypeAdapter handles list-of-model + # validation natively (one cached adapter per inner type). + # Falls back to the element-wise recursion only for inner + # types the adapter can't express (e.g. nested 'List[X]'). + if inner is not None: + return _list_adapter(inner).validate_python(data) + # A ``str``/``bytes`` scalar is iterable, so an un-guarded + # comprehension would silently walk it character-by-character — + # e.g. inside a oneOf of [bytes, List[bytes]] the base64 STRING + # for the scalar variant would be mis-parsed element-by-element + # into a list. Reject non-sequence input here so the composed + # deserializer falls through to the scalar ``bytes`` variant. + if isinstance(data, (str, bytes)) or not isinstance( + data, (list, tuple) + ): + raise ValueError( + f"Expected a list for {klass}, got {type(data).__name__}" + ) + return [self._deserialize(item, sub_kls) for item in data] + + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + inner = self._resolve_klass_name(sub_kls) + if inner is not None: + return _dict_adapter(inner).validate_python(data) + return {k: self._deserialize(v, sub_kls) for k, v in data.items()} + + if klass in self._NATIVE_TYPES_MAPPING: + klass = self._NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(zitadel_client.models, klass) + + if isinstance(klass, type) and issubclass(klass, BaseModel): + if hasattr(klass, "any_of_schemas") or hasattr(klass, "one_of_schemas"): + return self._deserialize_composed(data, klass) + return klass.model_validate(data) + elif klass is bytes: + if isinstance(data, bytes): + return data + if isinstance(data, str): + return base64.b64decode(data) + return data + elif klass in self._PRIMITIVE_TYPES: + try: + return klass(data) + except (UnicodeEncodeError, TypeError): + return data + elif klass is object: + return data + elif klass == datetime.date: + return parse(data).date() + elif klass == datetime.datetime: + # Item 5 — the top-level / container date-time decode path must + # apply the SAME tz-awareness rule that model fields enforce via + # pydantic AwareDatetime. dateutil.parser.parse happily returns a + # NAIVE datetime for an offset-less string like '2024-01-01T00:00:00', + # which would let a container-typed value (e.g. List[datetime] / + # Dict[str, datetime]) slip through naive while the identical value + # on a model field is rejected. Reject naive results here so both + # paths decode by one consistent AwareDatetime rule. + parsed = parse(data) if not isinstance(data, datetime.datetime) else data + if parsed.tzinfo is None or parsed.tzinfo.utcoffset(parsed) is None: + raise ValueError( + "Naive datetime is not allowed; an offset-aware date-time " + "(AwareDatetime) is required" + ) + return parsed + elif klass == datetime.time: + if isinstance(data, datetime.time): + return data + return datetime.time.fromisoformat(data) + elif klass == datetime.timedelta: + if isinstance(data, datetime.timedelta): + return data + return _parse_timedelta_protobuf(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif klass == uuid.UUID: + return uuid.UUID(data) if not isinstance(data, uuid.UUID) else data + elif isinstance(klass, type) and issubclass(klass, Enum): + return klass(data) + else: + return data + + def _deserialize_composed(self, data: Any, klass: type) -> Any: + """Deserialize data for oneOf/anyOf composed schemas. + + oneOf and a discriminated union keep FIRST-match semantics: the first + candidate the payload validates against is wrapped and returned. + + anyOf without a discriminator uses RETAIN-ALL (lossless) semantics: a + payload may satisfy several variants at once (the schema is documented + as matching one variant, another, OR BOTH), so EVERY successfully + decoded variant is retained and passed to the composed model as a list. + On re-encode the union of all retained variants' fields is emitted, so + co-satisfied data round-trips with no silent drop. A payload matching a + single variant still decodes correctly (the list has one element). + + Gap AU: when the composed schema declares a discriminator, route + through `get_discriminator_value` so missing / empty / unknown + discriminator values raise ValueError (matches the other SDKs) + instead of silently wrapping the raw dict in `actual_instance`. + """ + # The model emits any_of_schemas / one_of_schemas as a declared-order + # tuple so that trialling candidates below honours declaration order. + # Iterating a set here would visit candidates in hash order and resolve + # ambiguous payloads non-deterministically. + any_of_schemas: tuple[str, ...] = getattr(klass, "any_of_schemas", None) or () + one_of_schemas: tuple[str, ...] = getattr(klass, "one_of_schemas", None) or () + get_discriminator_value = getattr(klass, "get_discriminator_value", None) + if get_discriminator_value is not None and isinstance(data, dict): + mapped = get_discriminator_value(data) + if mapped: + instance = self._deserialize(data, mapped) + return klass(instance) + + if any_of_schemas: + # Retain-all: collect every variant the payload satisfies. + matched: list = [] + for schema_name in any_of_schemas: + try: + matched.append(self._deserialize(data, schema_name)) + except Exception: + continue + if matched: + return klass(matched) + return klass(data) + + for schema_name in one_of_schemas: + try: + instance = self._deserialize(data, schema_name) + return klass(instance) + except Exception: + continue + return klass(data) + + @classmethod + def stringify(cls, value: Any) -> str: + """Convert a scalar value to its string representation. + + This is the canonical type-conversion method used by all parameter + encoding helpers and by :class:`ValueSerializer`. + + Args: + value: The value to convert. + + Returns: + The string representation of the value. + """ + if value is None: + return "" + if isinstance(value, bool): + return "true" if value else "false" + if isinstance(value, Enum): + return str(value.value) + if isinstance(value, datetime.datetime): + dt = ( + value + if value.tzinfo is not None + else value.replace(tzinfo=timezone.utc) + ) + # Preserve millisecond precision on the parameter path (query / path + # / header / form) for the same reason as the JSON-body path above: + # the decoder accepts the fraction, so truncating it here would make + # the wire round-trip lossy. timespec='milliseconds' renders exactly + # three fractional digits. + return dt.isoformat(timespec="milliseconds") + if isinstance(value, datetime.timedelta): + return _format_timedelta_protobuf(value) + if isinstance(value, datetime.time): + return value.isoformat(timespec="seconds") + if isinstance(value, datetime.date): + return value.isoformat() + if isinstance(value, uuid.UUID): + return str(value) + return str(value) + + @classmethod + def to_path_value(cls, value: Any) -> str: + """Convert a value to a string suitable for use as a URL path parameter.""" + return cls.stringify(value) + + @classmethod + def to_query_value(cls, value: Any, collection_format: Optional[str] = None) -> Any: + """Convert a value to a representation suitable for use as a query parameter. + + For collections, joins using the specified collection format delimiter. + """ + if value is None: + return None + if isinstance(value, list): + # Stringify each element; ``None`` becomes an empty slot so that + # ``[1, None, 3]`` serializes as ``"1,,3"`` (csv keep-slot) for + # csv/ssv/tsv/pipes joins. For the ``multi`` style, elements are + # returned as a list and ``None`` is preserved as ``''`` so that + # the slot is not dropped by downstream encoders. + items = ["" if v is None else cls.stringify(v) for v in value] + if collection_format == "multi": + return items + if collection_format == "ssv": + return " ".join(items) + if collection_format == "tsv": + return "\t".join(items) + if collection_format == "pipes": + return "|".join(items) + return ",".join(items) + return cls.stringify(value) + + @classmethod + def to_header_value(cls, value: Any) -> str: + """Convert a value to a string suitable for use as an HTTP header value.""" + if value is None: + return "" + if isinstance(value, list): + return ",".join(cls.stringify(v) for v in value) + return cls.stringify(value) + + @classmethod + def to_cookie_value(cls, value: Any) -> str: + """Convert a value to a string suitable for use as an HTTP cookie value. + + Cookie values follow the same encoding rules as header values. + """ + return cls.to_header_value(value) + + @classmethod + def to_form_value(cls, value: Any) -> Any: + """Convert a value to a representation suitable for use as a form parameter.""" + if value is None: + return "" + return cls.stringify(value) diff --git a/zitadel_client/rest.py b/zitadel_client/rest.py deleted file mode 100644 index 0db82255..00000000 --- a/zitadel_client/rest.py +++ /dev/null @@ -1,183 +0,0 @@ -import json -import re -import ssl -from typing import Dict, Optional - -import urllib3 - -from zitadel_client.rest_response import RESTResponse - -RESTResponseType = urllib3.HTTPResponse - - -class RESTClientObject: - def __init__(self, configuration) -> None: # type: ignore - # 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 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - # noinspection PyUnresolvedReferences - cert_reqs = ssl.CERT_REQUIRED - else: - # noinspection PyUnresolvedReferences - cert_reqs = ssl.CERT_NONE - - pool_args = { - "cert_reqs": cert_reqs, - "ca_certs": configuration.ssl_ca_cert, - "cert_file": configuration.cert_file, - "key_file": configuration.key_file, - "ca_cert_data": configuration.ca_cert_data, - } - if configuration.assert_hostname is not None: - pool_args["assert_hostname"] = configuration.assert_hostname - - if configuration.retries is not None: - pool_args["retries"] = configuration.retries - - if configuration.tls_server_name: - pool_args["server_hostname"] = configuration.tls_server_name - - if configuration.socket_options is not None: - pool_args["socket_options"] = configuration.socket_options - - if configuration.connection_pool_maxsize is not None: - pool_args["maxsize"] = configuration.connection_pool_maxsize - - # https pool manager - self.pool_manager: urllib3.PoolManager - if configuration.proxy_url: - # noinspection PyArgumentList - self.pool_manager = urllib3.ProxyManager(configuration.proxy_url, **pool_args) # ty: ignore[invalid-argument-type] - else: - # noinspection PyArgumentList - self.pool_manager = urllib3.PoolManager(**pool_args) # ty: ignore[invalid-argument-type] - - def request( # noqa C901 too complex - self, - method: str, - url: str, - headers: Optional[Dict[str, str]] = None, - body=None, - post_params=None, - _request_timeout=None, - ): - """Perform requests. - - :param method: http request method - :param url: http request 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 _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 RuntimeError("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, float)): - 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]) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: - # no content type provided or payload is json - content_type = headers.get("Content-Type") - if not content_type or re.search("json", content_type, re.IGNORECASE): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif content_type == "application/x-www-form-urlencoded": - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif 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"] - # Ensures that dict objects are serialized - post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False, - ) - # 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) or isinstance(body, bytes): - r = self.pool_manager.request( - method, - url, - body=body, - timeout=timeout, - headers=headers, - preload_content=False, - ) - elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - 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 RuntimeError(msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False, - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise RuntimeError(msg) from e - - return RESTResponse(r) diff --git a/zitadel_client/rest_response.py b/zitadel_client/rest_response.py deleted file mode 100644 index 978ef90c..00000000 --- a/zitadel_client/rest_response.py +++ /dev/null @@ -1,29 +0,0 @@ -import io -from typing import Dict, Optional - -from urllib3 import BaseHTTPResponse - - -class RESTResponse(io.IOBase): - data: Optional[bytes] = None - - def __init__(self, resp: BaseHTTPResponse, *args, **kwargs) -> None: # type: ignore - # noinspection PyArgumentList - super().__init__(*args, **kwargs) - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None - - def read(self) -> Optional[bytes]: - if self.data is None: - self.data = self.response.data - return self.data - - def getheaders(self) -> Dict[str, str]: - """Returns a dictionary of the response headers.""" - return dict(self.response.headers) - - def getheader(self, name: str, default: Optional[str] = None) -> Optional[str]: - """Returns a given response header.""" - return self.response.headers.get(name, default) diff --git a/zitadel_client/server_configuration.py b/zitadel_client/server_configuration.py new file mode 100644 index 00000000..45fec472 --- /dev/null +++ b/zitadel_client/server_configuration.py @@ -0,0 +1,91 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from dataclasses import dataclass, field +from typing import Dict, List, Optional + + +@dataclass(frozen=True) +class ServerVariable: + """Represents a server variable from the OpenAPI specification. + + Server variables define substitution parameters in server URL templates. + Each variable has a default value and may optionally restrict values to + an enumerated set. + + This class is immutable and thread-safe. + """ + + default_value: str + """The default value used when no override is provided.""" + + description: Optional[str] = None + """Human-readable description of the variable, or ``None`` if not specified.""" + + enum_values: List[str] = field(default_factory=list) + """Allowed values for this variable. + + An empty list means any value is accepted. + """ + + +@dataclass(frozen=True) +class ServerConfiguration: + """Represents a single server entry from the OpenAPI specification. + + A server URL may contain template variables (e.g. + ``'https://{env}.api.example.com/v{version}'``). Use :meth:`get_url` + to resolve the URL with default variable values, or pass overrides + to substitute specific variables. + + This class is immutable and thread-safe. + """ + + url_template: str + """The raw URL template before variable substitution.""" + + description: Optional[str] = None + """Human-readable description of this server, or ``None`` if not specified.""" + + variables: Dict[str, ServerVariable] = field(default_factory=dict) + """The server variables and their definitions. + + Maps variable names to their :class:`ServerVariable` definitions. + """ + + def get_url(self, overrides: Optional[Dict[str, str]] = None) -> str: + """Resolve the URL template, substituting variable values. + + Variables not present in ``overrides`` use their default values. + If a variable has an enum constraint, the override value is + validated against the allowed values. + + Args: + overrides: Variable name to value overrides. If ``None`` or + empty, all variables use their defaults. + + Returns: + The fully resolved URL. + + Raises: + ValueError: If an override value is not in the variable's + enum_values. + """ + if overrides is None: + overrides = {} + + url = self.url_template + for var_name, var in self.variables.items(): + value = overrides.get(var_name, var.default_value) + + if var.enum_values and value not in var.enum_values: + raise ValueError( + f"Invalid value '{value}' for server variable '{var_name}'. Allowed values: {var.enum_values}" + ) + + url = url.replace("{" + var_name + "}", value) + return url diff --git a/zitadel_client/servers.py b/zitadel_client/servers.py new file mode 100644 index 00000000..6b8afff8 --- /dev/null +++ b/zitadel_client/servers.py @@ -0,0 +1,38 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +"""Generated server configurations from the OpenAPI specification. + +Each constant corresponds to a server entry defined in the spec's +``servers`` array. Use these constants with +``Configuration.builder().base_url(...)`` to select a server:: + + config = Configuration.builder() \\ + .base_url(SERVER_0.get_url()) \\ + .build() + +For servers with variables, pass overrides:: + + url = SERVER_1.get_url({'environment': 'staging'}) +""" + +from typing import List + +from zitadel_client.server_configuration import ServerConfiguration + +SERVER_0: ServerConfiguration = ServerConfiguration( + url_template="https://zitadel.com", + description=None, + variables={}, +) +"""Server 0: https://zitadel.com +""" + +ALL: List[ServerConfiguration] = [ + SERVER_0, +] +"""All server configurations in declaration order.""" diff --git a/zitadel_client/trace_context_util.py b/zitadel_client/trace_context_util.py new file mode 100644 index 00000000..fb52f385 --- /dev/null +++ b/zitadel_client/trace_context_util.py @@ -0,0 +1,27 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +"""Utility for injecting W3C Trace Context headers (traceparent, tracestate) +into outgoing API requests when OpenTelemetry is available. + +If the opentelemetry-api package is not installed, this function silently no-ops. +""" + +from typing import Dict + + +def inject_trace_context(headers: Dict[str, str]) -> None: + """Inject the current OpenTelemetry trace context into the given headers dict. + + :param headers: mutable dict of request headers + """ + try: + from opentelemetry.propagate import inject + + inject(carrier=headers) + except Exception: + pass diff --git a/zitadel_client/transport_options.py b/zitadel_client/transport_options.py index 623cfb01..888dd8c6 100644 --- a/zitadel_client/transport_options.py +++ b/zitadel_client/transport_options.py @@ -1,38 +1,304 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + from dataclasses import dataclass, field from types import MappingProxyType -from typing import Mapping, Optional +from typing import Dict, Mapping, Optional @dataclass(frozen=True) class TransportOptions: - """Immutable transport options for configuring HTTP connections. + """Immutable HTTP transport configuration for :class:`DefaultApiClient`. + + Controls low-level HTTP behavior such as TLS verification, proxy routing, + timeouts, redirect handling, and automatic header injection. These settings + are independent of API-level concerns (base URL, authentication headers) + which belong in :class:`Configuration`. + + This class is immutable and thread-safe. Use :meth:`builder` to create + instances:: + + transport = TransportOptions.builder() \\ + .verify_ssl(False) \\ + .proxy('http://proxy.example.com:8080') \\ + .timeout(5000) \\ + .user_agent('MyApp/1.0') \\ + .build() + """ - :param default_headers: Default HTTP headers sent to the origin server with every request. - :param ca_cert_path: Path to a custom CA certificate file for TLS verification. - :param insecure: Whether to disable TLS certificate verification. - :param proxy_url: Proxy URL for HTTP connections. + verify_ssl: bool = True + """Whether TLS certificate verification is enabled. + + When ``True`` (the default), the client verifies server certificates. + Set to ``False`` to accept any certificate (not recommended for + production). """ - default_headers: Mapping[str, str] = field(default_factory=dict) ca_cert_path: Optional[str] = None - insecure: bool = False - proxy_url: Optional[str] = None + """Path to a custom CA certificate bundle for TLS verification. + + When set together with ``verify_ssl=True``, the client trusts + certificates signed by this CA in addition to (or instead of) the + system trust store. + """ + + proxy: Optional[str] = None + """HTTP or HTTPS proxy URL for all outbound requests. + + Example: ``'http://proxy.corp.example.com:3128'``. + ``None`` means direct connections (no proxy). + """ + + timeout: Optional[int] = 10000 + """End-to-end request timeout in milliseconds. + + Covers the entire request lifecycle: connection, TLS handshake, + sending the request body, and reading the response. Defaults to + 10 seconds. Set to ``None`` to disable the timeout (wait + indefinitely). + """ + + follow_redirects: bool = True + """Whether the client follows HTTP 3xx redirects automatically. + + When ``True`` (the default), redirects are followed. Set to ``False`` + to return the redirect response as-is. + """ + + max_redirects: Optional[int] = None + """Maximum number of consecutive redirects to follow. + + Only meaningful when :attr:`follow_redirects` is ``True``. ``None`` + uses the HTTP client's built-in default. + """ + + user_agent: Optional[str] = "zitadel_client/0.0.1 (python)" + """Custom ``User-Agent`` header value. + + When set, this value is sent as the ``User-Agent`` header on every + request unless the caller explicitly provides one. ``None`` means + no custom user agent is injected. + """ + + default_headers: Mapping[str, str] = field( + default_factory=lambda: MappingProxyType({}) + ) + """Transport-level default headers included in every request. + + These headers have the *lowest* priority: API-level headers from + :attr:`Configuration.default_headers`, operation-specific headers, + and authentication headers all take precedence. + """ + + inject_request_id: bool = False + """Whether to auto-inject an ``X-Request-ID`` header with a unique + UUID on every request. + + Useful for distributed tracing and log correlation. The header is + only injected if the caller has not already set one. + """ def __post_init__(self) -> None: - object.__setattr__(self, "default_headers", MappingProxyType(dict(self.default_headers))) - - @staticmethod - def defaults() -> "TransportOptions": - """Returns a TransportOptions instance with all default values.""" - return TransportOptions() - - def to_session_kwargs(self) -> dict: - """Builds keyword arguments for an authlib OAuth2Session.""" - kwargs: dict = {} - if self.insecure: - kwargs["verify"] = False - elif self.ca_cert_path: - kwargs["verify"] = self.ca_cert_path - if self.proxy_url: - kwargs["proxies"] = {"http": self.proxy_url, "https": self.proxy_url} - return kwargs + """Ensure default_headers is always an immutable MappingProxyType.""" + if not isinstance(self.default_headers, MappingProxyType): + object.__setattr__( + self, "default_headers", MappingProxyType(dict(self.default_headers)) + ) + + @classmethod + def builder(cls) -> "TransportOptionsBuilder": + """Create a new builder for constructing TransportOptions instances. + + Returns: + A new builder with sensible defaults. + """ + return TransportOptionsBuilder() + + +class TransportOptionsBuilder: + """Builder for creating immutable :class:`TransportOptions` instances. + + All fields have sensible defaults: + + - ``verify_ssl`` -- ``True`` + - ``follow_redirects`` -- ``True`` + - ``inject_request_id`` -- ``False`` + - ``timeout`` -- ``10000`` (10 seconds) + - ``user_agent`` -- a package-specific default string + - All other fields -- ``None`` or empty + + Example:: + + transport = TransportOptions.builder() \\ + .verify_ssl(False) \\ + .proxy('http://proxy:3128') \\ + .timeout(5000) \\ + .build() + """ + + def __init__(self) -> None: + self._verify_ssl: bool = True + self._ca_cert_path: Optional[str] = None + self._proxy: Optional[str] = None + self._timeout: Optional[int] = 10000 + self._follow_redirects: bool = True + self._max_redirects: Optional[int] = None + self._user_agent: Optional[str] = "zitadel_client/0.0.1 (python)" + self._default_headers: Dict[str, str] = {} + self._inject_request_id: bool = False + + def verify_ssl(self, verify_ssl: bool) -> "TransportOptionsBuilder": + """Enable or disable TLS certificate verification. + + Args: + verify_ssl: ``True`` to verify (default), ``False`` to skip. + + Returns: + This builder. + """ + self._verify_ssl = verify_ssl + return self + + def ca_cert_path(self, ca_cert_path: Optional[str]) -> "TransportOptionsBuilder": + """Set the path to a custom CA certificate bundle. + + Args: + ca_cert_path: File path to a PEM-encoded CA certificate, or ``None``. + + Returns: + This builder. + """ + self._ca_cert_path = ca_cert_path + return self + + def proxy(self, proxy: Optional[str]) -> "TransportOptionsBuilder": + """Set the HTTP/HTTPS proxy URL. + + Args: + proxy: Proxy URL (e.g. ``'http://proxy:3128'``), or ``None``. + + Returns: + This builder. + + Raises: + ValueError: If the proxy URL is not a valid URL with a scheme. + """ + if proxy is not None: + from urllib.parse import urlparse + + parsed = urlparse(proxy) + if parsed.scheme not in ("http", "https"): + raise ValueError( + f"Invalid proxy URL (must use http or https scheme): {proxy}" + ) + if not parsed.hostname: + raise ValueError(f"Invalid proxy URL (missing host): {proxy}") + self._proxy = proxy + return self + + def timeout(self, timeout: Optional[int]) -> "TransportOptionsBuilder": + """Set the end-to-end request timeout in milliseconds. + + Args: + timeout: Timeout in milliseconds, or ``None`` for no timeout. + + Returns: + This builder. + """ + self._timeout = timeout + return self + + def follow_redirects(self, follow_redirects: bool) -> "TransportOptionsBuilder": + """Enable or disable automatic redirect following. + + Args: + follow_redirects: ``True`` to follow (default), ``False`` to stop. + + Returns: + This builder. + """ + self._follow_redirects = follow_redirects + return self + + def max_redirects(self, max_redirects: Optional[int]) -> "TransportOptionsBuilder": + """Set the maximum number of redirects to follow. + + Args: + max_redirects: Maximum redirect hops, or ``None`` for client default. + + Returns: + This builder. + """ + self._max_redirects = max_redirects + return self + + def user_agent(self, user_agent: Optional[str]) -> "TransportOptionsBuilder": + """Set a custom User-Agent header value. + + Args: + user_agent: The user agent string, or ``None`` to omit. + + Returns: + This builder. + """ + self._user_agent = user_agent + return self + + def default_header(self, name: str, value: str) -> "TransportOptionsBuilder": + """Add a single transport-level default header. + + Args: + name: Header name. + value: Header value. + + Returns: + This builder. + """ + self._default_headers[name] = value + return self + + def default_headers(self, headers: Dict[str, str]) -> "TransportOptionsBuilder": + """Add multiple transport-level default headers. + + Args: + headers: Map of header names to values. + + Returns: + This builder. + """ + self._default_headers.update(headers) + return self + + def inject_request_id(self, inject_request_id: bool) -> "TransportOptionsBuilder": + """Enable or disable automatic ``X-Request-ID`` header injection. + + Args: + inject_request_id: ``True`` to inject, ``False`` to skip (default). + + Returns: + This builder. + """ + self._inject_request_id = inject_request_id + return self + + def build(self) -> TransportOptions: + """Build and return an immutable :class:`TransportOptions` instance. + + Returns: + The configured transport options. + """ + return TransportOptions( + verify_ssl=self._verify_ssl, + ca_cert_path=self._ca_cert_path, + proxy=self._proxy, + timeout=self._timeout, + follow_redirects=self._follow_redirects, + max_redirects=self._max_redirects, + user_agent=self._user_agent, + default_headers=self._default_headers, + inject_request_id=self._inject_request_id, + ) diff --git a/zitadel_client/utils/__init__.py b/zitadel_client/utils/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/zitadel_client/utils/url_util.py b/zitadel_client/utils/url_util.py deleted file mode 100644 index 49cd8d8b..00000000 --- a/zitadel_client/utils/url_util.py +++ /dev/null @@ -1,16 +0,0 @@ -class URLUtil: - def __init__(self) -> None: - pass - - @staticmethod - def build_hostname(host: str) -> str: - """ - Processes the host string. This might include cleaning up the input, - adding a protocol, or other logic similar to your Java URLUtil.buildHostname method. - """ - # For example, trim whitespace and ensure the host starts with 'https://' - host = host.strip() - # noinspection HttpUrlsUsage - if not host.startswith("http://") and not host.startswith("https://"): - host = "https://" + host - return host diff --git a/zitadel_client/value_serializer.py b/zitadel_client/value_serializer.py new file mode 100644 index 00000000..39a99da6 --- /dev/null +++ b/zitadel_client/value_serializer.py @@ -0,0 +1,281 @@ +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech + +from typing import Any, Dict, List, Optional, Union +from urllib.parse import quote + +from .object_serializer import ObjectSerializer + + +class AllowReservedValue: + """Wraps a query value so the query-string builder preserves RFC 3986 + reserved characters (OAS ``allowReserved: true``) instead of + percent-encoding them. Produced by + :meth:`ValueSerializer.maybe_allow_reserved` and unwrapped when the query + string is assembled. + + Holds the serialized query value (a ``str``, or a ``list`` of strings for + exploded parameters) untouched. + """ + + __slots__ = ("value",) + + def __init__(self, value: Union[str, List[str]]) -> None: + self.value = value + + +class ValueSerializer: + """Serializes parameter values for HTTP requests based on their location and format. + + Converts values into their string representations suitable for HTTP request + paths, query strings, and headers. Handles null values, collections with various + collection formats, and URL encoding. + """ + + @classmethod + def serialize( + cls, + value: Any, + location: str, + schema_type: str, + collection_format: Optional[str] = None, + ) -> Union[str, List[str], None]: + """Serialize a value for inclusion in an HTTP request. + + Args: + value: The value to serialize. + location: Where the parameter appears ('path', 'query', 'header', 'form'). + schema_type: The OpenAPI schema type of the parameter. + collection_format: For array parameters, how to format the collection + ('multi', 'csv', 'ssv', 'tsv', 'pipes'). Defaults to 'csv'. + + Returns: + The serialized string, a list of strings (for 'multi' format), or None. + """ + if value is None: + if location == "query": + return None + return "" + + if isinstance(value, list): + if location == "query": + if collection_format == "multi": + return [ObjectSerializer.stringify(v) for v in value] + elif collection_format == "ssv": + return " ".join(ObjectSerializer.stringify(v) for v in value) + elif collection_format == "tsv": + return "\t".join(ObjectSerializer.stringify(v) for v in value) + elif collection_format == "pipes": + return "|".join(ObjectSerializer.stringify(v) for v in value) + else: + return ",".join(ObjectSerializer.stringify(v) for v in value) + if location == "header": + return ",".join(ObjectSerializer.stringify(v) for v in value) + + str_val = ObjectSerializer.stringify(value) + + if location == "path": + return cls.encode_path_segment(str_val) + + return str_val + + @staticmethod + def encode_path_segment(value: str) -> str: + """Percent-encodes a value for use as a URL path segment. + + Encodes characters that are not allowed in a URI path segment per RFC 3986, + but preserves the sub-delimiters that OAS 3.0 matrix/label/simple styles + use as structural separators: ; = , : @ ! $ & ' ( ) * + + + Args: + value: The raw string to encode. + + Returns: + The percent-encoded path segment string. + """ + if not value: + return value + return quote(value, safe=";=,:@!$&'()*+") + + @staticmethod + def maybe_allow_reserved( + value: Union[str, List[str], None], + allow_reserved: bool, + ) -> Union[str, List[str], "AllowReservedValue", None]: + """Wrap ``value`` in :class:`AllowReservedValue` when the parameter + declares ``allowReserved: true``; otherwise return it unchanged. + + Args: + value: The serialized query value. + allow_reserved: Whether the parameter preserves reserved characters. + + Returns: + The value, wrapped iff ``allow_reserved`` is true and the value is + not ``None``. + """ + if value is None or not allow_reserved: + return value + return AllowReservedValue(value) + + @staticmethod + def encode_query_allowing_reserved(value: str) -> str: + """Percent-encode a query value while leaving RFC 3986 reserved + characters literal (OAS ``allowReserved: true``). + + Everything that is not RFC 3986 reserved or unreserved -- spaces, + control characters, non-ASCII -- is still percent-encoded, so the + result is always a valid URL query segment. Only the reserved set + ``: / ? # [ ] @ ! $ & ' ( ) * + , ; =`` is left literal. A space + becomes ``%20`` (never ``+``), so this uses :func:`quote`, not + :func:`quote_plus`. + + Args: + value: The raw value to encode. + + Returns: + The encoded value with reserved characters preserved. + """ + return quote(value, safe="/?#[]@!$&'()*+,;=:") + + @classmethod + def serialize_styled( + cls, + param_name: str, + value: Any, + location: str, + schema_type: str, + collection_format: Optional[str] = None, + style: Optional[str] = None, + explode: bool = False, + ) -> Union[str, List[str], None]: + """Serialize a value applying OAS 3.0 parameter style formatting. + + Args: + param_name: The parameter name. + value: The value to serialize. + location: Where the parameter appears ('path', 'query', 'header', 'cookie'). + schema_type: The OpenAPI schema type of the parameter. + collection_format: Legacy collection format (csv/ssv/tsv/pipes/multi). + style: OAS 3.0 parameter style (simple, form, matrix, label, + spaceDelimited, pipeDelimited). If ``None``, delegates to + :meth:`serialize`. + explode: Whether to explode array/object values. + + Returns: + The serialized string, a list of strings (for exploded form), or None. + """ + # Path parameters are required components of the URL — accepting an + # empty string would silently produce a malformed URL like + # `/resource//details`, which most servers route to 404 instead of + # surfacing the bug at the call site. The required-non-null check + # lives in the operation method; here we catch the empty-string + # case that slips through it. + if location == "path" and isinstance(value, str) and value == "": + raise ValueError(f"Path parameter '{param_name}' must not be empty") + + if style is None or style == "": + return cls.serialize(value, location, schema_type, collection_format) + + if value is None: + if location == "query": + return None + return "" + + # For path styles, percent-encode each individual item BEFORE applying + # the structural separators (";", "=", ".", ",") that the style defines. + # This ensures reserved characters inside the value are escaped while + # the style's structural punctuation remains literal. + items: List[str] = [] + encoded_scalar = "" + if location == "path": + if isinstance(value, list): + items = [ + cls.encode_path_segment(ObjectSerializer.stringify(v)) + for v in value + ] + else: + encoded_scalar = cls.encode_path_segment( + ObjectSerializer.stringify(value) + ) + else: + if isinstance(value, list): + items = [ObjectSerializer.stringify(v) for v in value] + + if style == "matrix": + if isinstance(value, list): + if explode: + return "".join(f";{param_name}={item}" for item in items) + else: + return f";{param_name}={','.join(items)}" + if location == "path": + return f";{param_name}={encoded_scalar}" + return f";{param_name}={ObjectSerializer.stringify(value)}" + + if style == "label": + if isinstance(value, list): + if explode: + return "." + ".".join(items) + else: + return "." + ",".join(items) + if location == "path": + return f".{encoded_scalar}" + return f".{ObjectSerializer.stringify(value)}" + + if style == "spaceDelimited": + if isinstance(value, list): + if explode: + return items + return " ".join(items) + return ObjectSerializer.stringify(value) + + if style == "pipeDelimited": + if isinstance(value, list): + if explode: + return items + return "|".join(items) + return ObjectSerializer.stringify(value) + + if style == "form": + if isinstance(value, list): + if explode: + return items + return ",".join(items) + return ObjectSerializer.stringify(value) + + if style == "simple": + if isinstance(value, list): + return ",".join(items) + if location == "path": + return encoded_scalar + return ObjectSerializer.stringify(value) + + return cls.serialize(value, location, schema_type, collection_format) + + @classmethod + def serialize_deep_object( + cls, + param_name: str, + value: Optional[Dict[str, Any]], + ) -> Dict[str, str]: + """Serialize a deepObject-style query parameter. + + Produces a dict of flattened keys in the form ``param_name[key]`` to + stringified values, suitable for inclusion in a query string. + + Args: + param_name: The parameter name (e.g. 'filter'). + value: The dict value to serialize. + + Returns: + A dict of expanded keys to serialized values. + """ + result: Dict[str, str] = {} + if value is None: + return result + for key, val in value.items(): + result[f"{param_name}[{key}]"] = ObjectSerializer.stringify(val) + return result diff --git a/zitadel_client/version.py b/zitadel_client/version.py deleted file mode 100644 index 556d9125..00000000 --- a/zitadel_client/version.py +++ /dev/null @@ -1,5 +0,0 @@ -class Version: - def __init__(self) -> None: - pass - - VERSION = "4.1.9" diff --git a/zitadel_client/zitadel.py b/zitadel_client/zitadel.py index f6d56ffc..24339621 100644 --- a/zitadel_client/zitadel.py +++ b/zitadel_client/zitadel.py @@ -1,15 +1,31 @@ -from types import TracebackType -from typing import Callable, Optional, Type, TypeVar +# Zitadel SDK +# The Zitadel SDK is a convenience wrapper around the Zitadel APIs to assist you in integrating with your Zitadel environment. This SDK enables you to handle resources, settings, and configurations within the Zitadel platform. +# +# The version of the OpenAPI document: 1.0.0 +# +# Generated by: https://openapi-generator.tech +from typing import Optional + +from zitadel_client.auth.authenticator import Authenticator +from zitadel_client.auth.bearer_authenticator import BearerAuthenticator +from zitadel_client.auth.http_aware_authenticator import HttpAwareAuthenticator +from zitadel_client.configuration import Configuration +from zitadel_client.default_api_client import DefaultApiClient +from zitadel_client.transport_options import TransportOptions from zitadel_client.api.action_service_api import ActionServiceApi from zitadel_client.api.application_service_api import ApplicationServiceApi from zitadel_client.api.authorization_service_api import AuthorizationServiceApi from zitadel_client.api.beta_action_service_api import BetaActionServiceApi from zitadel_client.api.beta_app_service_api import BetaAppServiceApi -from zitadel_client.api.beta_authorization_service_api import BetaAuthorizationServiceApi +from zitadel_client.api.beta_authorization_service_api import ( + BetaAuthorizationServiceApi, +) from zitadel_client.api.beta_feature_service_api import BetaFeatureServiceApi from zitadel_client.api.beta_instance_service_api import BetaInstanceServiceApi -from zitadel_client.api.beta_internal_permission_service_api import BetaInternalPermissionServiceApi +from zitadel_client.api.beta_internal_permission_service_api import ( + BetaInternalPermissionServiceApi, +) from zitadel_client.api.beta_oidc_service_api import BetaOIDCServiceApi from zitadel_client.api.beta_organization_service_api import BetaOrganizationServiceApi from zitadel_client.api.beta_project_service_api import BetaProjectServiceApi @@ -21,7 +37,9 @@ from zitadel_client.api.feature_service_api import FeatureServiceApi from zitadel_client.api.identity_provider_service_api import IdentityProviderServiceApi from zitadel_client.api.instance_service_api import InstanceServiceApi -from zitadel_client.api.internal_permission_service_api import InternalPermissionServiceApi +from zitadel_client.api.internal_permission_service_api import ( + InternalPermissionServiceApi, +) from zitadel_client.api.oidc_service_api import OIDCServiceApi from zitadel_client.api.organization_service_api import OrganizationServiceApi from zitadel_client.api.project_service_api import ProjectServiceApi @@ -30,257 +48,213 @@ from zitadel_client.api.settings_service_api import SettingsServiceApi from zitadel_client.api.user_service_api import UserServiceApi from zitadel_client.api.web_key_service_api import WebKeyServiceApi -from zitadel_client.api_client import ApiClient -from zitadel_client.auth.authenticator import Authenticator -from zitadel_client.auth.client_credentials_authenticator import ClientCredentialsAuthenticator -from zitadel_client.auth.personal_access_token_authenticator import PersonalAccessTokenAuthenticator -from zitadel_client.auth.web_token_authenticator import WebTokenAuthenticator -from zitadel_client.configuration import Configuration -from zitadel_client.transport_options import TransportOptions class Zitadel: - """ - Main entry point for the Zitadel SDK. + """Unified entry point for all API services. + + Takes an :class:`Authenticator` and optionally :class:`TransportOptions`, + then exposes each API group as a typed property. If the authenticator + implements :class:`HttpAwareAuthenticator`, the shared :class:`ApiClient` + is injected so that authentication HTTP calls (token exchange, discovery) + use the same transport configuration as regular API calls. - This class initializes and configures the SDK with the provided authentication strategy. - It sets up service APIs for interacting with various Zitadel features such as identity providers, - organizations, sessions, settings, users, and more. + Usage:: - Attributes: - features (FeatureServiceApi) - Endpoints for feature management. - idps (IdentityProviderServiceApi) - Endpoints for identity-provider operations. - oidc (OIDCServiceApi) - Endpoints for OIDC-related operations. - organizations (OrganizationServiceApi) - Endpoints for organization management. - saml (SAMLServiceApi) - Endpoints for SAML identity-provider management. - sessions (SessionServiceApi) - Endpoints for session lifecycle management. - settings (SettingsServiceApi) - Endpoints for organization- and instance-level settings. - users (UserServiceApi) - Endpoints for end-user management. - webkeys (WebKeyServiceApi) - Endpoints for WebCrypto keys (JWKS). - actions (ActionServiceApi)) - Endpoints for custom action workflows. - beta_projects (BetaProjectServiceApi) - Preview endpoints for project management. - beta_apps (BetaAppServiceApi) - Preview endpoints for application registration. - beta_oidc (BetaOIDCServiceApi) - Preview endpoints for OIDC features not yet GA. - beta_users (BetaUserServiceApi) - Preview endpoints for advanced user management. - beta_organizations (BetaOrganizationServiceApi) - Preview endpoints for organization features. - beta_settings (BetaSettingsServiceApi) - Preview endpoints for settings not yet GA. - beta_permissions (BetaInternalPermissionServiceApi) - Preview endpoints for fine-grained permission management. - beta_authorizations (BetaAuthorizationServiceApi) - Preview endpoints for authorization workflows. - beta_sessions (BetaSessionServiceApi) - Preview endpoints for session features not yet GA. - beta_instance (BetaInstanceServiceApi) - Preview endpoints for instance-level operations. - beta_telemetry (BetaTelemetryServiceApi) - Preview endpoints for telemetry and observability. - beta_features (BetaFeatureServiceApi) - Preview endpoints for new feature toggles. - beta_webkeys (BetaWebKeyServiceApi) - Preview endpoints for WebCrypto keys in Beta. - beta_actions (BetaActionServiceApi) - Preview endpoints for custom action workflows. + # Default transport + client = Zitadel(authenticator) + + # Custom transport (proxy, timeouts, etc.) + transport = TransportOptions.builder() \\ + .proxy('http://proxy:3128') \\ + .timeout(5000) \\ + .build() + client = Zitadel(authenticator, transport) """ def __init__( self, authenticator: Authenticator, - mutate_config: Optional[Callable[[Configuration], None]] = None, - ): - """ - Initialize the Zitadel SDK. + transport_options: Optional[TransportOptions] = None, + ) -> None: + """Creates a new client with the given authenticator and transport options. - This constructor creates a configuration instance using the provided authenticator. - Optionally, the configuration can be modified via the `mutate_config` callback function. - It then instantiates the underlying API client and initializes various service APIs. + If the authenticator implements :class:`HttpAwareAuthenticator`, the + shared :class:`ApiClient` is injected so that token exchange and + discovery requests use the same proxy, TLS, and timeout settings. Args: - authenticator (Authenticator): The authentication strategy to be used. - mutate_config (callable, optional): A callback function that receives the configuration - instance for any additional modifications before the API client is created. - Defaults to None. + authenticator: Provides host URL and auth headers. + transport_options: HTTP transport configuration (proxy, TLS, + timeouts, etc.). """ - self.configuration = Configuration(authenticator) - - if mutate_config: - mutate_config(self.configuration) - - client = ApiClient(configuration=self.configuration) - self.features = FeatureServiceApi(client) - self.idps = IdentityProviderServiceApi(client) - self.oidc = OIDCServiceApi(client) - self.organizations = OrganizationServiceApi(client) - self.saml = SAMLServiceApi(client) - self.sessions = SessionServiceApi(client) - self.settings = SettingsServiceApi(client) - self.users = UserServiceApi(client) - self.webkeys = WebKeyServiceApi(client) - self.actions = ActionServiceApi(client) - self.applications = ApplicationServiceApi(client) - self.authorizations = AuthorizationServiceApi(client) - self.beta_projects = BetaProjectServiceApi(client) - self.beta_apps = BetaAppServiceApi(client) - self.beta_oidc = BetaOIDCServiceApi(client) - self.beta_users = BetaUserServiceApi(client) - self.beta_organizations = BetaOrganizationServiceApi(client) - self.beta_settings = BetaSettingsServiceApi(client) - self.beta_permissions = BetaInternalPermissionServiceApi(client) - self.beta_authorizations = BetaAuthorizationServiceApi(client) - self.beta_sessions = BetaSessionServiceApi(client) - self.beta_instance = BetaInstanceServiceApi(client) - self.beta_telemetry = BetaTelemetryServiceApi(client) - self.instances = InstanceServiceApi(client) - self.internal_permissions = InternalPermissionServiceApi(client) - self.beta_features = BetaFeatureServiceApi(client) - self.beta_webkeys = BetaWebKeyServiceApi(client) - self.beta_actions = BetaActionServiceApi(client) - self.projects = ProjectServiceApi(client) - - # noinspection PyArgumentList - T = TypeVar("T", bound="Zitadel") + if transport_options is None: + transport_options = TransportOptions.builder().build() - def __enter__(self: T) -> T: - """ - Enter the runtime context related to the Zitadel instance. + api_client = DefaultApiClient(transport_options) - Returns: - Zitadel: The current instance. - """ - return self + if isinstance(authenticator, HttpAwareAuthenticator): + authenticator.set_api_client(api_client) - def __exit__( - self, - exc_type: Optional[Type[BaseException]], - exc_value: Optional[BaseException], - traceback: Optional[TracebackType], - ) -> Optional[bool]: - """ - Exit the runtime context. - - This method can be used to perform cleanup actions. Currently, it does nothing. - - Args: - exc_type: The exception type, if an exception occurred. - exc_value: The exception value, if an exception occurred. - traceback: The traceback of the exception, if an exception occurred. - """ - pass - - @staticmethod - def _apply_transport_options( - config: Configuration, - transport_options: TransportOptions, - ) -> None: - """ - Apply transport options to the SDK configuration. - - :param config: The Configuration instance to modify. - :param transport_options: Transport options for TLS, proxy, and headers. - """ - config.default_headers = dict(transport_options.default_headers) - if transport_options.ca_cert_path: - config.ssl_ca_cert = transport_options.ca_cert_path - if transport_options.insecure: - config.verify_ssl = False - if transport_options.proxy_url: - config.proxy_url = transport_options.proxy_url + config = Configuration.builder().base_url(authenticator.get_host()).build() + # API operations for the ActionServiceApi group. + self.action_service: ActionServiceApi = ActionServiceApi( + api_client, config, authenticator + ) + # API operations for the ApplicationServiceApi group. + self.application_service: ApplicationServiceApi = ApplicationServiceApi( + api_client, config, authenticator + ) + # API operations for the AuthorizationServiceApi group. + self.authorization_service: AuthorizationServiceApi = AuthorizationServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaActionServiceApi group. + self.beta_action_service: BetaActionServiceApi = BetaActionServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaAppServiceApi group. + self.beta_app_service: BetaAppServiceApi = BetaAppServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaAuthorizationServiceApi group. + self.beta_authorization_service: BetaAuthorizationServiceApi = ( + BetaAuthorizationServiceApi(api_client, config, authenticator) + ) + # API operations for the BetaFeatureServiceApi group. + self.beta_feature_service: BetaFeatureServiceApi = BetaFeatureServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaInstanceServiceApi group. + self.beta_instance_service: BetaInstanceServiceApi = BetaInstanceServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaInternalPermissionServiceApi group. + self.beta_internal_permission_service: BetaInternalPermissionServiceApi = ( + BetaInternalPermissionServiceApi(api_client, config, authenticator) + ) + # API operations for the BetaOIDCServiceApi group. + self.beta_oidc_service: BetaOIDCServiceApi = BetaOIDCServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaOrganizationServiceApi group. + self.beta_organization_service: BetaOrganizationServiceApi = ( + BetaOrganizationServiceApi(api_client, config, authenticator) + ) + # API operations for the BetaProjectServiceApi group. + self.beta_project_service: BetaProjectServiceApi = BetaProjectServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaSessionServiceApi group. + self.beta_session_service: BetaSessionServiceApi = BetaSessionServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaSettingsServiceApi group. + self.beta_settings_service: BetaSettingsServiceApi = BetaSettingsServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaTelemetryServiceApi group. + self.beta_telemetry_service: BetaTelemetryServiceApi = BetaTelemetryServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaUserServiceApi group. + self.beta_user_service: BetaUserServiceApi = BetaUserServiceApi( + api_client, config, authenticator + ) + # API operations for the BetaWebKeyServiceApi group. + self.beta_web_key_service: BetaWebKeyServiceApi = BetaWebKeyServiceApi( + api_client, config, authenticator + ) + # API operations for the FeatureServiceApi group. + self.feature_service: FeatureServiceApi = FeatureServiceApi( + api_client, config, authenticator + ) + # API operations for the IdentityProviderServiceApi group. + self.identity_provider_service: IdentityProviderServiceApi = ( + IdentityProviderServiceApi(api_client, config, authenticator) + ) + # API operations for the InstanceServiceApi group. + self.instance_service: InstanceServiceApi = InstanceServiceApi( + api_client, config, authenticator + ) + # API operations for the InternalPermissionServiceApi group. + self.internal_permission_service: InternalPermissionServiceApi = ( + InternalPermissionServiceApi(api_client, config, authenticator) + ) + # API operations for the OIDCServiceApi group. + self.oidc_service: OIDCServiceApi = OIDCServiceApi( + api_client, config, authenticator + ) + # API operations for the OrganizationServiceApi group. + self.organization_service: OrganizationServiceApi = OrganizationServiceApi( + api_client, config, authenticator + ) + # API operations for the ProjectServiceApi group. + self.project_service: ProjectServiceApi = ProjectServiceApi( + api_client, config, authenticator + ) + # API operations for the SAMLServiceApi group. + self.saml_service: SAMLServiceApi = SAMLServiceApi( + api_client, config, authenticator + ) + # API operations for the SessionServiceApi group. + self.session_service: SessionServiceApi = SessionServiceApi( + api_client, config, authenticator + ) + # API operations for the SettingsServiceApi group. + self.settings_service: SettingsServiceApi = SettingsServiceApi( + api_client, config, authenticator + ) + # API operations for the UserServiceApi group. + self.user_service: UserServiceApi = UserServiceApi( + api_client, config, authenticator + ) + # API operations for the WebKeyServiceApi group. + self.web_key_service: WebKeyServiceApi = WebKeyServiceApi( + api_client, config, authenticator + ) - @staticmethod - def with_access_token( + @classmethod + def with_token( + cls, host: str, access_token: str, - *, transport_options: Optional[TransportOptions] = None, ) -> "Zitadel": - """ - Initialize the SDK with a Personal Access Token (PAT). - - :param host: API URL (e.g., "https://api.zitadel.example.com"). - :param access_token: Personal Access Token for Bearer authentication. - :param transport_options: Optional transport options for TLS, proxy, and headers. - :return: Configured Zitadel client instance. - :see: https://zitadel.com/docs/guides/integrate/service-users/personal-access-token - """ - resolved = transport_options or TransportOptions.defaults() + """Creates a client authenticated with a static Bearer token. - def mutate_config(config: Configuration) -> None: - Zitadel._apply_transport_options(config, resolved) - - return Zitadel(PersonalAccessTokenAuthenticator(host, access_token), mutate_config=mutate_config) - - @staticmethod - def with_client_credentials( - host: str, - client_id: str, - client_secret: str, - *, - transport_options: Optional[TransportOptions] = None, - ) -> "Zitadel": - """ - Initialize the SDK using OAuth2 Client Credentials flow. + Args: + host: API base URL. + access_token: Bearer token. + transport_options: Optional HTTP transport configuration (proxy, + TLS, timeouts, etc.). - :param host: API URL. - :param client_id: OAuth2 client identifier. - :param client_secret: OAuth2 client secret. - :param transport_options: Optional transport options for TLS, proxy, and headers. - :return: Configured Zitadel client instance with token auto-refresh. - :see: https://zitadel.com/docs/guides/integrate/service-users/client-credentials + Returns: + Configured client instance. """ - resolved = transport_options or TransportOptions.defaults() - - authenticator = ClientCredentialsAuthenticator.builder( - host, - client_id, - client_secret, - transport_options=resolved, - ).build() - - def mutate_config(config: Configuration) -> None: - Zitadel._apply_transport_options(config, resolved) + return cls(BearerAuthenticator(host, access_token), transport_options) - return Zitadel(authenticator, mutate_config=mutate_config) - - @staticmethod - def with_private_key( - host: str, - key_file: str, - *, + @classmethod + def with_authenticator( + cls, + authenticator: Authenticator, transport_options: Optional[TransportOptions] = None, ) -> "Zitadel": - """ - Initialize the SDK via Private Key JWT assertion. - - :param host: API URL. - :param key_file: Path to service account JSON or PEM key file. - :param transport_options: Optional transport options for TLS, proxy, and headers. - :return: Configured Zitadel client instance using JWT assertion. - :see: https://zitadel.com/docs/guides/integrate/service-users/private-key-jwt - """ - resolved = transport_options or TransportOptions.defaults() + """Creates a client from a ready-made authenticator. - authenticator = WebTokenAuthenticator.from_json( - host, - key_file, - transport_options=resolved, - ) + This is the generic entry point for bespoke authentication strategies + such as OAuth2 client credentials, JWT private-key (service account), + or a personal access token (PAT). Supply any :class:`Authenticator` + implementation; if it also implements :class:`HttpAwareAuthenticator`, + the shared :class:`ApiClient` is injected so its HTTP calls reuse the + same transport configuration. - def mutate_config(config: Configuration) -> None: - Zitadel._apply_transport_options(config, resolved) + Args: + authenticator: Provides host URL and auth headers. + transport_options: Optional HTTP transport configuration (proxy, + TLS, timeouts, etc.). - return Zitadel(authenticator, mutate_config=mutate_config) + Returns: + Configured client instance. + """ + return cls(authenticator, transport_options)